Class 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.GenomicIteratorBase

    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.

    • Field Summary

      • Fields inherited from class org.gorpipe.gor.model.GenomicIteratorBase

        statsSenderAnnotation, statsSenderName
    • 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
      void close()  
      boolean hasNext()  
      void init​(org.gorpipe.gor.session.GorSession session)  
      org.gorpipe.gor.model.Row next()  
      boolean seek​(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
      • Methods inherited from interface org.gorpipe.gor.model.GenomicIterator

        filter, getMonitor, isBuffered, moveToPosition, moveToPosition, pushdownCalc, pushdownCmd, pushdownFilter, pushdownGor, pushdownSelect, pushdownTop, pushdownWrite, seek, select
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
      • Methods inherited from interface org.gorpipe.gor.model.RowSourceStats

        getAvgBasesPerMilliSecond, getAvgBatchSize, getAvgRowsPerMilliSecond, getAvgSeekTimeMilliSecond, getCurrentBatchLoc, getCurrentBatchRow, getCurrentBatchSize
    • 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 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 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:
        init in interface org.gorpipe.gor.model.GenomicIterator
        Overrides:
        init in class org.gorpipe.gor.model.GenomicIteratorBase