Package org.dishevelled.bio.feature.bed
Class BedRecord
- java.lang.Object
-
- org.dishevelled.bio.feature.bed.BedRecord
-
@Immutable public final class BedRecord extends Object
BED record. Supports the same BED formats as bedtools2.- BED3: A BED file where each feature is described by chrom, start, and end.
For example:
chr1 11873 14409 - BED4: A BED file where each feature is described by chrom, start, end, and name.
For example:
chr1 11873 14409 uc001aaa.3 - BED5: A BED file where each feature is described by chrom, start, end, name, and score.
For example:
chr1 11873 14409 uc001aaa.3 0 - BED6: A BED file where each feature is described by chrom, start, end, name, score, and strand.
For example:
chr1 11873 14409 uc001aaa.3 0 + - BED12: A BED file where each feature is described by all twelve columns listed above.
For example:
chr1 11873 14409 uc001aaa.3 0 + 11873 11873 0 3 354,109,1189, 0,739,1347,
- Author:
- Michael Heuer
- BED3: A BED file where each feature is described by chrom, start, and end.
For example:
-
-
Constructor Summary
Constructors Constructor Description BedRecord(String chrom, long start, long end)Create a new BED3 record.BedRecord(String chrom, long start, long end, String name)Create a new BED4 record.BedRecord(String chrom, long start, long end, String name, String score)Create a new BED5 record.BedRecord(String chrom, long start, long end, String name, String score, String strand)Create a new BED6 record.BedRecord(String chrom, long start, long end, String name, String score, String strand, long thickStart, long thickEnd, String itemRgb, int blockCount, long[] blockSizes, long[] blockStarts)Create a new BED12 record.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetBlockCount()Return the block count for this BED record.long[]getBlockSizes()Return the block sizes for this BED record.long[]getBlockStarts()Return the block starts for this BED record.StringgetChrom()Return the chrom for this BED record.longgetEnd()Return the end for this BED record in 0-based coordinate system, closed open range.BedFormatgetFormat()Return the format of this BED record.StringgetItemRgb()Return the item RGB for this BED record, if any.StringgetName()Return the name for this BED record, if any.StringgetScore()Return the score for this BED record, if any.longgetStart()Return the start for this BED record in 0-based coordinate system, closed open range.StringgetStrand()Return the strand for this BED record, if any.longgetThickEnd()Return the thick end for this BED record in 0-based coordinate system, closed open range.longgetThickStart()Return the thick start for this BED record in 0-based coordinate system, closed open range.inthashCode()com.google.common.collect.Range<Long>toRange()Return this BED record as a 0-based coordinate system, closed open range.StringtoString()static BedRecordvalueOf(String value)Return a new BED record parsed from the specified value.
-
-
-
Constructor Detail
-
BedRecord
public BedRecord(String chrom, long start, long end)
Create a new BED3 record.- Parameters:
chrom- chrom, must not be nullstart- start, must be at least zeroend- end, must be at least zero, and greater than or equal to start
-
BedRecord
public BedRecord(String chrom, long start, long end, String name)
Create a new BED4 record.- Parameters:
chrom- chrom, must not be nullstart- start, must be at least zeroend- end, must be at least zero, and greater than or equal to startname- name
-
BedRecord
public BedRecord(String chrom, long start, long end, String name, String score)
Create a new BED5 record.- Parameters:
chrom- chrom, must not be nullstart- start, must be at least zeroend- end, must be at least zero, and greater than or equal to startname- namescore- score
-
BedRecord
public BedRecord(String chrom, long start, long end, String name, String score, String strand)
Create a new BED6 record.- Parameters:
chrom- chrom, must not be nullstart- start, must be at least zeroend- end, must be at least zero, and greater than or equal to startname- namescore- scorestrand- strand, if present must be either-or+
-
BedRecord
public BedRecord(String chrom, long start, long end, String name, String score, String strand, long thickStart, long thickEnd, String itemRgb, int blockCount, long[] blockSizes, long[] blockStarts)
Create a new BED12 record.- Parameters:
chrom- chrom, must not be nullstart- start, must be at least zeroend- end, must be at least zero, and greater than or equal to startname- namescore- scorestrand- strand, if present must be either-or+thickStart- thick start, must be at least zerothickEnd- thick end, must be at least zero and greater than or equal to thick startitemRgb- item RGB, if present, must be in R,G,B format, e.g.255,0,0blockCount- block count, must be at least zeroblockSizes- block sizes, must be the same length as block countblockStarts- block starts, must be the same length as block count
-
-
Method Detail
-
getChrom
public String getChrom()
Return the chrom for this BED record.- Returns:
- the chrom for this BED record
-
getStart
public long getStart()
Return the start for this BED record in 0-based coordinate system, closed open range.- Returns:
- the start for this BED record in 0-based coordinate system, closed open range
-
getEnd
public long getEnd()
Return the end for this BED record in 0-based coordinate system, closed open range.- Returns:
- the end for this BED record in 0-based coordinate system, closed open range
-
getName
public String getName()
Return the name for this BED record, if any.- Returns:
- the name for this BED record, if any
-
getScore
public String getScore()
Return the score for this BED record, if any.- Returns:
- the score for this BED record, if any
-
getStrand
public String getStrand()
Return the strand for this BED record, if any.- Returns:
- the strand for this BED record, if any
-
getThickStart
public long getThickStart()
Return the thick start for this BED record in 0-based coordinate system, closed open range.- Returns:
- the thick start for this BED record in 0-based coordinate system, closed open range
-
getThickEnd
public long getThickEnd()
Return the thick end for this BED record in 0-based coordinate system, closed open range.- Returns:
- the thick end for this BED record in 0-based coordinate system, closed open range
-
getItemRgb
public String getItemRgb()
Return the item RGB for this BED record, if any.- Returns:
- the item RGB for this BED record, if any
-
getBlockCount
public int getBlockCount()
Return the block count for this BED record.- Returns:
- the block count for this BED record
-
getBlockSizes
public long[] getBlockSizes()
Return the block sizes for this BED record.- Returns:
- the block sizes for this BED record
-
getBlockStarts
public long[] getBlockStarts()
Return the block starts for this BED record.- Returns:
- the block starts for this BED record
-
getFormat
public BedFormat getFormat()
Return the format of this BED record.- Returns:
- the format of this BED record
-
toRange
public com.google.common.collect.Range<Long> toRange()
Return this BED record as a 0-based coordinate system, closed open range.- Returns:
- this BED record as a 0-based coordinate system, closed open range
-
valueOf
public static BedRecord valueOf(String value)
Return a new BED record parsed from the specified value.- Parameters:
value- value to parse- Returns:
- a new BED record parsed from the specified value
- Throws:
IllegalArgumentException- if the value is not valid BED[3,4,5,6,12] formatNullPointerException- if a required field is missingNumberFormatException- if a long valued field cannot be parsed as a long
-
-