Class NordIterator
- java.lang.Object
-
- org.gorpipe.gor.model.GenomicIteratorBase
-
- gorsat.process.NordIterator
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.util.Iterator<org.gorpipe.gor.model.Row>,org.gorpipe.gor.model.GenomicIterator,org.gorpipe.gor.model.RowSourceStats
public class NordIterator extends org.gorpipe.gor.model.GenomicIteratorBaseIterator 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()booleanseek(java.lang.String seekChr, int seekPos)-
Methods inherited from class org.gorpipe.gor.model.GenomicIteratorBase
clone, decStat, getBufferSize, getContext, getHeader, getSourceName, incStat, initStats, isSourceAlreadyInserted, setBufferSize, setContext, setHeader, setSourceAlreadyInserted, setSourceName
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
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()
-
hasNext
public boolean hasNext()
-
next
public org.gorpipe.gor.model.Row next()
-
seek
public boolean seek(java.lang.String seekChr, int seekPos)
-
init
public void init(org.gorpipe.gor.session.GorSession session)
- Specified by:
initin interfaceorg.gorpipe.gor.model.GenomicIterator- Overrides:
initin classorg.gorpipe.gor.model.GenomicIteratorBase
-
-