Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSavara committed Jul 23, 2022
2 parents d271da8 + 47bb35d commit 2b0d774
Show file tree
Hide file tree
Showing 153 changed files with 2,281 additions and 3,238 deletions.
60 changes: 30 additions & 30 deletions DefaultUserInput.py

Large diffs are not rendered by default.

Binary file modified Documentation/190930TuningCorrectorInstructions.docx
Binary file not shown.
46 changes: 23 additions & 23 deletions ExampleAnalysis/DefaultUserInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

#//Input Files//
UserChoices['inputFiles'] = {} #initialize the inputFiles container
UserChoices['inputFiles']['referenceFileNamesList'] = ['AcetaldehydeNISTRefMixed2.csv'] #enter the file name of the file containing reference information
UserChoices['inputFiles']['referenceFormsList'] = 'xyyy' #form is either 'xyyy' or 'xyxy' (if using reference pattern time chooser enter as list with forms for each individual reference file ['xyyy','xyyy','xyyy'])
UserChoices['inputFiles']['referencePatternsFileNamesList'] = ['AcetaldehydeNISTRefMixed2.csv'] #enter the file name of the file containing reference information
UserChoices['inputFiles']['referencePatternsFormsList'] = 'xyyy' #form is either 'xyyy' or 'xyxy' (if using reference pattern time chooser enter as list with forms for each individual reference file ['xyyy','xyyy','xyyy'])
UserChoices['inputFiles']['referencePatternTimeRanges'] = [] #Leave empty if not using reference pattern time chooser []
UserChoices['inputFiles']['collectedFileName'] = '2-CrotAcetExp#2.csv' #enter the file name with raw mass spectrometer data
UserChoices['inputFiles']['dataToAnalyzeFileName'] = '2-CrotAcetExp#2.csv' #enter the file name with raw mass spectrometer data

UserChoices['inputFiles']['ionizationDataFileName'] = '181017ProvidedIonizationData.csv' #the name of the file containing the ionization data

Expand All @@ -31,7 +31,7 @@
UserChoices['iterativeAnalysis']['iterationSuffix'] = ''
UserChoices['iterativeAnalysis']['unusedMolecules'] =''
UserChoices['iterativeAnalysis']['oldReferenceFileName'] = []
UserChoices['iterativeAnalysis']['oldCollectedFileName'] =''
UserChoices['iterativeAnalysis']['oldDataToAnalyzeFileName'] =''
UserChoices['iterativeAnalysis']['nextRefFileName'] = []
UserChoices['iterativeAnalysis']['nextExpFileName'] = ''
UserChoices['iterativeAnalysis']['iterationNumber'] = None #just initializing.
Expand Down Expand Up @@ -150,17 +150,17 @@
#Note that 1 is the default and will make no alteration to the data

#//Tuning Corrector - Reference Correction Coefficients//
UserChoices['measuredReferenceYorN'] = {} #initialize the measuredReferenceYorN container
UserChoices['tuningCorrection'] = {} #initialize the tuningCorrection container
#TODO Reference Correction Coefficients feature should be upgraded to enable separate coefficients for each molecule to allow mixing and matching of reference patterns
#TODO This can be tested by looking at the exported reference file and comparing it to the existing reference file
#To change reference data based on mass dependent 2nd degree polynomial fit, input polynomial below. If you do not wish to use this function, simply leave as default
UserChoices['measuredReferenceYorN']['on'] ='no'
UserChoices['measuredReferenceYorN']['referenceFileExistingTuningAndForm'] =['ReferenceCollected.csv','xyyy']
UserChoices['measuredReferenceYorN']['referenceFileDesiredTuningAndForm'] =['ReferenceLiterature.csv','xyyy']
#The reference correction coefficients are always used. If measuredReferenceYorN is 'yes' then the coefficients are overwritten (Ashi thinks it will generate a new reference pattern)
UserChoices['measuredReferenceYorN']['referenceCorrectionCoefficients'] = {'A': 0.0, 'B': 0.0, 'C': 1.0}
UserChoices['tuningCorrection']['on'] ='no'
UserChoices['tuningCorrection']['referenceFileExistingTuningAndForm'] =['ReferenceCollected.csv','xyyy']
UserChoices['tuningCorrection']['referenceFileDesiredTuningAndForm'] =['ReferenceLiterature.csv','xyyy']
#The reference correction coefficients are always used. If tuningCorrection is 'yes' then the coefficients are overwritten (Ashi thinks it will generate a new reference pattern)
UserChoices['tuningCorrection']['referenceCorrectionCoefficients'] = {'A': 0.0, 'B': 0.0, 'C': 1.0}
#default is 'A': 0.0, 'B': 0.0, 'C': 1.0. Used as.... Factor = A*X^2 + B*X + C, so A=0,B=0,C=1.0 means the final factor is 1.0 and independent of molecular weight.
UserChoices['measuredReferenceYorN']['referenceCorrectionCoefficients_cov'] = [0,0,0] #Covariance for reference correction coefficients for tuning corrector. Default is 0,0,0. Can be 9 x 9 covariance.
UserChoices['tuningCorrection']['referenceCorrectionCoefficients_cov'] = [0,0,0] #Covariance for reference correction coefficients for tuning corrector. Default is 0,0,0. Can be 9 x 9 covariance.


#//Reference Pattern Changer // (rpc)
Expand All @@ -179,11 +179,11 @@
]

#//Reference Mass Fragmentation Threshold//
UserChoices['minimalReferenceValue'] = {} #initialize the minimalReferenceValue container
UserChoices['applyReferenceMassFragmentsThresholds'] = {} #initialize the applyReferenceMassFragmentsThresholds container
# if you want to exclude tiny fragmentation peaks
UserChoices['minimalReferenceValue']['on'] = 'no'
UserChoices['minimalReferenceValue']['referenceValueThreshold'] = [2.0]
UserChoices['minimalReferenceValue']['referenceSignificantFragmentThresholds'] = [6.0]
UserChoices['applyReferenceMassFragmentsThresholds']['on'] = 'no'
UserChoices['applyReferenceMassFragmentsThresholds']['referenceMassFragmentFilterThreshold'] = [2.0]
UserChoices['applyReferenceMassFragmentsThresholds']['referenceSignificantFragmentThresholds'] = [6.0]

#//Data Threshold Filter//
UserChoices['lowerBoundThresholdChooser'] = {} #initialize the lowerBoundThresholdChooser container
Expand Down Expand Up @@ -211,18 +211,18 @@
UserChoices['dataSmootherYorN']['polynomialOrder'] = 1 #During the local smoothing, a linear fit (or polynomial fit) is applied.

#//Raw Signal Threshold//
UserChoices['rawSignalThresholdMethod'] = {} #initialize the rawSignalThresholdMethod container
UserChoices['applyRawSignalThresholds'] = {} #initialize the applyRawSignalThresholds container
#To change the threshold at which raw signals are not longer relevant, change below (similar to above function, but for rows instead of columns)
#We think the reference to the 'above function' in the previous line is referring to Data Threshold Filter
#These signals get converted into 0.
#WARNING: This function is highly complex and should be considered a work in progress. It cannot be confirmed to work properly (as of 7/18/17).
UserChoices['rawSignalThresholdMethod']['on'] = 'no'
UserChoices['rawSignalThresholdMethod']['rawSignalThresholdValue'] = [.0000001]
UserChoices['rawSignalThresholdMethod']['sensitivityThresholdValue'] = [1] #this is the number in the Reference given the relative intensity of the signal of the mass fragment
UserChoices['rawSignalThresholdMethod']['rawSignalThresholdDivider'] = []
UserChoices['applyRawSignalThresholds']['on'] = 'no'
UserChoices['applyRawSignalThresholds']['rawSignalThresholdValue'] = [.0000001]
UserChoices['applyRawSignalThresholds']['sensitivityThresholdValue'] = [1] #this is the number in the Reference given the relative intensity of the signal of the mass fragment
UserChoices['applyRawSignalThresholds']['rawSignalThresholdDivider'] = []
#Part of previous entry function, but this function enables the user to change the sum of raw signals, allowing molecules with very high concentrations not to affect previous funciton
UserChoices['rawSignalThresholdMethod']['rawSignalThresholdLimit'] = 'no'
UserChoices['rawSignalThresholdMethod']['rawSignalThresholdLimitPercent'] = []
UserChoices['applyRawSignalThresholds']['rawSignalThresholdLimit'] = 'no'
UserChoices['applyRawSignalThresholds']['rawSignalThresholdLimitPercent'] = []

#//Uncertainties for Calculating Uncertainties in Concentrations//
UserChoices['uncertainties'] = {}
Expand Down Expand Up @@ -294,4 +294,4 @@
SettingsVDictionary = userInputValidityCheck(UserChoices)
populateModuleVariablesFromDictionary(thisModuleObject, SettingsVDictionary)
####End of temporary code####
__var_list__ = ['referenceFileNamesList','referenceFormsList','collectedFileName','referencePatternTimeRanges','ionizationDataFileName','iterativeAnalysis','iterationNumber','iterationSuffix','unusedMolecules','oldReferenceFileName', 'oldCollectedFileName', 'nextRefFileName', 'nextExpFileName','preProcessing','dataAnalysis','dataSimulation','grapher','stopAtGraphs','timeRangeLimit','timeRangeStart','timeRangeFinish','specificMolecules','chosenMoleculesNames','specificMassFragments','chosenMassFragments','moleculeLikelihoods','sensitivityValues','linearBaselineCorrectionSemiAutomatic','baselineType','massesToBackgroundCorrect','earlyBaselineTimes','lateBaselineTimes','backgroundMassFragment','backgroundSlopes','backgroundIntercepts','interpolateYorN','marginalChangeRestriction','ignorableDeltaYThreshold','dataLowerBound','dataUpperBound','dataRangeSpecifierYorN','signalOrConcentrationRange','csvFile','moleculesToRestrict','csvFileName','bruteIncrements','permutationNum','maxPermutations','scaleRawDataOption','scaleRawDataFactor','measuredReferenceYorN','referenceFileExistingTuningAndForm','referenceFileDesiredTuningAndForm','referenceCorrectionCoefficients','referenceCorrectionCoefficients_cov','extractReferencePatternFromDataOption','rpcMoleculesToChange','rpcMoleculesToChangeMF','rpcTimeRanges','minimalReferenceValue','referenceValueThreshold','referenceSignificantFragmentThresholds','lowerBoundThresholdChooser','massesToLowerBoundThresholdFilter','lowerBoundThresholdPercentage','lowerBoundThresholdAbsolute','dataSmootherYorN','dataSmootherChoice','dataSmootherTimeRadius','dataSmootherPointRadius','dataSmootherHeadersToConfineTo','polynomialOrder','rawSignalThresholdMethod','rawSignalThresholdValue','sensitivityThresholdValue','rawSignalThresholdDivider','rawSignalThresholdLimit','rawSignalThresholdLimitPercent','negativeAnalyzerYorN','NegativeAnalyzerTopNContributors','NegativeAnalyzerBaseNumberOfGridIntervals','calculateUncertaintiesInConcentrations' , 'referenceFileUncertainties' ,'collectedFileUncertainties','referenceCorrectionCoefficientsUncertainties', 'referenceCorrectionCoefficientsIonizationUncertainties' ,'answer','uniqueOrCommon','slsWeighting','slsFinish','slsUniquePositiveConcentrationsOnly','objectiveFunctionType','distinguished','fullBrute','SLSUniqueExport', 'implicitSLScorrection', 'finalOptimization', 'concentrationFinder','moleculesTSC_List','TSC_List_Type','moleculeSignalTSC_List','massNumberTSC_List','moleculeConcentrationTSC_List','unitsTSC','preProcessedDataOutputName','resolvedScaledConcentrationsOutputName','scaledConcentrationsPercentages','concentrationsOutputName','simulatedSignalsOutputName','TotalConcentrationsOutputName','ExportAtEachStep','generatePercentages','checkpoint','start','timeSinceLastCheckpoint', 'iterationNumber']
__var_list__ = ['referencePatternsFileNamesList','referencePatternsFormsList','dataToAnalyzeFileName','referencePatternTimeRanges','ionizationDataFileName','iterativeAnalysis','iterationNumber','iterationSuffix','unusedMolecules','oldReferenceFileName', 'oldDataToAnalyzeFileName', 'nextRefFileName', 'nextExpFileName','preProcessing','dataAnalysis','dataSimulation','grapher','stopAtGraphs','timeRangeLimit','timeRangeStart','timeRangeFinish','specificMolecules','chosenMoleculesNames','specificMassFragments','chosenMassFragments','moleculeLikelihoods','sensitivityValues','linearBaselineCorrectionSemiAutomatic','baselineType','massesToBackgroundCorrect','earlyBaselineTimes','lateBaselineTimes','backgroundMassFragment','backgroundSlopes','backgroundIntercepts','interpolateYorN','marginalChangeRestriction','ignorableDeltaYThreshold','dataLowerBound','dataUpperBound','dataRangeSpecifierYorN','signalOrConcentrationRange','csvFile','moleculesToRestrict','csvFileName','bruteIncrements','permutationNum','maxPermutations','scaleRawDataOption','scaleRawDataFactor','tuningCorrection','referenceFileExistingTuningAndForm','referenceFileDesiredTuningAndForm','referenceCorrectionCoefficients','referenceCorrectionCoefficients_cov','extractReferencePatternFromDataOption','rpcMoleculesToChange','rpcMoleculesToChangeMF','rpcTimeRanges','applyReferenceMassFragmentsThresholds','referenceMassFragmentFilterThreshold','referenceSignificantFragmentThresholds','lowerBoundThresholdChooser','massesToLowerBoundThresholdFilter','lowerBoundThresholdPercentage','lowerBoundThresholdAbsolute','dataSmootherYorN','dataSmootherChoice','dataSmootherTimeRadius','dataSmootherPointRadius','dataSmootherHeadersToConfineTo','polynomialOrder','applyRawSignalThresholds','rawSignalThresholdValue','sensitivityThresholdValue','rawSignalThresholdDivider','rawSignalThresholdLimit','rawSignalThresholdLimitPercent','negativeAnalyzerYorN','NegativeAnalyzerTopNContributors','NegativeAnalyzerBaseNumberOfGridIntervals','calculateUncertaintiesInConcentrations' , 'referenceFileUncertainties' ,'collectedFileUncertainties','referenceCorrectionCoefficientsUncertainties', 'referenceCorrectionCoefficientsIonizationUncertainties' ,'answer','uniqueOrCommon','slsWeighting','slsFinish','slsUniquePositiveConcentrationsOnly','objectiveFunctionType','distinguished','fullBrute','SLSUniqueExport', 'implicitSLScorrection', 'finalOptimization', 'concentrationFinder','moleculesTSC_List','TSC_List_Type','moleculeSignalTSC_List','massNumberTSC_List','moleculeConcentrationTSC_List','unitsTSC','preProcessedDataOutputName','resolvedScaledConcentrationsOutputName','scaledConcentrationsPercentages','concentrationsOutputName','simulatedSignalsOutputName','TotalConcentrationsOutputName','ExportAtEachStep','generatePercentages','checkpoint','start','timeSinceLastCheckpoint', 'iterationNumber']
6 changes: 3 additions & 3 deletions ExampleAnalysis/LogFile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Thu May 21 16:26:45 2020

referenceFileName = ['ExtractedReferencePattern.csv']
form = ['xyyy']
collectedFileName = Collected_Reference.csv
dataToAnalyzeFileName = Collected_Reference.csv
linearBaselineCorrectionSemiAutomatic = yes
selection = ['linear']
massesToBackgroundCorrect = [12.0 13.0 14.0 15.0 16.0 17.0 21.0 22.0 24.0 25.0 26.0 27.0 28.0 29.0
30.0]
earlyBaselineTimes = [[850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870], [850, 870]]
lateBaselineTimes = [[1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070], [1050, 1070]]
minimalReferenceValue = yes
referenceValueThreshold = [1.01, 1.01, 1.01]
applyReferenceMassFragmentsThresholds = yes
referenceMassFragmentFilterThreshold = [1.01, 1.01, 1.01]
referenceSignificantFragmentThresholds = [20.0, 20.0, 20.0]
answer = sls
uniqueOrCommon = unique
Expand Down
Loading

0 comments on commit 2b0d774

Please sign in to comment.