public abstract class AbstractMgfReader<A extends PeakAnnotation,S extends Spectrum<A>> extends AbstractMsReader<A,S>
AbstractMsReader.ParseContextacceptUnsortedSpectra, precisionEMPTY_READER| Constructor and Description |
|---|
AbstractMgfReader(Reader reader,
URI spectraSource,
PeakList.Precision precision,
PeakProcessorChain<A> processorChain) |
| Modifier and Type | Method and Description |
|---|---|
String |
getExtension() |
protected boolean |
handleBeginIonLine(S spectrum,
String line)
Handle Begin Ion line
|
protected boolean |
handleComment(S spectrum,
String line)
Handle comment line.
|
protected boolean |
handleEndIonLine(S spectrum,
String line)
Handle end ion line, which is a line that starts with "END IONS".
|
protected void |
handleIntermediaryLine(String line)
Allows subclasses to handle lines that occur between BEGIN IONS and END IONS tags.
|
protected boolean |
handlePeakLine(S spectrum,
String line,
AbstractMsReader.ParseContext context)
Handle peak line, which is any line that starts with a digit
|
protected boolean |
handleTagLine(String tag,
String value,
S spectrum)
Handle tag value line.
|
protected boolean |
handleUnknownLine(S spectrum,
String line)
Handle line that is not a comment, begin ion, tag, peak or end ion.
|
protected abstract S |
newSpectrum(AbstractMsReader.ParseContext context,
PeakList.Precision precision)
Create a new spectrum.
|
protected boolean |
parseChargeTag(String value,
S spectrum)
Parse the line that starts with CHARGE
|
protected String |
parseHeader(AbstractMsReader.ParseContext context)
This is called on reader initialization.
|
protected S |
parseNextEntry(AbstractMsReader.ParseContext context) |
protected void |
parseNextMs1Entry(S spectrum,
AbstractMsReader.ParseContext context)
Parse all the lines that belong to one MS1 spectrum and the metadata and peaks to the spectrum.
|
protected void |
parseNextMs2Entry(S spectrum,
AbstractMsReader.ParseContext context)
Parse all lines that correspond to the next MS2 entry and the metadata and peaks to the spectrum.
|
protected boolean |
parsePepMassTag(String value,
S spectrum)
Parse the line that starts with PEPMASS
|
protected boolean |
parseRetentionTimeTag(String value,
S spectrum)
Parse the line that starts with RTINSECONDS
|
protected boolean |
parseScanTag(String value,
S spectrum)
Parse the line that starts with CHARGE
|
protected abstract boolean |
parseTitleTag(String value,
S spectrum)
Parse the line that starts with a TITLE tag.
|
protected boolean |
parseUnknownTag(String tag,
String value,
S spectrum)
Called if there are any tags that are not handled by MgfReader
This is meant to be over ridden by subclasses that want to
parse tags that the MgfReader does not know about
|
protected abstract void |
setRetentionTimes(S spectrum,
RetentionTimeList retentionTimeList)
Add the retention times contained in the retentionTimeList to the spectrum.
|
protected abstract void |
setScanNumbers(S spectrum,
ScanNumberList scanNumbers)
Add the scan numbers contained in the scanNumbers to the spectrum.
|
protected boolean |
skipIntermediaryLine(String line)
Handle intermediary lines between BEGIN IONS and END IONS.
|
acceptUnsortedSpectra, addPeaksToSpectrum, addPeakToSpectrum, close, getContext, getHeader, hasNext, init, nextpublic AbstractMgfReader(Reader reader, URI spectraSource, PeakList.Precision precision, PeakProcessorChain<A> processorChain) throws IOException
IOExceptionpublic String getExtension()
protected String parseHeader(AbstractMsReader.ParseContext context) throws IOException
AbstractMsReaderparseHeader in class AbstractMsReader<A extends PeakAnnotation,S extends Spectrum<A>>context - the parser contextIOExceptionprotected void parseNextMs1Entry(S spectrum, AbstractMsReader.ParseContext context) throws IOException
spectrum - the spectrumcontext - the parse contextIOException - if there are IO exceptionsprotected void parseNextMs2Entry(S spectrum, AbstractMsReader.ParseContext context) throws IOException
spectrum - the spectrumcontext - the parse contextIOException - if there are IO exceptionsprotected void handleIntermediaryLine(String line)
line - the lineprotected boolean skipIntermediaryLine(String line)
line - the intermediary line to handleprotected S parseNextEntry(AbstractMsReader.ParseContext context) throws IOException
parseNextEntry in class AbstractMsReader<A extends PeakAnnotation,S extends Spectrum<A>>IOExceptionprotected abstract S newSpectrum(AbstractMsReader.ParseContext context, PeakList.Precision precision)
context - the parse contextprecision - the precision for the new spectrumprotected boolean handleComment(S spectrum, String line)
spectrum - the spectrum currently being readline - the lineprotected boolean handleBeginIonLine(S spectrum, String line)
spectrum - the spectrum currently being readline - the lineprotected boolean handleTagLine(String tag, String value, S spectrum)
spectrum - the spectrum currently being readtag - the string from the start of the lien to the = charactervalue - the string from the character after the = to the end of the lineprotected boolean handlePeakLine(S spectrum, String line, AbstractMsReader.ParseContext context)
spectrum - the spectrum currently being readline - the lineprotected boolean handleEndIonLine(S spectrum, String line)
spectrum - the spectrum currently being readline - the lineprotected boolean handleUnknownLine(S spectrum, String line)
spectrum - the spectrum currently being readline - the lineprotected abstract boolean parseTitleTag(String value, S spectrum)
value - the title valuespectrum - the spectrum being parsedprotected boolean parseUnknownTag(String tag, String value, S spectrum)
tag - the characters in the line before the first =value - the characters in the line after the first =spectrum - the spectrum that is being readprotected boolean parseRetentionTimeTag(String value, S spectrum)
value - the valuespectrum - the spectrum being parsedprotected abstract void setRetentionTimes(S spectrum, RetentionTimeList retentionTimeList)
spectrum - the spectrum that is currently being readretentionTimeList - the retention times that were readprotected boolean parseScanTag(String value, S spectrum)
value - the valuespectrum - the spectrum being parsedprotected abstract void setScanNumbers(S spectrum, ScanNumberList scanNumbers)
spectrum - the spectrum that is currently being readscanNumbers - the scan numbers that were readprotected boolean parseChargeTag(String value, S spectrum)
value - the valuespectrum - the spectrum being parsedCopyright © 2016. All Rights Reserved.