bedder
A Python wrapper for a BED record.
Attributes: chrom (str): The chromosome name start (int): The start position (0-based) stop (int): The end position (exclusive) name (str, optional): The name field if present score (float, optional): The score field if present
Example
bed_record = position.bed()
if bed_record is not None:
print(bed_record.chrom, bed_record.start, bed_record.stop)
bed_record.set_name("example")
A Python wrapper for a VCF record.
Attributes: chrom (str): The chromosome name pos (int): The position (0-based)
Example
vcf_record = position.vcf()
if vcf_record is not None:
print(vcf_record.chrom, vcf_record.pos)
dp = vcf_record.info("DP")
if dp is not None:
print("depth:", dp)
Get an INFO field by key, returning the best Python representation.
Example
mq = vcf_record.info("MQ")
Get a FORMAT field by key, returning per-sample values.
Example
gq = vcf_record.format("GQ")
A fragment of a report containing intersection results.
Attributes: a (Position, optional): The query interval b (list[Position]): List of intervals that intersect with the query id (int): Unique identifier for this fragment
Example
for fragment in report:
anchor = fragment.a
for overlap in fragment:
print(overlap.chrom, overlap.start, overlap.stop)
A collection of intersection results.
Methods: add_fragment(fragment): Add a report fragment to the collection count_overlaps_by_id(): Get count of overlaps for each query ID count_bases_by_id(): Get count of overlapping bases for each query ID
Add a report fragment to the collection.
Example
report.add_fragment(fragment)
A genomic interval that can represent BED or other formats.
Attributes: chrom (str): The chromosome name start (int): The start position (0-based) stop (int): The end position (exclusive)
Example
fragment = report[0]
position = fragment.b[0] # or fragment.a
print(position.chrom, position.start, position.stop)
vcf_record = position.vcf()
print(vcf_record.REF)
Get the BED record if this position represents a BED interval
Example
bed = position.bed()
A Python wrapper for Intersections
Report intersections based on specified modes and requirements
Example
report = intersections.report()
Python wrapper for IntersectionMode
Python wrapper for IntersectionPart
Python wrapper for OverlapAmount