FeatureCodec<BEDFeature,LineIterator>
public class BEDCodec extends AsciiFeatureCodec<BEDFeature>
Modifier and Type | Class | Description |
---|---|---|
static class |
BEDCodec.StartOffset |
Indicate whether co-ordinates or 0-based or 1-based.
|
Modifier and Type | Field | Description |
---|---|---|
static String |
BED_EXTENSION |
Default extension for BED files.
|
Constructor | Description |
---|---|
BEDCodec() |
Calls
BEDCodec(StartOffset) with an argument
of StartOffset.ONE |
BEDCodec(BEDCodec.StartOffset startOffset) |
BED format is 0-based, but Tribble is 1-based.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
canDecode(String path) |
This function returns true iff the File potentialInput can be parsed by this
codec.
|
BEDFeature |
decode(String line) |
|
BEDFeature |
decode(String[] tokens) |
|
BEDFeature |
decodeLoc(String line) |
|
int |
getStartOffset() |
|
TabixFormat |
getTabixFormat() |
Define the tabix format for the feature, used for indexing.
|
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.
|
protected boolean |
readHeaderLine(String line) |
decodeLoc, getFeatureType
close, decode, isDone, makeIndexableSourceFromStream, makeSourceFromStream, readHeader
public static final String BED_EXTENSION
public BEDCodec()
BEDCodec(StartOffset)
with an argument
of StartOffset.ONE
public BEDCodec(BEDCodec.StartOffset startOffset)
public BEDFeature decodeLoc(String line)
public BEDFeature decode(String line)
decode
in class AsciiFeatureCodec<BEDFeature>
AsciiFeatureCodec.decode(htsjdk.tribble.readers.LineIterator)
public Object readActualHeader(LineIterator lineIterator)
readActualHeader
in class AsciiFeatureCodec<BEDFeature>
lineIterator
- public BEDFeature decode(String[] tokens)
protected boolean readHeaderLine(String line)
public boolean canDecode(String path)
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.path
- the file to test for parsability with this codecpublic int getStartOffset()
public TabixFormat getTabixFormat()
FeatureCodec
AsciiFeatureCodec
could read tabix files as defined in
AbstractFeatureReader.getFeatureReader(String, String, FeatureCodec, boolean, java.util.function.Function, java.util.function.Function)