Class NordIterator
- java.lang.Object
-
- org.gorpipe.gor.model.GenomicIterator
-
- org.gorpipe.model.gor.iterators.RowSource
-
- gorsat.process.NordIterator
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.util.Iterator<org.gorpipe.gor.model.Row>
public class NordIterator extends org.gorpipe.model.gor.iterators.RowSourceIterator to access data from a nor dictionary file.
Nor dictionary file is a file to tag mapping where the iterator represents the data as a continuous stream. The nor dictionary iterator supports filtering from an input filter array. An empty filter array indicates no filter. Results from the nor dictionary iterator contains the original source plus a source column which contains the originating tag for the row. Filters can be silenced and a custom source column name can be applied. All files in the nor dictionary are relative to the dictionary file unless a full path is specified.
Nor dictionary supports header which starts with #. All lines starting with # are ignored from the dictionary. All header entries starting with ##[key]=[value] are treated as key value pairs. Nord files support the 'Source' keyword for naming the source column. If no Source reference is set in the nor dictionary file or no source is set with the -s option, the source column is not shown.
Example of a nor dictionary:
##Source=phenotype
#Source\tTag\n
./nor/file1.tsv\tPatient_1\n
./nor/file2.tsv\tPatient_2\n
./nor/file3.tsv\tPatient_3\n
#./nor/file4.tsv\tPatient_4\n -> Ignored
Nor dictionaries do not support bucketization as there only one file open at a time.
-
-
Constructor Summary
Constructors Constructor Description NordIterator(java.lang.String nordFile, boolean useFilter, java.lang.String[] filterEntries, java.lang.String sourceColumnName, boolean ignoreMissingEntries, boolean forceReadOfHeader)Nor dictionary constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanhasNext()voidinit(org.gorpipe.gor.session.GorSession session)org.gorpipe.gor.model.Rownext()voidsetPosition(java.lang.String seekChr, int seekPos)-
Methods inherited from class org.gorpipe.model.gor.iterators.RowSource
bufferSize, bufferSize_$eq, getAvgBasesPerMilliSecond, getAvgBatchSize, getAvgRowsPerMilliSecond, getAvgSeekTimeMilliSecond, getBufferSize, getCurrentBatchLoc, getCurrentBatchRow, getCurrentBatchSize, getGorHeader, getParent, moveToPosition, moveToPosition$default$3, next, parent, parent_$eq, seek, setBufferSize, setParent, terminateReading
-
Methods inherited from class org.gorpipe.gor.model.GenomicIterator
clone, decStat, filter, getColnum, getContext, getEx, getHeader, getLookup, getMonitor, getSourceName, incStat, initStats, isBuffered, isSourceAlreadyInserted, pushdownCalc, pushdownCmd, pushdownFilter, pushdownGor, pushdownSelect, pushdownTop, pushdownWrite, seek, select, selectHeader, setColnum, setContext, setEx, setHeader, setSourceAlreadyInserted, setSourceName
-
-
-
-
Constructor Detail
-
NordIterator
public NordIterator(java.lang.String nordFile, boolean useFilter, java.lang.String[] filterEntries, java.lang.String sourceColumnName, boolean ignoreMissingEntries, boolean forceReadOfHeader)Nor dictionary constructor. Creates an instance of nor dictionary iterator, see class description.- Parameters:
nordFile- Nor dictionary file pathfilterEntries- Array of tags to be inclusively filtered.sourceColumnName- Name of the ouput source columnignoreMissingEntries- Indicates if missing entries should be ignored or not. Not ignoring missing entries will throw a parsing exception.forceReadOfHeader- Force the read of headers in the source files.
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein classorg.gorpipe.model.gor.iterators.RowSource
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<org.gorpipe.gor.model.Row>- Overrides:
hasNextin classorg.gorpipe.gor.model.GenomicIterator
-
next
public org.gorpipe.gor.model.Row next()
- Specified by:
nextin interfacejava.util.Iterator<org.gorpipe.gor.model.Row>- Overrides:
nextin classorg.gorpipe.gor.model.GenomicIterator
-
setPosition
public void setPosition(java.lang.String seekChr, int seekPos)- Specified by:
setPositionin classorg.gorpipe.model.gor.iterators.RowSource
-
init
public void init(org.gorpipe.gor.session.GorSession session)
- Overrides:
initin classorg.gorpipe.gor.model.GenomicIterator
-
-