Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr129 committed Oct 31, 2016
1 parent 2bf3f36 commit 8041adb
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 123 deletions.
6 changes: 3 additions & 3 deletions MetaboliteLevels/Data/Session/General/EAxisRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public enum EAxisRange
/// Autoscale the axis
/// </summary>
[Name("*")]
[Description("Scale to min/max")]
[Description("Scale to vector")]
Automatic,

/// <summary>
/// Autoscale the axis to all possibilities
/// </summary>
[Name( "{I}" )]
[Description( "Scale to min/max of the intensity matrix" )]
[Name( "**" )]
[Description( "Scale to matrix" )]
General,

/// <summary>
Expand Down
60 changes: 30 additions & 30 deletions MetaboliteLevels/Data/Session/General/FileLoadInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@ namespace MetaboliteLevels.Data.Session.General
{
internal sealed class FileLoadInfo
{
public readonly string[] OBSFILE_TIME_HEADER = { "time", "day", "t" };
public readonly string[] OBSFILE_REPLICATE_HEADER = { "rep", "replicate" };
public readonly string[] OBSFILE_GROUP_HEADER = { "type", "group", "condition", "conditions", "class" };
public readonly string[] OBSFILE_BATCH_HEADER = { "batch" };
public readonly string[] OBSFILE_ACQUISITION_HEADER = { "acquisition", "order", "file", "index", "acquisition order" };
public readonly string[] IDFILE_PEAK_HEADER = { "name", "peak", "variable" };
public readonly string[] IDFILE_STATUS_HEADER = { "status", "confirmation" };
public readonly string[] IDFILE_COMPOUNDS_HEADER = { "id", "annotation", "ids", "annotations", "compounds", "compound" };
public readonly string[] ADDUCTFILE_NAME_HEADER = { "name" };
public readonly string[] ADDUCTFILE_CHARGE_HEADER = { "charge", "z" };
public readonly string[] ADDUCTFILE_MASS_DIFFERENCE_HEADER = { "mass.difference" };
public readonly string[] PATHWAYFILE_NAME_HEADER = { "name" };
public readonly string[] PATHWAYFILE_FRAME_ID_HEADER = { "frame.id", "id" };
public readonly string[] COMPOUNDFILE_NAME_HEADER = { "name" };
public readonly string[] COMPOUNDFILE_FRAME_ID_HEADER = { "frame.id", "id" };
public readonly string[] COMPOUNDFILE_MASS_HEADER = { "mass", "m" };
public readonly string[] COMPOUNDFILE_PATHWAYS_HEADER = { "pathways", "pathway", "pathway.ids", "pathway.id" };
public readonly string[] CONDITIONFILE_ID_HEADER = { "id", "frame.id" };
public readonly string[] CONDITIONFILE_NAME_HEADER = { "name" };
public readonly string[] VARFILE_MZ_HEADER = { "mz", "m/z" };
public readonly string[] VARFILE_RT_HEADER = { "rt", "r.t.", "r.t", "rt.", "ret. time", "retention", "retention time" };
public readonly string[] VARFILE_MODE_HEADER = { "mode", "lcmsmode", "lcms", "lcms.mode" };
public readonly string[] AUTOFILE_OBSERVATIONS = { "Info.csv", "ObsInfo.csv", "ObservationInfo.csv", "Observations.csv", "*.jgf" };
public readonly string[] AUTOFILE_PEAKS = { "VarInfo.csv", "PeakInfo.csv", "FeatureInfo.csv", "Peaks.csv", "Variables.csv", "Features.csv" };
public readonly string[] OBSERVATIONFILE_TIME_HEADER = { "time", "day", "t" };
public readonly string[] OBSERVATIONFILE_REPLICATE_HEADER = { "rep", "replicate" };
public readonly string[] OBSERVATIONFILE_GROUP_HEADER = { "type", "group", "condition", "conditions", "class" };
public readonly string[] OBSERVATIONFILE_BATCH_HEADER = { "batch" };
public readonly string[] OBSERVATIONFILE_ACQUISITION_HEADER = { "acquisition", "order", "file", "index", "acquisition order" };
public readonly string[] ANNOTATIONFILE_PEAK_HEADER = { "name", "peak", "variable" };
public readonly string[] ANNOTATIONFILE_STATUS_HEADER = { "status", "confirmation" };
public readonly string[] ANNOTATIONFILE_COMPOUNDS_HEADER = { "id", "annotation", "ids", "annotations", "compounds", "compound" };
public readonly string[] ADDUCTFILE_NAME_HEADER = { "name" };
public readonly string[] ADDUCTFILE_CHARGE_HEADER = { "charge", "z" };
public readonly string[] ADDUCTFILE_MASS_DIFFERENCE_HEADER = { "mass.difference" };
public readonly string[] PATHWAYFILE_NAME_HEADER = { "name" };
public readonly string[] PATHWAYFILE_FRAME_ID_HEADER = { "frame.id", "id" };
public readonly string[] COMPOUNDFILE_NAME_HEADER = { "name" };
public readonly string[] COMPOUNDFILE_FRAME_ID_HEADER = { "frame.id", "id" };
public readonly string[] COMPOUNDFILE_MASS_HEADER = { "mass", "m" };
public readonly string[] COMPOUNDFILE_PATHWAYS_HEADER = { "pathways", "pathway", "pathway.ids", "pathway.id" };
public readonly string[] CONDITIONFILE_ID_HEADER = { "id", "frame.id" };
public readonly string[] CONDITIONFILE_NAME_HEADER = { "name" };
public readonly string[] PEAKFILE_MZ_HEADER = { "mz", "m/z" };
public readonly string[] PEAKFILE_RT_HEADER = { "rt", "r.t.", "r.t", "rt.", "ret. time", "retention", "retention time" };
public readonly string[] PEAKFILE_LCMSMODE_HEADER = { "mode", "lcmsmode", "lcms", "lcms.mode" };
public readonly string[] FILENAMES_OBSERVATIONS = { "Info.csv", "ObsInfo.csv", "ObservationInfo.csv", "Observations.csv", "*.jgf" };
public readonly string[] FILENAMES_PEAKS = { "VarInfo.csv", "PeakInfo.csv", "FeatureInfo.csv", "Peaks.csv", "Variables.csv", "Features.csv" };

public readonly char SpreadsheetDelimiter = ',';
public readonly char SpreadsheetOpenQuote = '\"';
public readonly char SpreadsheetCloseQuote = '\"';
public readonly char SPREADSHEET_DELIMITER = ',';
public readonly char SPREADSHEET_OPEN_QUOTE = '\"';
public readonly char SPREADSHEET_CLOSE_QUOTE = '\"';

public SpreadsheetReader GetReader()
{
return new SpreadsheetReader()
{
Delimiter = this.SpreadsheetDelimiter,
OpenQuote = this.SpreadsheetOpenQuote,
CloseQuote = this.SpreadsheetCloseQuote,
Delimiter = this.SPREADSHEET_DELIMITER,
OpenQuote = this.SPREADSHEET_OPEN_QUOTE,
CloseQuote = this.SPREADSHEET_CLOSE_QUOTE,
};
}
}
Expand Down
30 changes: 15 additions & 15 deletions MetaboliteLevels/Gui/Forms/Activities/FrmActDataLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ public static void Load_5_UserIdentifications( FileLoadInfo dataInfo, MetaInfoHe
prog.Leave();

prog.Enter("Interpreting identifications");
int peakCol = mat.TryFindColumn( dataInfo.IDFILE_PEAK_HEADER );
int mzCol = mat.TryFindColumn( dataInfo.VARFILE_MZ_HEADER );
int rtCol = mat.TryFindColumn( dataInfo.VARFILE_RT_HEADER );
int statusCol = mat.TryFindColumn( dataInfo.IDFILE_STATUS_HEADER );
int compoundsCol = mat.FindColumn( dataInfo.IDFILE_COMPOUNDS_HEADER );
int peakCol = mat.TryFindColumn( dataInfo.ANNOTATIONFILE_PEAK_HEADER );
int mzCol = mat.TryFindColumn( dataInfo.PEAKFILE_MZ_HEADER );
int rtCol = mat.TryFindColumn( dataInfo.PEAKFILE_RT_HEADER );
int statusCol = mat.TryFindColumn( dataInfo.ANNOTATIONFILE_STATUS_HEADER );
int compoundsCol = mat.FindColumn( dataInfo.ANNOTATIONFILE_COMPOUNDS_HEADER );

if (peakCol == -1 && (mzCol == -1 || rtCol == -1))
{
Expand Down Expand Up @@ -960,11 +960,11 @@ private static DataSet Load_1_DataSets(FileLoadInfo dataInfo, DataFileNames file
prog.Enter( "Formatting data" );

// Get the columns
int ssObsDayCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSFILE_TIME_HEADER, "time", "Time information is required for meaningful time-series analysis. Whilst analyses requiring time-series data will function incorrectly you may still be able to perform basic analysis of your data." );
int ssObsRepCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSFILE_REPLICATE_HEADER, "replicate index", "Replicate information is required primarily to distinguish individual datapoints, however most analyses should function without it." );
int ssObsTypCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSFILE_GROUP_HEADER, "experimental group", "Group information is required to compare experimental groups, however if you only have one experimental group this warning can be safely ignored." );
int ssObsBatCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSFILE_BATCH_HEADER, "batch", "Batch information is required in order to apply batch correction. Batch correction options may not function correctly without this information. If your data was not collected batch-wise then this warning can be safely ignored." );
int ssObsAcqCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSFILE_ACQUISITION_HEADER, "acquisition index", "Acquisition information is required in order to apply certain batch correction methods. Some batch correction options may not function correctly without this information. If your data was not collected batch-wise, or if you only intend to perform basic data corrections, then this warning can be safely ignored." );
int ssObsDayCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSERVATIONFILE_TIME_HEADER, "time", "Time information is required for meaningful time-series analysis. Whilst analyses requiring time-series data will function incorrectly you may still be able to perform basic analysis of your data." );
int ssObsRepCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSERVATIONFILE_REPLICATE_HEADER, "replicate index", "Replicate information is required primarily to distinguish individual datapoints, however most analyses should function without it." );
int ssObsTypCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSERVATIONFILE_GROUP_HEADER, "experimental group", "Group information is required to compare experimental groups, however if you only have one experimental group this warning can be safely ignored." );
int ssObsBatCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSERVATIONFILE_BATCH_HEADER, "batch", "Batch information is required in order to apply batch correction. Batch correction options may not function correctly without this information. If your data was not collected batch-wise then this warning can be safely ignored." );
int ssObsAcqCol = TryFindColumn( ssObservations, warnings, dataInfo.OBSERVATIONFILE_ACQUISITION_HEADER, "acquisition index", "Acquisition information is required in order to apply certain batch correction methods. Some batch correction options may not function correctly without this information. If your data was not collected batch-wise, or if you only intend to perform basic data corrections, then this warning can be safely ignored." );

int ssPeakMzCol;
int ssPeakRtCol;
Expand All @@ -980,15 +980,15 @@ private static DataSet Load_1_DataSets(FileLoadInfo dataInfo, DataFileNames file

case ELcmsMode.Positive:
case ELcmsMode.Negative:
ssPeakMzCol = ssPeaks.FindColumn( dataInfo.VARFILE_MZ_HEADER );
ssPeakRtCol = ssPeaks.FindColumn( dataInfo.VARFILE_RT_HEADER );
ssPeakMzCol = ssPeaks.FindColumn( dataInfo.PEAKFILE_MZ_HEADER );
ssPeakRtCol = ssPeaks.FindColumn( dataInfo.PEAKFILE_RT_HEADER );
ssPeakLcmsCol = -1;
break;

case ELcmsMode.Mixed:
ssPeakMzCol = ssPeaks.FindColumn( dataInfo.VARFILE_MZ_HEADER );
ssPeakRtCol = ssPeaks.FindColumn( dataInfo.VARFILE_RT_HEADER );
ssPeakLcmsCol = ssPeaks.FindColumn( dataInfo.VARFILE_MODE_HEADER );
ssPeakMzCol = ssPeaks.FindColumn( dataInfo.PEAKFILE_MZ_HEADER );
ssPeakRtCol = ssPeaks.FindColumn( dataInfo.PEAKFILE_RT_HEADER );
ssPeakLcmsCol = ssPeaks.FindColumn( dataInfo.PEAKFILE_LCMSMODE_HEADER );
break;

default:
Expand Down
1 change: 1 addition & 0 deletions MetaboliteLevels/Gui/Forms/Activities/FrmActPca.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ private FrmPca(Core core, FrmMain frmMain)
this._regressAgainst._colourByObervation = this._colourBy._colourByObervation;

this._chart.AddControls( this.toolStripDropDownButton1);
this._chart.Style.LegendDisplay = ELegendDisplay.Visible;

this.UpdateScores();
}
Expand Down
Loading

0 comments on commit 8041adb

Please sign in to comment.