Class BEDCodec

    • Constructor Detail

      • BEDCodec

        public BEDCodec​(BEDCodec.StartOffset startOffset)
        BED format is 0-based, but Tribble is 1-based. Set desired start position at either ZERO or ONE
    • Method Detail

      • readActualHeader

        public Object readActualHeader​(LineIterator lineIterator)
        The BED codec doesn't retain the actual header, but we need to parse through it and advance to the beginning of the first feature. This is especially true if we're indexing, since we want to underlying stream offset to be established correctly, but is also the case for when we're simply iterating to satisfy a feature query (otherwise the feature reader can terminate prematurely if the header is large).
        Specified by:
        readActualHeader in class AsciiFeatureCodec<BEDFeature>
        Parameters:
        lineIterator -
        Returns:
        Always null. The BEDCodec currently doesn't model or preserve the BED header.
      • readHeaderLine

        protected boolean readHeaderLine​(String line)
      • canDecode

        public boolean canDecode​(String path)
        Description copied from interface: FeatureCodec

        This function returns true iff the File potentialInput can be parsed by this codec. Note that checking the file's extension is a perfectly acceptable implementation of this method and file contents only rarely need to be checked.

        There is an assumption that there's never a situation where two different Codecs return true for the same file. If this occurs, the recommendation would be to error out.

        Note this function must never throw an error. All errors should be trapped and false returned.
        Parameters:
        path - the file to test for parsability with this codec
        Returns:
        true if potentialInput can be parsed, false otherwise
      • getStartOffset

        public int getStartOffset()