|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.massspectrometry.SpectrumCollection
public class SpectrumCollection
This class represents a collection of spectra acquired during a proteomicAnalysis
Field Summary | |
---|---|
static int |
MGF
static index for an mgf collection |
static int |
MZML
static index for an mzML collection |
Constructor Summary | |
---|---|
SpectrumCollection()
constructor for an empty collection (The import source must be specified afterwards!) |
|
SpectrumCollection(int sourceType)
Constructor |
Method Summary | |
---|---|
void |
addIdentifiedSpectra(File file,
Ms2Identification identification)
Adds all spectra identified in the specified identification |
void |
addSpectra(File file)
Adds all spectra from a file |
void |
addSpectrum(MSnSpectrum spectrum)
Adds a spectrum to the collection |
boolean |
contains(String spectrumKey)
Returns wheter a spectrum is contained in the collection |
ArrayList<String> |
getAllKeys()
Returns the keys of all loaded spectra |
ArrayList<String> |
getAllKeys(int level)
Returns all keys of the spectra loaded at the specified level |
int |
getSourceType()
Returns the source type as indexed by the static fields |
Spectrum |
getSpectrum(int level,
String spectrumKey)
Getter for a spectrum |
Spectrum |
getSpectrum(String spectrumKey)
Getter for a spectrum |
void |
removePeaks()
Removes all peaklists from the loaded spectra in order to save memory (useless with mzML data) |
void |
setSourceType(int sourceType)
Sets the source type as defined by the static fields |
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject |
---|
addUrParam, getUrParam |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MGF
public static final int MZML
Constructor Detail |
---|
public SpectrumCollection()
public SpectrumCollection(int sourceType)
Method Detail |
---|
public void addSpectrum(MSnSpectrum spectrum)
spectrum
- the selected spectrumpublic Spectrum getSpectrum(int level, String spectrumKey) throws uk.ac.ebi.jmzml.xml.io.MzMLUnmarshallerException
level
- Level at which the spectrum was recorded (2 for MS2 spectra)spectrumKey
- Key of the spectrum
uk.ac.ebi.jmzml.xml.io.MzMLUnmarshallerException
- Exception thrown by the mzML unmarshallerpublic Spectrum getSpectrum(String spectrumKey) throws uk.ac.ebi.jmzml.xml.io.MzMLUnmarshallerException
spectrumKey
- Key of the spectrum
uk.ac.ebi.jmzml.xml.io.MzMLUnmarshallerException
- Exception thrown by the mzML unmarshallerpublic ArrayList<String> getAllKeys(int level)
level
- the specified level
public ArrayList<String> getAllKeys()
public int getSourceType()
public void setSourceType(int sourceType)
sourceType
- the source typepublic void addSpectra(File file) throws Exception
file
- The file to load spectra from
Exception
- Exception thrown whenever an error is encountered while loading the filepublic void addIdentifiedSpectra(File file, Ms2Identification identification) throws Exception
file
- The file containing all identificationsidentification
- The identification of the proteomic analysis
Exception
- Exception thrown whenever an error is encountered why loading the filepublic boolean contains(String spectrumKey)
spectrumKey
- The spectrum Key
public void removePeaks()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |