com.compomics.util.experiment.io.massspectrometry
Class MgfIndex

java.lang.Object
  extended by com.compomics.util.experiment.personalization.ExperimentObject
      extended by com.compomics.util.experiment.io.massspectrometry.MgfIndex
All Implemented Interfaces:
Serializable, Cloneable

public class MgfIndex
extends ExperimentObject

This class contains the indexes of an mgf file after indexing mapped with the title of the spectrum.

Author:
Marc Vaudel, Harald Barsnes
See Also:
Serialized Form

Constructor Summary
MgfIndex(ArrayList<String> spectrumTitles, HashMap<String,Long> indexMap, String fileName, double minRT, double maxRT, double maxMz, double maxIntensity, int maxCharge, int maxPeakCount, long lastModified)
          Constructor.
 
Method Summary
 boolean containsSpectrum(String spectrumTitle)
          Returns a boolean indicating whether the spectrum title is implemented in this index.
 String getFileName()
          Returns the name of the indexed file.
 Long getIndex(String spectrumTitle)
          Returns the index corresponding to the desired spectrum.
 Long getLastModified()
          Returns when the file was last modified.
 Integer getMaxCharge()
          Returns the maximal charge found in the mgf file.
 Double getMaxIntensity()
          Returns the maximum precursor intensity in this file.
 Double getMaxMz()
          Returns the maximum m/z in this file.
 Integer getMaxPeakCount()
          Returns the maximum peak count in this file.
 Double getMaxRT()
          Returns the maximal RT in this file.
 Double getMinRT()
          Returns the minimum RT in this file.
 int getNSpectra()
          Returns the number of imported spectra.
 ArrayList<String> getSpectrumTitles()
          Returns an ordered list of all spectrum titles.
 void setMaxCharge(Integer maxCharge)
          Sets the maximum charge in this file.
 void setMaxIntensity(Double maxIntensity)
          Sets the maximum precursor intensity in this file.
 void setMaxMz(Double maxMz)
          Sets the maximum m/z in this file.
 void setMaxPeakCount(Integer maxPeakCount)
          Sets the maximum peak count in this file.
 void setMaxRT(Double maxRT)
          Sets the maximal RT in this file.
 void setMinRT(Double minRT)
          Sets the minimum RT in this file.
 
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, getParameterKey, getUrParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MgfIndex

public MgfIndex(ArrayList<String> spectrumTitles,
                HashMap<String,Long> indexMap,
                String fileName,
                double minRT,
                double maxRT,
                double maxMz,
                double maxIntensity,
                int maxCharge,
                int maxPeakCount,
                long lastModified)
Constructor.

Parameters:
spectrumTitles - an ordered list of all spectrum titles
indexMap - map of all indexes: spectrum title -> index in the file
fileName - the mgf file name
maxRT - the maximum retention time
minRT - the minimum retention tome
maxMz - the maximum m/z value
maxIntensity - the maximum precursor intensity
maxCharge - the maximum peak precursor charge
maxPeakCount - the maximum peak count
lastModified - a long indicating the last time the indexed file was modified
Method Detail

getIndex

public Long getIndex(String spectrumTitle)
Returns the index corresponding to the desired spectrum.

Parameters:
spectrumTitle - the desired spectrum
Returns:
the corresponding index

containsSpectrum

public boolean containsSpectrum(String spectrumTitle)
Returns a boolean indicating whether the spectrum title is implemented in this index.

Parameters:
spectrumTitle - the spectrum title
Returns:
a boolean indicating whether the spectrum title is implemented in this index

getSpectrumTitles

public ArrayList<String> getSpectrumTitles()
Returns an ordered list of all spectrum titles.

Returns:
an ordered list of all spectrum titles

getFileName

public String getFileName()
Returns the name of the indexed file.

Returns:
the name of the indexed file

getMaxRT

public Double getMaxRT()
Returns the maximal RT in this file.

Returns:
the maximal RT in this file

setMaxRT

public void setMaxRT(Double maxRT)
Sets the maximal RT in this file.

Parameters:
maxRT - the maximal RT in this file

getMaxMz

public Double getMaxMz()
Returns the maximum m/z in this file.

Returns:
the maximum m/z in this file

setMaxCharge

public void setMaxCharge(Integer maxCharge)
Sets the maximum charge in this file.

Parameters:
maxCharge - the maximum charge in this file

getMaxCharge

public Integer getMaxCharge()
Returns the maximal charge found in the mgf file.

Returns:
the maximal charge found in the mgf file

setMaxMz

public void setMaxMz(Double maxMz)
Sets the maximum m/z in this file.

Parameters:
maxMz - the maximum m/z in this file

getMaxIntensity

public Double getMaxIntensity()
Returns the maximum precursor intensity in this file.

Returns:
the maximum precursor intensity in this file

setMaxIntensity

public void setMaxIntensity(Double maxIntensity)
Sets the maximum precursor intensity in this file.

Parameters:
maxIntensity - the maximum precursor intensity in this file

getMinRT

public Double getMinRT()
Returns the minimum RT in this file.

Returns:
the minimum RT in this file

setMinRT

public void setMinRT(Double minRT)
Sets the minimum RT in this file.

Parameters:
minRT - the minimum RT in this file

getMaxPeakCount

public Integer getMaxPeakCount()
Returns the maximum peak count in this file.

Returns:
the maximum peak count in this file

setMaxPeakCount

public void setMaxPeakCount(Integer maxPeakCount)
Sets the maximum peak count in this file.

Parameters:
maxPeakCount - the maximum peak count in this file

getNSpectra

public int getNSpectra()
Returns the number of imported spectra.

Returns:
the number of imported spectra

getLastModified

public Long getLastModified()
Returns when the file was last modified. Null if not set or for utilities versions older than 3.11.30.

Returns:
a long indicating when the file was last modified


Copyright © 2013. All Rights Reserved.