tb-variant-filter

A tool for filtering VCF files (relative to M. tuberculosis H37Rv)

https://github.com/combat-tb/tb_variant_filter

Science Score: 77.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: wiley.com
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A tool for filtering VCF files (relative to M. tuberculosis H37Rv)

Basic Info
  • Host: GitHub
  • Owner: COMBAT-TB
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 309 KB
Statistics
  • Stars: 6
  • Watchers: 2
  • Forks: 1
  • Open Issues: 5
  • Releases: 1
Created almost 7 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

tbvariantfilter

tb variant filter build status

This tool offers multiple options for filtering variants (in VCF files, relative to M. tuberculosis H37Rv coordinates).

It currently has 5 main modes:

  1. Filter by region. Mask out variants in certain regions. Region lists available as:
    1. farhat_rlc and farhat_rlc_lowmap: Refined Low Confidence (RLC) and RLC plus low mappability regions from Marin et al
    2. pe_ppe: PE/PPE genes from Fishbein et al 2015
    3. tbprofiler: TBProfiler list of antibiotic resistant genes
    4. mtbseq: MTBseq list of antibiotic resistant genes
    5. uvp: UVP list of repetitive loci in M. tuberculosis genome
  2. Filter by proximity to indels. Masks out variants within a certain distance (by default 5 bases) of an insertion or deletion site.
  3. Filter by percentage of alternate allele bases. Mask out variants with less than a minimum percentage (by default 90%) alternative alleles.
  4. Filter by depth of reads at a variant site. Masks out variants with less than a minimum depth of coverage (default 30) at the site
  5. Filter all non-SNV variants. Masks out variants that are not single nucleotide variants.

Filtering by (SAM/BAM) mapping quality was omitted because these filters are performed by the upstream workflow we (SANBI) currently use.

When used together the effects of the filters are added (i.e. a variant is masked out if it is masked by any of the filters).

Installation

The software is available via bioconda and can be installed with:

conda install tb_variant_filter

Usage

``` usage: tbvariantfilter [-h] [--regionfilter REGIONFILTER] [--closetoindelfilter] [--indelwindowsize INDELWINDOWSIZE] [--minpercentagealt_filter] [--minpercentagealt MINPERCENTAGEALT] [--mindepthfilter] [--mindepth MINDEPTH] [--snvonlyfilter] inputfile [output_file]

Filter variants from a VCF file (relative to M. tuberculosis H37Rv)

positional arguments: inputfile VCF input file (relative to H37Rv) outputfile Output file (VCF format)

optional arguments: -h, --help show this help message and exit --regionfilter REGIONFILTER, -R REGIONFILTER --closetoindelfilter, -I Mask out single nucleotide variants that are too close to indels --indelwindowsize INDELWINDOWSIZE Window around indel to mask out (mask this number of bases upstream/downstream from the indel. Requires -I option to selected) --minpercentagealtfilter, -P Mask out variants with less than a given percentage variant allele at this site --minpercentagealt MINPERCENTAGEALT Variants with less than this percentage variants at a site will be masked out --mindepthfilter, -D Mask out variants with less than a given depth of reads --mindepth MINDEPTH Variants at sites with less than this depth of reads will be masked out --snvonly_filter Mask out variants that are not SNVs ```

Note that there are no filters by default. Each filter to be used needs to be explicitly mentioned.

To export a region (from the list of possible region masks) in BED format, use the tb_region_list_to_bed command:

``` usage: tbregionlisttobed [-h] [--chromosomename CHROMOSOMENAME] {farhatrlc,farhatrlclowmap,mtbseq,peppe,tbprofiler,uvp} [output_file]

Output region filter in BED format

positional arguments: {farhatrlc,farhatrlclowmap,mtbseq,peppe,tbprofiler,uvp} Name of region list output_file File to write output to

optional arguments: -h, --help show this help message and exit --chromosomename CHROMOSOMENAME Chromosome name to use in BED ```

Testing and development environment

The repository contains a file, test_environment.yml, for creating a conda environment for testing and development. Tests can be run with pytest and tox, where tox also uses conda to create the testing environment.

For some tests, locus locations are looked up using the COMBAT-TB NeoDB. This requires an environment variable, COMBATTB_BOLT_URL. If this is not set, tests requiring this lookup are skipped. The default in tox.ini uses the SANBI hosted NeoDB instance.

Licensing and distribution

This code free software and is licensed under the terms specified in COPYING, i.e under the terms of the GNU General Public License version 3.

Owner

  • Name: combatTB
  • Login: COMBAT-TB
  • Kind: organization
  • Email: combat-tb-help@sanbi.ac.za
  • Location: RSA

Comprehensive Bacterial Analytical ToolKit for Tuberculosis (TB) Research (and related projects)

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: van Heusden
    given-names: Peter
    orcid: https://orcid.org/0000-0001-6553-5274
title: "TB Variant Filter"
version: 0.3.5
date-released: 2021-05-28

GitHub Events

Total
Last Year

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 69
  • Total Committers: 1
  • Avg Commits per committer: 69.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Peter van Heusden p****h@s****a 69
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 4
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 4
  • Total pull request authors: 1
  • Average comments per issue: 0.25
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • pvanheus (1)
  • bdelavan (1)
  • biominer (1)
  • conmeehan (1)
Pull Request Authors
  • biominer (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 20 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 7
  • Total maintainers: 1
pypi.org: tb-variant-filter

This tool offers multiple options for filtering variants (in VCF files, relative to M. tuberculosis H37Rv).

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 20 Last month
Rankings
Dependent packages count: 10.0%
Stargazers count: 21.5%
Dependent repos count: 21.7%
Forks count: 22.6%
Average: 23.6%
Downloads: 41.9%
Maintainers (1)
Last synced: 7 months ago

Dependencies

.github/workflows/tb_variant_filter.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v2 composite
  • conda-incubator/setup-miniconda v2 composite