comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pybedtools-0.11.0.dist-info/METADATA @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 Metadata-Version: 2.1
2 Name: pybedtools
3 Version: 0.11.0
4 Summary: Wrapper around BEDTools for bioinformatics work
5 Home-page: https://github.com/daler/pybedtools
6 Download-URL:
7 Maintainer: Ryan Dale
8 Maintainer-email: ryan.dale@nih.gov
9 License: MIT
10 Classifier: Development Status :: 5 - Production/Stable
11 Classifier: Intended Audience :: Science/Research
12 Classifier: License :: OSI Approved :: MIT License
13 Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
14 Classifier: Programming Language :: Python
15 Classifier: Programming Language :: Python :: 3
16 Classifier: Programming Language :: Python :: 3.6
17 Classifier: Programming Language :: Python :: 3.7
18 Classifier: Programming Language :: Python :: 3.8
19 Classifier: Topic :: Software Development :: Libraries :: Python Modules
20 License-File: LICENSE.txt
21 Requires-Dist: pysam
22 Requires-Dist: numpy
23
24
25 Overview
26 --------
27
28 .. image:: https://badge.fury.io/py/pybedtools.svg?style=flat
29 :target: https://badge.fury.io/py/pybedtools
30
31 .. image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg
32 :target: https://bioconda.github.io
33
34 The `BEDTools suite of programs <http://bedtools.readthedocs.org/>`_ is widely
35 used for genomic interval manipulation or "genome algebra". `pybedtools` wraps
36 and extends BEDTools and offers feature-level manipulations from within
37 Python.
38
39 See full online documentation, including installation instructions, at
40 https://daler.github.io/pybedtools/.
41
42 The GitHub repo is at https://github.com/daler/pybedtools.
43
44 Why `pybedtools`?
45 -----------------
46
47 Here is an example to get the names of genes that are <5 kb away from
48 intergenic SNPs:
49
50 .. code-block:: python
51
52 from pybedtools import BedTool
53
54 snps = BedTool('snps.bed.gz') # [1]
55 genes = BedTool('hg19.gff') # [1]
56
57 intergenic_snps = snps.subtract(genes) # [2]
58 nearby = genes.closest(intergenic_snps, d=True, stream=True) # [2, 3]
59
60 for gene in nearby: # [4]
61 if int(gene[-1]) < 5000: # [4]
62 print gene.name # [4]
63
64 Useful features shown here include:
65
66 * `[1]` support for all BEDTools-supported formats (here gzipped BED and GFF)
67 * `[2]` wrapping of all BEDTools programs and arguments (here, `subtract` and `closest` and passing
68 the `-d` flag to `closest`);
69 * `[3]` streaming results (like Unix pipes, here specified by `stream=True`)
70 * `[4]` iterating over results while accessing feature data by index or by attribute
71 access (here `[-1]` and `.name`).
72
73 In contrast, here is the same analysis using shell scripting. Note that this
74 requires knowledge in Perl, bash, and awk. The run time is identical to the
75 `pybedtools` version above:
76
77 .. code-block:: bash
78
79 snps=snps.bed.gz
80 genes=hg19.gff
81 intergenic_snps=/tmp/intergenic_snps
82
83 snp_fields=`zcat $snps | awk '(NR == 2){print NF; exit;}'`
84 gene_fields=9
85 distance_field=$(($gene_fields + $snp_fields + 1))
86
87 intersectBed -a $snps -b $genes -v > $intergenic_snps
88
89 closestBed -a $genes -b $intergenic_snps -d \
90 | awk '($'$distance_field' < 5000){print $9;}' \
91 | perl -ne 'm/[ID|Name|gene_id]=(.*?);/; print "$1\n"'
92
93 rm $intergenic_snps
94
95 See the `Shell script comparison <http://daler.github.io/pybedtools/sh-comparison.html>`_ in the docs
96 for more details on this comparison, or keep reading the full documentation at
97 http://daler.github.io/pybedtools.