public class CmsFileReader extends Object implements SpectrumProvider
Modifier and Type | Field and Description |
---|---|
String[] |
titles
The titles of the spectra.
|
Constructor and Description |
---|
CmsFileReader(File file,
WaitingHandler waitingHandler)
Constructor allocating for single thread usage.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
HashMap<String,String> |
getCmsFilePaths()
Returns the absolute path to the cms file indexed by ms file name without
file extension.
|
HashMap<String,String> |
getFilePaths()
Returns the absolute path to the original mass spec file containing the
spectra in a map indexed by file name without file extension.
|
double |
getMaxPrecInt()
Returns the maximum precursor intensity among all files.
|
double |
getMaxPrecInt(String fileName)
Returns the maximum precursor intensity in a given file.
|
double |
getMaxPrecMz()
Returns the maximum precursor m/z among all files.
|
double |
getMaxPrecMz(String fileName)
Returns the maximum precursor m/z in a given file.
|
double |
getMaxPrecRT()
Returns the maximum precursor RT among all files.
|
double |
getMaxPrecRT(String fileName)
Returns the maximum precursor RT in a given file.
|
double |
getMinPrecMz()
Returns the minimum precursor m/z among all files.
|
double |
getMinPrecMz(String fileName)
Returns the minimum precursor m/z in a given file.
|
String[] |
getOrderedFileNamesWithoutExtensions()
Returns the spectrum file names without file extensions.
|
double[][] |
getPeaks(String spectrumTitle)
Returns the peaks of the spectrum with the given title.
|
double[][] |
getPeaks(String fileName,
String spectrumTitle)
Returns the spectrum peaks.
|
Precursor |
getPrecursor(String spectrumTitle)
Returns the precursor of the spectrum with the given title.
|
Precursor |
getPrecursor(String fileName,
String spectrumTitle)
Returns the precursor.
|
double |
getPrecursorMz(String spectrumTitle)
Returns the m/z of the precursor of the spectrum with the given title.
|
double |
getPrecursorMz(String fileName,
String spectrumTitle)
Returns the measured precursor m/z.
|
double |
getPrecursorRt(String spectrumTitle)
Returns the RT of the precursor of the spectrum with the given title.
|
double |
getPrecursorRt(String fileName,
String spectrumTitle)
Returns the precursor RT window.
|
Spectrum |
getSpectrum(String spectrumTitle)
Returns the spectrum with the given title.
|
Spectrum |
getSpectrum(String fileName,
String spectrumTitle)
Returns the spectrum with the given title in the given file.
|
String[] |
getSpectrumTitles(String fileName)
Returns the spectrum titles for the given mass spectrometry file name.
|
static byte[] |
uncompress(byte[] compressedByteArray,
int uncompressedLength)
Uncompresses the given byte array.
|
public final String[] titles
public CmsFileReader(File file, WaitingHandler waitingHandler) throws FileNotFoundException, IOException
file
- the file to readwaitingHandler
- the waiting handlerFileNotFoundException
- thrown if the file was not foundIOException
- thrown if an error occurred while attempting to read
the filepublic Spectrum getSpectrum(String spectrumTitle)
spectrumTitle
- title of the spectrumpublic Precursor getPrecursor(String spectrumTitle)
spectrumTitle
- title of the spectrumpublic double getPrecursorMz(String spectrumTitle)
spectrumTitle
- the title of the spectrumpublic double getPrecursorRt(String spectrumTitle)
spectrumTitle
- the title of the spectrumpublic double[][] getPeaks(String spectrumTitle)
spectrumTitle
- the title of the spectrumpublic static byte[] uncompress(byte[] compressedByteArray, int uncompressedLength)
compressedByteArray
- the compressed byte arrayuncompressedLength
- the uncompressed lengthpublic Spectrum getSpectrum(String fileName, String spectrumTitle)
SpectrumProvider
getSpectrum
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public Precursor getPrecursor(String fileName, String spectrumTitle)
SpectrumProvider
getPrecursor
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double getPrecursorMz(String fileName, String spectrumTitle)
SpectrumProvider
getPrecursorMz
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double getPrecursorRt(String fileName, String spectrumTitle)
SpectrumProvider
getPrecursorRt
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double[][] getPeaks(String fileName, String spectrumTitle)
SpectrumProvider
getPeaks
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double getMinPrecMz(String fileName)
SpectrumProvider
getMinPrecMz
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.public double getMaxPrecMz(String fileName)
SpectrumProvider
getMaxPrecMz
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.public double getMaxPrecInt(String fileName)
SpectrumProvider
getMaxPrecInt
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.public double getMaxPrecRT(String fileName)
SpectrumProvider
getMaxPrecRT
in interface SpectrumProvider
fileName
- The name of the spectrum file without
file extension.public double getMinPrecMz()
SpectrumProvider
getMinPrecMz
in interface SpectrumProvider
public double getMaxPrecMz()
SpectrumProvider
getMaxPrecMz
in interface SpectrumProvider
public double getMaxPrecInt()
SpectrumProvider
getMaxPrecInt
in interface SpectrumProvider
public double getMaxPrecRT()
SpectrumProvider
getMaxPrecRT
in interface SpectrumProvider
public String[] getOrderedFileNamesWithoutExtensions()
SpectrumProvider
getOrderedFileNamesWithoutExtensions
in interface SpectrumProvider
public HashMap<String,String> getFilePaths()
SpectrumProvider
getFilePaths
in interface SpectrumProvider
public HashMap<String,String> getCmsFilePaths()
SpectrumProvider
getCmsFilePaths
in interface SpectrumProvider
public void close()
close
in interface SpectrumProvider
close
in interface AutoCloseable
public String[] getSpectrumTitles(String fileName)
SpectrumProvider
getSpectrumTitles
in interface SpectrumProvider
fileName
- The mass spectrometry file name without
file extension.Copyright © 2021. All rights reserved.