readtagger

tags reads in target bam based on other bam files

https://github.com/bardin-lab/readtagger

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.6%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

tags reads in target bam based on other bam files

Basic Info
  • Host: GitHub
  • Owner: bardin-lab
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 11.9 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • Open Issues: 30
  • Releases: 1
Created over 9 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License Roadmap

README.rst

Readtagger
----------
.. image:: https://travis-ci.org/bardin-lab/readtagger.svg?branch=master
    :target: https://travis-ci.org/bardin-lab/readtagger

.. image:: https://coveralls.io/repos/github/bardin-lab/readtagger/badge.svg?branch=master
    :target: https://coveralls.io/github/bardin-lab/readtagger?branch=master

.. image:: https://badge.fury.io/py/readtagger.svg
    :target: https://badge.fury.io/py/readtagger

.. image:: https://anaconda.org/mvdbeek/readtagger/badges/version.svg
    :target: https://anaconda.org/mvdbeek/readtagger


Readtagger is a set of tools for describing the origin of reads in a sequenced genome. It can be used to verify and detect integration events of known, exogenous sequences (such as viruses) or endogenous sequences (such as transposons). In addition, there is the possibility of expanding this to de-novo detection without a priori knowledge of the inserted sequences).

Installation
------------

::

    pip install readtagger

Description
-----------

The readtagger module can be used as a tool for verifying transposable element (TE) insertions predicted by TEMP and TEPID, but it can also serve as the basis for detecting insertions using the findcluster command (see below). The readtagger module examines the origin of sequencing reads by aligning reads to multiple references and recording possible homologies as custom SAM tags. This works for single and paired-end reads, so that one obtains knowledge about a read that is aligned at a physical location in the genome as well as about its mate.


The readtagger command evaluates potential homologies, and (by default) discards homologies for alignments that do not improve the nucleotide usage, For example if the unclipped portion of an alignment has a homology with a transposable element, while we only care about the clipped, unaligned portion. Similarly, we discard homologies for aligned pairs that are well within the expected insert size. These precautions reduce noise in regions of the genome that have spurious homologies to transposable elements, as not all of these regions are masked by tools such as RepeatMasker.


To generate insertion calls, one can use the findcluster command.

findcluster operates in multiple phases, that are roughly:

1.	Divide the input file into approximately 100 KB bins. This allows parallelization over multiple CPU cores or machines. Splitting files may introduce artefacts when splitting in a cluster of tags, therefore we attempt to find regions that have no tagged alignments. 
2.	For each region we determine clusters of tagged alignments. A new cluster is created once additional alignments are not overlapping the current cluster coordinates. This is a rough first-pass that often includes multiple actual insertions and/or separates clusters that belong together, but does summarize all tagged alignments. Additionally we generate clusters of soft-clipped reads (independent of transposable element homology). 
3.	For each cluster, we ask whether there are any other clusters close by (the search area depends on the insert size distribution) that could potentially be merged because they provide evidence for the same insertion. All reachable clusters are tested by all-against-all alignments using edlib. Putative 5p and 3p sites are determined using a consensus alignment if split read evidence is available.
4.	We then ask whether the clusters are internally consistent. This means that alignments that point for example away from the putative insertion site are taken from the cluster and form a new, second cluster.
5.	We repeat steps 3 and 4 until the number of clusters at each pass stays constant.
6.	We assign soft-clipping clusters to transposable element clusters if any read in the soft clipping cluster is also member of a transposable element cluster. (This is important in a separate step that links transposable element insertion sites across samples).
7.	We then quantify the fragments that support a putative insertion (this includes alignments that did not reach the threshold for being tagged), the fragments that point against an insertion and the uninformative reads and we call genotypes and genotype likelihoods based on the evidence. Alignment evidence for an insertion and evidence against an insertion is tagged using separate tags, which allows for visual verification of the quantification. A VCF file describing the insertions, a BAM file containing relevant alignments and a fasta file of assembled sequences is written per 100 KB region. 
8.	Merge individual files


Usage
------

To tag reads in file ``a.bam`` with file ``b.bam`` and output to path
output.bam, type

::

    readtagger --tag_file a.bam --annotate_with b.bam ----output_file output.bam

This will by default tag reads with the AD, AR, BD and BR tags, where
the AD tag has detail mapping information for the current read, while
the BD tag has the information for the mate. AR and BR contain the
aligned reference (i.e chromosome). The first letter can be changed on a
per-file basis by appending ":first\_letter\_read:first\_letter\_mate"
to the file path. To change the above example into X for the read and Y
for the mate, run:

::

    readtagger --tag_file a.bam --annotate_with b.bam:X:Z ----output_file output.bam

To tag one bam file using multiple alignment files, run:

::

    readtagger --tag_file a.bam --annotate_with b.bam:A:B c.bam:C:D ----output_file output.bam

Now reads that align in file ``b.bam`` will be tagged with AR, AD and
BR, BD, while reads aligned in file ``c.bam`` are marked with CR, CD and
DR, DD.

Advanced usage
--------------

To see the advanced options, type:

::

    readtagger -h

Testing
-------

If you modify readtagger, you can run all tests by running tox:

::

    pip install tox
    tox

GitHub Events

Total
  • Delete event: 43
  • Issue comment event: 42
  • Push event: 46
  • Pull request event: 81
  • Create event: 50
Last Year
  • Delete event: 43
  • Issue comment event: 42
  • Push event: 46
  • Pull request event: 81
  • Create event: 50

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 761
  • Total Committers: 2
  • Avg Commits per committer: 380.5
  • Development Distribution Score (DDS): 0.072
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
mvdbeek m****k@g****m 706
pyup-bot g****t@p****o 55
Committer Domains (Top 20 + Academic)
pyup.io: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 2
  • Total pull requests: 363
  • Average time to close issues: 7 days
  • Average time to close pull requests: 3 months
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.84
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 99
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.59
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • yuweibao15 (1)
  • olmath (1)
Pull Request Authors
  • pyup-bot (362)
  • dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 84 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 77
  • Total maintainers: 1
pypi.org: readtagger

Tags reads in a BAM file based on other BAM files.

  • Versions: 77
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 84 Last month
Rankings
Dependent packages count: 7.4%
Dependent repos count: 22.2%
Forks count: 22.8%
Average: 24.1%
Stargazers count: 27.9%
Downloads: 40.3%
Maintainers (1)
Last synced: 11 months ago

Dependencies

requirements.txt pypi
  • bcbio-gff ==0.6.6
  • biopython ==1.74
  • cached_property ==1.5.1
  • click ==7.0
  • compare-reads ==0.0.1
  • contextlib2 ==0.6.0.post1
  • edlib ==1.3.4
  • mappy ==2.17
  • multiprocessing_logging ==0.3.0
  • pandas ==1.0.3
  • pysam ==0.15.4
  • scipy ==1.3.1
  • sortedcontainers ==2.1.0
requirements_dev.txt pypi
  • bumpversion ==0.5.3 development
  • cookiecutter ==1.6.0 development
  • flake8_docstrings ==1.5.0 development
  • planemo ==0.62.1 development
  • pydocstyle ==4.0.1 development
  • pytest ==5.2.2 development
  • pytest-cov ==2.8.1 development
  • pytest-datadir-ng ==1.1.0 development
  • pytest-flake8 ==1.0.4 development
  • pytest-mock ==1.11.2 development
  • pytest-xdist ==1.30.0 development
  • tox ==3.14.0 development
.github/workflows/deploy.yml actions
  • actions/checkout v2 composite
  • goanpeca/setup-miniconda master composite
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • goanpeca/setup-miniconda master composite
setup.py pypi