public class MZMLIndexParser extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
MZMLIndexParser.OffsetId |
| Modifier and Type | Field and Description |
|---|---|
protected String |
ATTR_OFFSET_ID |
protected String |
FILE_TYPE_NAME |
protected String |
INDEX_NAME |
protected static int |
INDEX_OFFSET_MIN_VALUE |
protected int |
MAX_BYTES_FROM_END_TO_SEARCH_FOR_INDEX |
protected int |
NUM_BYTES_TO_CHECK_INDEX |
protected Pattern |
RE_END_OF_RUN |
protected Pattern |
RE_INDEX_ENTRY_SIMPLE |
protected Pattern |
RE_INDEX_OFFSET |
protected MZMLFile |
source |
protected String |
TAG_END_OF_RUN |
protected String |
TAG_INDEX |
protected String |
TAG_INDEXOFFSET |
protected String |
TAG_OFFSET |
| Constructor and Description |
|---|
MZMLIndexParser(MZMLFile source) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
findIndexOffset(RandomAccessFile raf)
Reads the last several kB of the file, looking for
TAG_INDEXOFFSET tag. |
protected int |
findScanLength(long offset)
Finds the length of a scan entry in the original file by reading it,
starting at the provided offset and looking for an "end of scan" tag.
|
MZMLIndex |
parse() |
protected void |
parseIndexEntries(byte[] bytes,
TreeMap<Integer,MZMLIndexParser.OffsetId> map) |
protected MZMLFile source
protected String FILE_TYPE_NAME
protected String TAG_INDEXOFFSET
protected String TAG_INDEX
protected String INDEX_NAME
protected String TAG_OFFSET
protected String ATTR_OFFSET_ID
protected String TAG_END_OF_RUN
protected Pattern RE_INDEX_OFFSET
protected int MAX_BYTES_FROM_END_TO_SEARCH_FOR_INDEX
protected int NUM_BYTES_TO_CHECK_INDEX
protected static int INDEX_OFFSET_MIN_VALUE
protected Pattern RE_INDEX_ENTRY_SIMPLE
protected Pattern RE_END_OF_RUN
public MZMLIndexParser(MZMLFile source)
public MZMLIndex parse() throws FileParsingException
FileParsingExceptionprotected int findScanLength(long offset)
throws FileParsingException
offset - offset in the file, where to start readingFileParsingExceptionprotected long findIndexOffset(RandomAccessFile raf) throws IOException, IndexNotFoundException, IndexBrokenException
TAG_INDEXOFFSET tag.raf - IOExceptionIndexNotFoundException - in case "indexListOffset" tag could not be found within the last few kB of the fileIndexBrokenExceptionprotected void parseIndexEntries(byte[] bytes,
TreeMap<Integer,MZMLIndexParser.OffsetId> map)
throws IndexBrokenException
bytes - the ending of the file, containing the indexmap - ScanMap with simple mapping from Integer scan numbers to Long offsets, just as written in the "index".
This map should already contain the offset of the beginning of the "index" section in mzML file associated
with key Integer.MAX_VALUE.IndexBrokenExceptionCopyright © 2017. All rights reserved.