pybedtools.bedtool.BedTool.complement¶
-
BedTool.
complement
(*args, **kwargs)[source]¶ Wraps
bedtools complement
. Example usage:>>> a = pybedtools.example_bedtool('a.bed') >>> a.complement(genome='hg19').head(5) chr1 0 1 chr1 500 900 chr1 950 249250621 chr10 0 135534747 chr11 0 135006516
For convenience, the file or stream this BedTool points to is implicitly passed as the
-i
argument tocomplementBed
There are two alternatives for supplying a genome. Use
g="genome.filename"
if you have a genome’s chrom sizes saved as a file. This is the what BEDTools expects when using it from the command line. Alternatively, use thegenome="assembly.name"
(for example,genome="hg19"
) to use chrom sizes for that assembly without having to manage a separate file. Thegenome
argument triggers a callpybedtools.chromsizes
, so see that method for more details.Original BEDTools help::
Tool: bedtools complement (aka complementBed) Version: v2.27.1 Summary: Returns the base pair complement of a feature file. Usage: bedtools complement [OPTIONS] -i <bed/gff/vcf> -g <genome> Notes: (1) The genome file should tab delimited and structured as follows: <chromName><TAB><chromSize> For example, Human (hg19): chr1 249250621 chr2 243199373 ... chr18**gl000207**random 4262 Tips: One can use the UCSC Genome Browser's MySQL database to extract chromosome sizes. For example, H. sapiens: mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -e \ "select chrom, size from hg19.chromInfo" > hg19.genome