{"id":13704195,"url":"https://github.com/daler/pybedtools","last_synced_at":"2025-05-15T17:03:49.176Z","repository":{"id":2483292,"uuid":"667289","full_name":"daler/pybedtools","owner":"daler","description":"Python wrapper -- and more -- for BEDTools (bioinformatics tools for \"genome arithmetic\")","archived":false,"fork":false,"pushed_at":"2025-03-16T14:28:10.000Z","size":30390,"stargazers_count":318,"open_issues_count":18,"forks_count":106,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-11T21:13:01.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://daler.github.io/pybedtools","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daler.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-05-14T21:09:33.000Z","updated_at":"2025-04-10T18:21:20.000Z","dependencies_parsed_at":"2023-07-05T19:49:30.326Z","dependency_job_id":"eeeceecb-312d-4cd6-8fd7-bac8d2d7f5d0","html_url":"https://github.com/daler/pybedtools","commit_stats":{"total_commits":1635,"total_committers":46,"mean_commits":35.54347826086956,"dds":"0.26422018348623855","last_synced_commit":"9876fa25e80c7547101e662ebe1c6388579405d5"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daler%2Fpybedtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daler%2Fpybedtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daler%2Fpybedtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daler%2Fpybedtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daler","download_url":"https://codeload.github.com/daler/pybedtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480430,"owners_count":21110937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T21:01:05.456Z","updated_at":"2025-04-11T21:13:05.698Z","avatar_url":"https://github.com/daler.png","language":"Python","readme":"\nOverview\n--------\n\n.. image:: https://badge.fury.io/py/pybedtools.svg?style=flat\n    :target: https://badge.fury.io/py/pybedtools\n\n.. image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg\n    :target: https://bioconda.github.io\n\nThe `BEDTools suite of programs \u003chttp://bedtools.readthedocs.org/\u003e`_ is widely\nused for genomic interval manipulation or \"genome algebra\".  `pybedtools` wraps\nand extends BEDTools and offers feature-level manipulations from within\nPython.\n\nSee full online documentation, including installation instructions, at\nhttps://daler.github.io/pybedtools/.\n\nThe GitHub repo is at https://github.com/daler/pybedtools.\n\nWhy `pybedtools`?\n-----------------\n\nHere is an example to get the names of genes that are \u003c5 kb away from\nintergenic SNPs:\n\n.. code-block:: python\n\n    from pybedtools import BedTool\n\n    snps = BedTool('snps.bed.gz')  # [1]\n    genes = BedTool('hg19.gff')    # [1]\n\n    intergenic_snps = snps.subtract(genes)                       # [2]\n    nearby = genes.closest(intergenic_snps, d=True, stream=True) # [2, 3]\n\n    for gene in nearby:             # [4]\n        if int(gene[-1]) \u003c 5000:    # [4]\n            print gene.name         # [4]\n\nUseful features shown here include:\n\n* `[1]` support for all BEDTools-supported formats (here gzipped BED and GFF)\n* `[2]` wrapping of all BEDTools programs and arguments (here, `subtract` and `closest` and passing\n  the `-d` flag to `closest`);\n* `[3]` streaming results (like Unix pipes, here specified by `stream=True`)\n* `[4]` iterating over results while accessing feature data by index or by attribute\n  access (here `[-1]` and `.name`).\n\nIn contrast, here is the same analysis using shell scripting.  Note that this\nrequires knowledge in Perl, bash, and awk.  The run time is identical to the\n`pybedtools` version above:\n\n.. code-block:: bash\n\n    snps=snps.bed.gz\n    genes=hg19.gff\n    intergenic_snps=/tmp/intergenic_snps\n\n    snp_fields=`zcat $snps | awk '(NR == 2){print NF; exit;}'`\n    gene_fields=9\n    distance_field=$(($gene_fields + $snp_fields + 1))\n\n    intersectBed -a $snps -b $genes -v \u003e $intergenic_snps\n\n    closestBed -a $genes -b $intergenic_snps -d \\\n    | awk '($'$distance_field' \u003c 5000){print $9;}' \\\n    | perl -ne 'm/[ID|Name|gene_id]=(.*?);/; print \"$1\\n\"'\n\n    rm $intergenic_snps\n\nSee the `Shell script comparison \u003chttp://daler.github.io/pybedtools/sh-comparison.html\u003e`_ in the docs\nfor more details on this comparison, or keep reading the full documentation at\nhttp://daler.github.io/pybedtools.\n","funding_links":[],"categories":["Next Generation Sequencing","زیست شناسی و بیوتکنولوژی"],"sub_categories":["Python Modules","کار با زمان و تقویم"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaler%2Fpybedtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaler%2Fpybedtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaler%2Fpybedtools/lists"}