-
public final class ExtendedBedEntryAn extended representation of a BED file entry.
The BED standard allows 3 up to 12 regular fields (bed3 through bed12) and an arbitrary number of custom extra fields (bedN+K format). The first 12 properties represent the regular fields (default values are used to stand in for the missing data). extraFields property stores the extra fields as a String array.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringchromprivate final Integerstartprivate final Integerendprivate final Stringnameprivate final Integerscoreprivate final Characterstrandprivate IntegerthickStartprivate IntegerthickEndprivate IntegeritemRgbprivate final IntegerblockCountprivate final IntArrayblockSizesprivate final IntArrayblockStartsprivate final Array<String>extraFields
-
Method Summary
Modifier and Type Method Description Booleanequals(Object other)IntegerhashCode()StringtoString()final BedEntrypack(Byte fieldsNumber, Integer extraFieldsNumber, Character delimiter)Convert to BedEntry. final ArrayList<String>rest(Byte fieldsNumber, Integer extraFieldsNumber)List of optional fields (all except the obligatory first three) for BED entry, same fields as in BedEntry.rest after pack. final ObjectgetField(Integer i, Integer fieldsNumber, Integer extraFieldsNumber)Returns a i-th field of a Bed entry. final Stringcomponent1()final Integercomponent2()final Integercomponent3()final Stringcomponent4()final Integercomponent5()final Charactercomponent6()final Integercomponent7()final Integercomponent8()final Integercomponent9()final Integercomponent10()final IntArraycomponent11()final IntArraycomponent12()final Array<String>component13()final ExtendedBedEntrycopy(String chrom, Integer start, Integer end, String name, Integer score, Character strand, Integer thickStart, Integer thickEnd, Integer itemRgb, Integer blockCount, IntArray blockSizes, IntArray blockStarts, Array<String> extraFields)final StringgetChrom()Chromosome name, e.g. final IntegergetStart()0-based start offset (inclusive). final IntegergetEnd()0-based end offset (exclusive). final StringgetName()Name of feature. final IntegergetScore()Feature score final CharactergetStrand()or – or . for unknown.
final IntegergetThickStart()The starting position at which the feature is drawn thickly. final IntegergetThickEnd()The ending position at which the feature is drawn thickly. final IntegergetItemRgb()The colour of entry in the form R,G,B (e.g. final IntegergetBlockCount()final IntArraygetBlockSizes()final IntArraygetBlockStarts()final Array<String>getExtraFields()Additional BED values. final UnitsetThickStart(Integer thickStart)The starting position at which the feature is drawn thickly. final UnitsetThickEnd(Integer thickEnd)The ending position at which the feature is drawn thickly. final UnitsetItemRgb(Integer itemRgb)The colour of entry in the form R,G,B (e.g. -
-
Method Detail
-
pack
final BedEntry pack(Byte fieldsNumber, Integer extraFieldsNumber, Character delimiter)
Convert to BedEntry.
Intended as an inverse for BedEntry.unpack. Packs the optional fields (every field except the obligatory first three ones, chrom, start and end) in BedEntry.rest.
- Parameters:
fieldsNumber- BED format fields number to serialize (3..extraFieldsNumber- BED+ format extra fields number to serialize, if null serialize all extra fieldsdelimiter- Custom delimiter for malformed data
-
rest
final ArrayList<String> rest(Byte fieldsNumber, Integer extraFieldsNumber)
List of optional fields (all except the obligatory first three) for BED entry, same fields as in BedEntry.rest after pack.
Values in string differs from original values because converted to string.
- Parameters:
fieldsNumber- BED format fields number to serialize (3..extraFieldsNumber- BED+ format extra fields number to serialize, if null serialize all extra fields
-
getField
final Object getField(Integer i, Integer fieldsNumber, Integer extraFieldsNumber)
Returns a i-th field of a Bed entry.
Since ExtendedBedEntry is format-agnostic, it doesn't actually know which field is i-th, so we have to provide fieldsNumber and extraFieldsNumber. Returns an instance of a correct type (Int, String etc.) or null for missing and out of bounds fields. This method is useful for minimizing the number of conversions to and from String.
- Parameters:
i- the index of the field being queried (zero-based)fieldsNumber- the number of regular BED fields (N in bedN+K notation)extraFieldsNumber- the number of extra BED fields (0 for bedN, K for bedN+K, null for bedN+).
-
component1
final String component1()
-
component2
final Integer component2()
-
component3
final Integer component3()
-
component4
final String component4()
-
component5
final Integer component5()
-
component6
final Character component6()
-
component7
final Integer component7()
-
component8
final Integer component8()
-
component9
final Integer component9()
-
component10
final Integer component10()
-
component11
final IntArray component11()
-
component12
final IntArray component12()
-
component13
final Array<String> component13()
-
copy
final ExtendedBedEntry copy(String chrom, Integer start, Integer end, String name, Integer score, Character strand, Integer thickStart, Integer thickEnd, Integer itemRgb, Integer blockCount, IntArray blockSizes, IntArray blockStarts, Array<String> extraFields)
-
getThickStart
final Integer getThickStart()
The starting position at which the feature is drawn thickly.
-
getThickEnd
final Integer getThickEnd()
The ending position at which the feature is drawn thickly.
-
getItemRgb
final Integer getItemRgb()
The colour of entry in the form R,G,B (e.g. 255,0,0).
-
getBlockCount
final Integer getBlockCount()
-
getBlockSizes
final IntArray getBlockSizes()
-
getBlockStarts
final IntArray getBlockStarts()
-
getExtraFields
final Array<String> getExtraFields()
Additional BED values.
-
setThickStart
final Unit setThickStart(Integer thickStart)
The starting position at which the feature is drawn thickly.
-
setThickEnd
final Unit setThickEnd(Integer thickEnd)
The ending position at which the feature is drawn thickly.
-
setItemRgb
final Unit setItemRgb(Integer itemRgb)
The colour of entry in the form R,G,B (e.g. 255,0,0).
-
-
-