Pybedtools

From SEQwiki
Jump to: navigation, search

Application data

Created by Dale RK, Pedersen BS, Quinlan AR
Biological application domain(s) Genomics
Principal bioinformatics method(s) Read mapping
Created at National Institutes of Health
Maintained? Yes
Input format(s) BED, GTF, GFF, GFF3, VCF, BAM, SAM
Output format(s) BED, GTF, GFF, GFF3, VCF, BAM, SAM
Software features See full description
Programming language(s) Python
Licence GPLv2
Operating system(s) Windows (Cygwin), Linux, Linux 64, Mac OS X

Summary: Python extension to BEDTools that allows use of all BEDTools programs directly from Python, as well as feature-by-feature manipulation, automatic handling of temporary files, and more.

"Error: no local variable "counter" was set." is not a number.

Description

Pybedtools is a Python package that provides a convenient and flexible interface to both the BEDTools command-line tools and efficient functions in the BEDTools C++ libraries. Pybedtools simplifies complicated analyses by extending the functionality in BEDTools and by providing (to the authors' knowledge) the first Python library offering a common interface for manipulating datasets in diverse formats.

Other new functionality includes:

  • set operations on multiple datasets using a simple, intuitive syntax
  • the ability to filter features and
  • select specific columns of a BED/GTF/GFF/VCF/SAM/BAM line using numerical indexing or by attributes
  • a unified interface to common attributes (e.g., chromosome, start, end, name, and strand) from many file formats
  • a documented command history.

A brief example showing how to identify the closest genes within 5kb away from intergenic SNPs, given a GFF file of genes and a BED file of SNPs:

from pybedtools import BedTool
genes = BedTool(’hg19.gff’)
snps = BedTool(’snps.bed’)
intergenic_snps = (snps - genes)
nearby = genes.closest(intergenic_snps, d=True,
stream=True)
for gene in nearby:
    if int(gene[-1]) < 5000:
        print gene.name

Pybedtools provides researchers with a simple and efficient interface for exploring complex genomics datasets in widely used formats.


Links


References

  1. . 2011. Bioinformatics


To add a reference for Pybedtools, enter the PubMed ID in the field below and click 'Add'.

 


Search for "Pybedtools" in the SEQanswers forum / BioStar or:

Web Search Wiki Sites Scientific