|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.fhcrc.cpl.viewer.amt.AmtDatabase
public class AmtDatabase
A representation of a full AMT database. Stores everything we'd want to read from or write to amtXml files, and allows us to manipulate the database. An AMT database contains a hierarchical structure, exactly equivalent to the structure defined in the amtXml schema. Briefly: -An AMT database contains a number of runs. -An AMT database also contains a number of known Aminoacid Modifications, which are referenced in the runs and in the modification states (see below) -An AMT database also contains a number of peptide entries. -Each peptide entry contains multiple Modification states. -Each Modification State contains multiple observations. -Each observation knows its hydrophobicity, quality score, and the run it came from. Retention times for observations can come from MS/MS observations, or from matched MS1 feature times (preferred). This is controlled by AmtDatabaseBuilder and isn't tracked in the database, so you'd best keep track yourself. There are obvious connections between AMT databases and peptides, and Features and FeatureSets, but all references to Features are kept out of this class.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_HYDROPHOBICITY_ALGORITHM_NAME
|
static double |
DEFAULT_HYDROPHOBICITY_ALGORITHM_VERSION
|
static double |
DEFAULT_MODIFICATION_MASS_ROUNDING_FACTOR
|
static int |
DEFAULT_PRECISION
|
protected java.util.List<MS2Modification> |
mAminoacidModifications
|
protected java.util.HashMap<MS2Modification,java.lang.Integer> |
mAminoacidModificationSequenceMap
|
protected java.io.File |
mAmtDBSourceFile
|
protected java.util.HashMap<java.lang.String,AmtPeptideEntry> |
mAmtPeptideEntryMap
|
protected java.util.List<AmtRunEntry> |
mAmtRunEntries
|
protected java.util.HashMap<AmtRunEntry,java.lang.Integer> |
mAmtRunSequenceMap
|
protected java.lang.String |
mHydrophobicityAlgorithmName
|
protected double |
mHydrophobicityAlgorithmVersion
|
static float |
MODIFICATION_EQUALITY_MASS_TOLERANCE
|
| Constructor Summary | |
|---|---|
AmtDatabase()
|
|
| Method Summary | |
|---|---|
void |
addAminoacidModification(MS2Modification newMod)
Add a run. |
void |
addObservation(java.lang.String peptideSequence,
java.util.List<MS2Modification>[] ms2Modifications,
double qualityScore,
double hydrophobicity,
AmtRunEntry runEntry,
int spectralCount,
double timeInRun)
Add an observation. |
void |
addObservation(java.lang.String peptideSequence,
java.util.List<MS2Modification>[] ms2Modifications,
double qualityScore,
double hydrophobicity,
AmtRunEntry runEntry,
java.util.Map<java.lang.String,java.lang.Integer> spectralCountsMap,
double timeInRun)
add an observation, having already resolved the modifications |
void |
addObservationsFromAnotherDatabase(AmtDatabase otherDatabase)
For each entry in another AmtDatabase, add all that entry's observations to this database. |
void |
addObservationsFromEntry(AmtPeptideEntry newEntry)
|
void |
addObservationsFromEntry(AmtPeptideEntry newEntry,
java.util.Map<MS2Modification,MS2Modification> oldNewModMap)
Given an entry, add all the observations from all modification states in that entry to the database. |
void |
addOrOverrideEntriesWithAnotherDatabase(AmtDatabase otherDatabase)
For each entry in another AmtDatabase, add it to this database, overriding an existing entry if one exists. |
protected void |
addOrOverrideEntry(AmtPeptideEntry overridingEntry)
Add a peptide entry, blowing away the existing entry if it was there. |
java.util.Map<MS2Modification,MS2Modification> |
addRunEntry(AmtRunEntry newRunEntry)
Add a run. |
double |
calculateMeanDifferenceFromPredictedHydro()
Calculate the mean difference of all median peptide H observations from prediction |
double |
calculateStandardDeviationDifferenceFromPredictedHydro()
Calculate the standard deviation of all deviations of median peptide H observations from prediction |
boolean |
contains(java.lang.String peptideSequence)
|
MS2Modification |
findExistingEquivalentModification(MS2Modification newMS2Mod)
|
MS2Modification |
getAminoacidModificationBySequence(int sequence)
Get the mod with the specified sequence. |
MS2Modification[] |
getAminoacidModifications()
Return an array containing all runs |
java.io.File |
getAmtDBSourceFile()
|
AmtPeptideEntry[] |
getEntries()
This isn't free, because internally we store these as a HashMap |
AmtPeptideEntry |
getEntry(java.lang.String peptideSequence)
|
java.lang.String |
getHydrophobicityAlgorithmName()
|
double |
getHydrophobicityAlgorithmVersion()
|
double |
getMaxTimeInRun(AmtRunEntry runEntry)
Return the maximum time-in-run value for any observation in this run |
double |
getMinTimeInRun(AmtRunEntry runEntry)
Return the minimum time-in-run value for any observation in this run |
AmtPeptideEntry.AmtPeptideObservation[] |
getObservationsForRun(AmtRunEntry runEntry)
this REALLY isn't free |
AmtPeptideEntry[] |
getPeptideEntriesForRun(AmtRunEntry runEntry)
|
java.lang.String[] |
getPeptides()
|
AmtRunEntry |
getRunBySequence(int sequence)
Get the run with the specified sequence. |
AmtRunEntry[] |
getRuns()
Return an array containing all runs |
int |
getSequenceForAminoacidModification(MS2Modification mod)
|
int |
getSequenceForRun(AmtRunEntry runEntry)
|
protected void |
init()
Initialize hashtables, etc |
int |
numAminoacidModifications()
count 'em |
int |
numEntries()
count 'em |
int |
numRuns()
count 'em |
void |
removeEntry(java.lang.String peptideSequence)
Remove an entry for a given sequence |
java.util.List<MS2Modification>[] |
resolveMods(java.lang.String peptideSequence,
java.util.List<ModifiedAminoAcid>[] modifiedAminoAcids,
AmtRunEntry runEntry)
Add an observation. |
void |
resolveModsAndAddObservation(java.lang.String peptideSequence,
java.util.List<ModifiedAminoAcid>[] modifiedAminoAcids,
double qualityScore,
double hydrophobicity,
AmtRunEntry runEntry,
java.util.Map<java.lang.String,java.lang.Integer> spectralCountsMap,
double timeInRun)
Add an observation. |
MS2Modification |
resolveMS2VariableModification(java.lang.String residue,
float massDiff,
AmtRunEntry runEntry)
Given an instance of a modification, figure out which MS2Modification within this run it represents. |
void |
saveToTsvSpreadsheet(java.io.File tsvFile)
Save to a tsv file in some hokey format |
void |
setAmtDBSourceFile(java.io.File mAmtDBSourceFile)
|
void |
setHydrophobicityAlgorithmName(java.lang.String hydrophobicityAlgorithmName)
|
void |
setHydrophobicityAlgorithmVersion(double hydrophobicityAlgorithmVersion)
|
java.lang.String |
toString()
VERY basic summary information |
java.lang.Object |
waistDeepCopy()
Structure of database will be copied. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static int DEFAULT_PRECISION
protected java.util.HashMap<java.lang.String,AmtPeptideEntry> mAmtPeptideEntryMap
protected java.util.List<AmtRunEntry> mAmtRunEntries
public static final float MODIFICATION_EQUALITY_MASS_TOLERANCE
protected java.util.List<MS2Modification> mAminoacidModifications
protected java.util.HashMap<AmtRunEntry,java.lang.Integer> mAmtRunSequenceMap
protected java.util.HashMap<MS2Modification,java.lang.Integer> mAminoacidModificationSequenceMap
protected java.io.File mAmtDBSourceFile
public static final double DEFAULT_MODIFICATION_MASS_ROUNDING_FACTOR
public static final java.lang.String DEFAULT_HYDROPHOBICITY_ALGORITHM_NAME
public static final double DEFAULT_HYDROPHOBICITY_ALGORITHM_VERSION
protected java.lang.String mHydrophobicityAlgorithmName
protected double mHydrophobicityAlgorithmVersion
| Constructor Detail |
|---|
public AmtDatabase()
| Method Detail |
|---|
protected void init()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object waistDeepCopy()
public MS2Modification findExistingEquivalentModification(MS2Modification newMS2Mod)
public MS2Modification resolveMS2VariableModification(java.lang.String residue,
float massDiff,
AmtRunEntry runEntry)
public void resolveModsAndAddObservation(java.lang.String peptideSequence,
java.util.List<ModifiedAminoAcid>[] modifiedAminoAcids,
double qualityScore,
double hydrophobicity,
AmtRunEntry runEntry,
java.util.Map<java.lang.String,java.lang.Integer> spectralCountsMap,
double timeInRun)
peptideSequence - modifiedAminoAcids - qualityScore - hydrophobicity - runEntry -
public void addObservation(java.lang.String peptideSequence,
java.util.List<MS2Modification>[] ms2Modifications,
double qualityScore,
double hydrophobicity,
AmtRunEntry runEntry,
java.util.Map<java.lang.String,java.lang.Integer> spectralCountsMap,
double timeInRun)
peptideSequence - ms2Modifications - qualityScore - hydrophobicity - runEntry - spectralCountsMap - timeInRun -
public java.util.List<MS2Modification>[] resolveMods(java.lang.String peptideSequence,
java.util.List<ModifiedAminoAcid>[] modifiedAminoAcids,
AmtRunEntry runEntry)
peptideSequence - modifiedAminoAcids - runEntry -
public void addObservation(java.lang.String peptideSequence,
java.util.List<MS2Modification>[] ms2Modifications,
double qualityScore,
double hydrophobicity,
AmtRunEntry runEntry,
int spectralCount,
double timeInRun)
peptideSequence - qualityScore - hydrophobicity - runEntry - public void addObservationsFromEntry(AmtPeptideEntry newEntry)
public void addObservationsFromEntry(AmtPeptideEntry newEntry,
java.util.Map<MS2Modification,MS2Modification> oldNewModMap)
newEntry - public void addObservationsFromAnotherDatabase(AmtDatabase otherDatabase)
otherDatabase - public void addOrOverrideEntriesWithAnotherDatabase(AmtDatabase otherDatabase)
otherDatabase -
public void saveToTsvSpreadsheet(java.io.File tsvFile)
throws java.io.FileNotFoundException
tsvFile -
java.io.FileNotFoundExceptionpublic AmtPeptideEntry[] getEntries()
public AmtPeptideEntry[] getPeptideEntriesForRun(AmtRunEntry runEntry)
public AmtPeptideEntry.AmtPeptideObservation[] getObservationsForRun(AmtRunEntry runEntry)
runEntry -
public double getMinTimeInRun(AmtRunEntry runEntry)
runEntry -
public double getMaxTimeInRun(AmtRunEntry runEntry)
runEntry -
public java.lang.String[] getPeptides()
public AmtPeptideEntry getEntry(java.lang.String peptideSequence)
public boolean contains(java.lang.String peptideSequence)
protected void addOrOverrideEntry(AmtPeptideEntry overridingEntry)
overridingEntry - public void removeEntry(java.lang.String peptideSequence)
peptideSequence - public int numEntries()
public int numAminoacidModifications()
public void addAminoacidModification(MS2Modification newMod)
public MS2Modification getAminoacidModificationBySequence(int sequence)
sequence - (one-based)
public MS2Modification[] getAminoacidModifications()
public int getSequenceForAminoacidModification(MS2Modification mod)
public int numRuns()
public java.util.Map<MS2Modification,MS2Modification> addRunEntry(AmtRunEntry newRunEntry)
newRunEntry - public AmtRunEntry getRunBySequence(int sequence)
sequence - (one-based)
public AmtRunEntry[] getRuns()
public int getSequenceForRun(AmtRunEntry runEntry)
runEntry -
public double calculateMeanDifferenceFromPredictedHydro()
public double calculateStandardDeviationDifferenceFromPredictedHydro()
public java.lang.String getHydrophobicityAlgorithmName()
public void setHydrophobicityAlgorithmName(java.lang.String hydrophobicityAlgorithmName)
public double getHydrophobicityAlgorithmVersion()
public void setHydrophobicityAlgorithmVersion(double hydrophobicityAlgorithmVersion)
public java.io.File getAmtDBSourceFile()
public void setAmtDBSourceFile(java.io.File mAmtDBSourceFile)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||