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.RowSource

Iterator 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.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.gorpipe.gor.model.GenomicIterator

    org.gorpipe.gor.model.GenomicIterator.ChromoLookup
  • 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

    Modifier and Type Method Description
    void close()  
    boolean hasNext()  
    void init​(org.gorpipe.gor.session.GorSession session)  
    org.gorpipe.gor.model.Row next()  
    void setPosition​(java.lang.String seekChr, int seekPos)  

    Methods inherited from class org.gorpipe.model.gor.iterators.RowSource

    bufferSize, bufferSize_$eq, clone, getAvgBasesPerMilliSecond, getAvgBatchSize, getAvgRowsPerMilliSecond, getAvgSeekTimeMilliSecond, getBufferSize, getCurrentBatchLoc, getCurrentBatchRow, getCurrentBatchSize, getEx, getGorHeader, getParent, isBuffered, moveToPosition, moveToPosition$default$3, next, parent, parent_$eq, seek, setBufferSize, setEx, setParent, terminateReading

    Methods inherited from class org.gorpipe.gor.model.GenomicIterator

    decStat, filter, getColnum, getContext, getHeader, getLookup, getMonitor, getSourceName, incStat, initStats, isSourceAlreadyInserted, pushdownCalc, pushdownCmd, pushdownFilter, pushdownGor, pushdownSelect, pushdownTop, pushdownWrite, seek, select, selectHeader, setColnum, setContext, setHeader, setSourceAlreadyInserted, setSourceName

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Constructor Details

    • 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 path
      filterEntries - Array of tags to be inclusively filtered.
      sourceColumnName - Name of the ouput source column
      ignoreMissingEntries - 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 Details

    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in class org.gorpipe.model.gor.iterators.RowSource
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<org.gorpipe.gor.model.Row>
      Overrides:
      hasNext in class org.gorpipe.gor.model.GenomicIterator
    • next

      public org.gorpipe.gor.model.Row next()
      Specified by:
      next in interface java.util.Iterator<org.gorpipe.gor.model.Row>
      Overrides:
      next in class org.gorpipe.gor.model.GenomicIterator
    • setPosition

      public void setPosition​(java.lang.String seekChr, int seekPos)
      Overrides:
      setPosition in class org.gorpipe.model.gor.iterators.RowSource
    • init

      public void init​(org.gorpipe.gor.session.GorSession session)
      Overrides:
      init in class org.gorpipe.gor.model.GenomicIterator