public class MsFileHandler extends Object implements SpectrumProvider
Constructor and Description |
---|
MsFileHandler()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static String |
getCmsFilePath(File msFile,
File cmsFolder)
Returns the path of the cms file expected for the given mass spectrometry
file and cms folder.
|
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 fileNameWithoutExtension)
Returns the maximum precursor intensity in a given file.
|
double |
getMaxPrecMz()
Returns the maximum precursor m/z among all files.
|
double |
getMaxPrecMz(String fileNameWithoutExtension)
Returns the maximum precursor m/z in a given file.
|
double |
getMaxPrecRT()
Returns the maximum precursor RT among all files.
|
double |
getMaxPrecRT(String fileNameWithoutExtension)
Returns the maximum precursor RT in a given file.
|
double |
getMinPrecMz()
Returns the minimum precursor m/z among all files.
|
double |
getMinPrecMz(String fileNameWithoutExtension)
Returns the minimum precursor m/z in a given file.
|
String[] |
getOrderedFileNamesWithoutExtensions()
Returns the spectrum file names without file extensions.
|
double[][] |
getPeaks(String fileNameWithoutExtension,
String spectrumTitle)
Returns the spectrum peaks.
|
Precursor |
getPrecursor(String fileNameWithoutExtension,
String spectrumTitle)
Returns the precursor.
|
double |
getPrecursorMz(String fileNameWithoutExtension,
String spectrumTitle)
Returns the measured precursor m/z.
|
double |
getPrecursorRt(String fileNameWithoutExtension,
String spectrumTitle)
Returns the precursor RT window.
|
CmsFileReader |
getReader(String fileNameWithoutExtension)
Returns the cms file reader for the given ms file.
|
Spectrum |
getSpectrum(String fileNameWithoutExtension,
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.
|
void |
register(File msFile,
File cmsFolder,
WaitingHandler waitingHandler)
Registers a mass spectrometry file and enables querying its spectra.If
the file is not a cms file, a cms file will be created in the cms folder
if not null, along the ms file otherwise.
|
void |
register(File msFile,
WaitingHandler waitingHandler)
Registers a mass spectrometry file and enables querying its spectra.If
the file is not a cms file, a cms file will be created along with the ms
file.
|
public void register(File msFile, WaitingHandler waitingHandler) throws IOException
msFile
- The mass spectrometry file to register.waitingHandler
- The waiting handler.IOException
- Exception thrown if an error occurs while reading or
writing a file.public void register(File msFile, File cmsFolder, WaitingHandler waitingHandler) throws IOException
msFile
- The mass spectrometry file to register.cmsFolder
- The folder where to save the cms files.waitingHandler
- The waiting handler.IOException
- Exception thrown if an error occurs while reading or
writing a file.public static String getCmsFilePath(File msFile, File cmsFolder)
msFile
- The mass spectrometry file.cmsFolder
- The folder where to save the cms files.public CmsFileReader getReader(String fileNameWithoutExtension)
fileNameWithoutExtension
- The name of the ms file without file
extension.public Spectrum getSpectrum(String fileNameWithoutExtension, String spectrumTitle)
SpectrumProvider
getSpectrum
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public Precursor getPrecursor(String fileNameWithoutExtension, String spectrumTitle)
SpectrumProvider
getPrecursor
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double getPrecursorMz(String fileNameWithoutExtension, String spectrumTitle)
SpectrumProvider
getPrecursorMz
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double getPrecursorRt(String fileNameWithoutExtension, String spectrumTitle)
SpectrumProvider
getPrecursorRt
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double[][] getPeaks(String fileNameWithoutExtension, String spectrumTitle)
SpectrumProvider
getPeaks
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.spectrumTitle
- The title of the spectrum.public double getMinPrecMz(String fileNameWithoutExtension)
SpectrumProvider
getMinPrecMz
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.public double getMaxPrecMz(String fileNameWithoutExtension)
SpectrumProvider
getMaxPrecMz
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.public double getMaxPrecInt(String fileNameWithoutExtension)
SpectrumProvider
getMaxPrecInt
in interface SpectrumProvider
fileNameWithoutExtension
- The name of the spectrum file without
file extension.public double getMaxPrecRT(String fileNameWithoutExtension)
SpectrumProvider
getMaxPrecRT
in interface SpectrumProvider
fileNameWithoutExtension
- 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.