{"id":15489787,"url":"https://github.com/oschwengers/tadrep","last_synced_at":"2026-03-04T21:32:14.716Z","repository":{"id":37757451,"uuid":"493619659","full_name":"oschwengers/tadrep","owner":"oschwengers","description":"Targeted Detection and Reconstruction of Plasmids","archived":false,"fork":false,"pushed_at":"2024-05-07T07:19:59.000Z","size":2753,"stargazers_count":22,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-29T06:08:00.237Z","etag":null,"topics":["bacteria","plasmids","wgs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oschwengers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-18T10:42:55.000Z","updated_at":"2025-12-19T13:17:07.000Z","dependencies_parsed_at":"2024-11-01T02:05:30.893Z","dependency_job_id":"8efaba84-5f81-4d72-9078-f985305eea25","html_url":"https://github.com/oschwengers/tadrep","commit_stats":{"total_commits":109,"total_committers":3,"mean_commits":"36.333333333333336","dds":"0.12844036697247707","last_synced_commit":"c67e87fc0b3963c928cd9a9d7b3d5cb5bd3813bf"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/oschwengers/tadrep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oschwengers%2Ftadrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oschwengers%2Ftadrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oschwengers%2Ftadrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oschwengers%2Ftadrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oschwengers","download_url":"https://codeload.github.com/oschwengers/tadrep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oschwengers%2Ftadrep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30093790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T20:42:30.420Z","status":"ssl_error","status_checked_at":"2026-03-04T20:42:30.057Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bacteria","plasmids","wgs"],"created_at":"2024-10-02T07:07:57.812Z","updated_at":"2026-03-04T21:32:14.674Z","avatar_url":"https://github.com/oschwengers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-brightgreen.svg)](https://github.com/oschwengers/tadrep/blob/master/LICENSE)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tadrep.svg)\n![PyPI - Status](https://img.shields.io/pypi/status/tadrep.svg)\n![GitHub release](https://img.shields.io/github/release/oschwengers/tadrep.svg)\n[![PyPI](https://img.shields.io/pypi/v/tadrep.svg)](https://pypi.org/project/tadrep)\n[![Conda](https://img.shields.io/conda/v/bioconda/tadrep.svg)](https://bioconda.github.io/recipes/tadrep/README.html)\n\n# TaDReP: Targeted Detection and Reconstruction of Plasmids\n\nTaDReP is a tool for the rapid targeted detection and reconstruction of plasmids within bacterial draft genomes.\n\n- [Description](#description)\n- [Installation](#installation)\n- [Input \u0026 Output](#input-and-output)\n- [Overview](#overview)\n- [Usage](#usage)\n  - [Setup](#setup)\n  - [Database](#database)\n  - [Extract](#extract)\n  - [Characterize](#characterize)\n  - [Cluster](#cluster)\n  - [Detect](#detect)\n  - [Visualize](#visualize)\n- [Issues \u0026 Feature Requests](#issues)\n\n## Description\n\nTaDReP facilitates the rapid screening for target plasmids within single or cohorts of draft genomes.\n\nIt detects and reconstructs reference plasmids within bacterial draft assemblies via Blast+ alignments of draft genome contigs that are rigourously filtered for coverage and sequence identity thresholds. Finally, reference plasmids are detected and reconstructed if strict thresholds regarding plasmid-wise coverage and sequence identity are met.\n\n## Installation\n\nTaDRep can be installed via Conda and Pip. However, we encourage to use [Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) to automatically install all required 3rd party dependencies.\n\n### Conda\n\n```bash\nconda install -c conda-forge -c bioconda tadrep\n```\n\n### Pip\n\n```bash\n$ python3 -m pip install --user tadrep\n```\n\n## Input and Output\n\n### Input\n\nTaDReP accepts bacterial draft genome assemblies in (zipped) fasta format. Complete reference plasmid sequences are either extracted from (semi-)closed genomes or plasmid sequence collections, or created from public plasmid databases (RefSeq / PLSDB). For further information how to extract plasmid sequences, please read the [extract](#extract) section below.\n\n### Output\n\nFor each draft genome TaDReP writes a TSV summary file providing all detected reference plasmids and aligned genome contigs. For each reference plasmid that was detected in a draft assembly, ordered and rearranged contigs are exported as `N`-merged scaffolds, as well as mere contigs. Furthermore, for each reconstructed plasmid, the reference plasmid backbone and all contig alignments are visualized (PDF).\n\n- `\u003cgenome\u003e-summary.tsv`: detailed per contig alignment summary\n- `\u003cgenome\u003e-\u003cplasmid\u003e-contigs.fna`: ordered and rearranged contigs of the reconstructed plasmid\n- `\u003cgenome\u003e-\u003cplasmid\u003e-pseudo.fna`: pseudomolecule sequence of the reconstructed plasmid\n- `\u003cgenome\u003e-\u003cplasmid\u003e.pdf`: visualization of aligned contigs against the detected reference plasmid\n\nIf multiple genomes are provided, TaDReP also provides a presence/absence matrix of all detected plasmids as a cohort analyses, as well as a short summary of plasmids and which contigs were matched in each genome.\n\n- `plasmids.info`: plasmid characterization summary\n- `plasmids.tsv`: presence/absence table of detected plasmids\n- `summary.tsv`: short summary of matched contigs through all genomes\n- `tadrep.log`: log-file for debugging\n\n## Overview\n\n![TaDReP overview](./images/tadrep.png)\n\n## Usage\n\nTaDReP's workflow comprises seven steps implement in CLI submodules to ease semi-automated multi-step analyses.\n\n```\nusage: TaDReP [--help] [--verbose] [--threads THREADS] [--tmp-dir TMP_DIR] [--version] [--output OUTPUT] [--prefix PREFIX]  ...\n\nTargeted Detection and Reconstruction of Plasmids\n\nGeneral:\n  --help, -h            Show this help message and exit\n  --verbose, -v         Print verbose information\n  --threads THREADS, -t THREADS\n                        Number of threads to use (default = number of available CPUs)\n  --tmp-dir TMP_DIR     Temporary directory to store blast hits\n  --version             show program's version number and exit\n\nGeneral Input / Output:\n  --output OUTPUT, -o OUTPUT\n                        Output directory (default = current working directory)\n  --prefix PREFIX       Prefix for all output files (default = None)\n\nSubmodules:\n  \n    setup               Download and prepare inc-types\n    database            Download and create database for TaDReP\n    extract             Extract unique plasmid sequences\n    characterize        Identify plasmids with GC content, Inc types, conjugation genes\n    cluster             Cluster related plasmids\n    detect              Detect and reconstruct plasmids in draft genomes\n    visualize           Visualize plasmid coverage of contigs\n\nCitation:\nSchwengers et al. (2023)\nTaDReP: Targeted Detection and Reconstruction of Plasmids.\nGitHub https://github.com/oschwengers/tadrep\n```\n\n## Setup\n\nThe `setup` module downloads external databases, *e.g.* PlasmidFinders incompatibility groups that are required to characterize plasmids.\n\n### Example\n\nVerbosely download inc-types:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e setup\n```\n\n## Database\n\nThe `database` module downloads public plasmid databases (PLSDB / RefSeq) into a reference plasmid file. This creates a subdirectory in a user specified output directory.\n\nIf you downloaded a database, you can skip the extract step and start with the [characterization](#characterize).\n\n```bash\nusage: TaDReP database [-h] [--type {refseq,plsdb}] [--force]\n\noptions:\n  -h, --help            show this help message and exit\n\nInput / Output:\n  --type {refseq,plsdb}\n                        External DB to import (default = 'refseq')\n  --force, -f           Force download and new setup of database\n```\n\n### Examples\n\nCreate refseq database:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e database --type refseq\n```\n\nCreate PLSDB database:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e database --type plsdb\n```\n\nOverwrite existing refseq files with newly downloaded data.\n\n```bash\ntadrep -v -o \u003coutput-path\u003e database --type refseq -f\n```\n\n## Extract\n\nThe `extract` module Extracts reference plasmid sequences from complete genomes, (semi-)draft genomes or plasmid files.\n\n```bash\nusage: TaDReP extract [-h] [--type {genome,plasmid,draft}] [--header HEADER] [--files FILES [FILES ...]] [--discard-longest DISCARD_LONGEST] [--max-length MAX_LENGTH]\n\noptions:\n  -h, --help            show this help message and exit\n\nInput:\n  --type {genome,plasmid,draft}, -t {genome,plasmid,draft}\n                        Type of input files\n  --header HEADER       Template for header description inside input files: e.g.: header: \"\u003epl1234\" --\u003e --header \"pl\"\n  --files FILES [FILES ...], -f FILES [FILES ...]\n                        File path\n  --discard-longest DISCARD_LONGEST, -d DISCARD_LONGEST\n                        Discard n longest sequences in output\n  --max-length MAX_LENGTH, -m MAX_LENGTH\n                        Max sequence length (default = 1000000 bp)\n```\n\nFor different input types specified via `--type`:\n\n- `genome`: extract all but the longest sequence. This can be adjusted via `--discard-longest`.\n- `draft`: extracts only sequences with specific headers. Headers can be specified via `--header`.\n- `plasmid`: extracts all sequences from a given file without any filtering.\n\nIf you extracted references, you can skip the database step and start with the [characterization](#characterize).\n\n### Examples\n\nExtract all sequences from file `plasmids.fna` ignoring the two longest:\n\n```bash\ntadrep -v --type genome --discard-longest 2 --files plasmids.fna\n```\n\nExtract all sequences from file `plasmids.fna` where `header` contains `pl`:\n\n```bash\ntadrep -v --type draft --header \"pl\" --files plasmids.fna\n```\n\nExtract all potential plasmid sequences (one of 'plasmid', 'complete', 'circular=true' in header) from file `plasmids.fna` ignoring sequences longer than 500000 bp:\n\n```bash\ntadrep -v --type draft --max-length 500000 --files plasmids.fna\n```\n\nExtract all sequences from file `plasmids.fna`:\n\n```bash\ntadrep -v --type plasmid --files plasmids.fna\n```\n\n## Characterize\n\nThe `characterize` module characterizes all reference plasmids by the following features:\n\n- Length\n- GC content\n- Incompatibility types\n- Number of coding sequences\n\nIf you downloaded a reference database this is the step to start with.\n\n```bash\nusage: TaDReP characterize [-h] [--db DATABASE] [--inc-types INC_TYPES]\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nInput:\n  --db DATABASE         Import json file from a given database path into working directory\n  --inc-types INC_TYPES\n                        Import inc-types from given path into working directory\n```\n\n### Examples\n\nCharacterize plasmids in working directory `\u003coutput-path\u003e` and import inc-types from `inc-types` folder:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e characterize --inc-types inc-types/inc-types.fasta\n```\n\nIf inc-types is already present inside the working directory, the parameter `--inc-types` can be omitted:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e characterize\n```\n\nIf you downloaded a database you can import it into the working directory `\u003coutput-path\u003e` with the `--db` parameter:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e characterize --db databases/plsdb/plsdb.json --inc-types inc-types/inc-types.fasta\n```\n\n## Cluster\n\nThe `cluster` module groups plasmids with similar sequences and features.\n\n```bash\nusage: TaDReP cluster [-h] [--min-sequence-identity [1-100]] [--max-sequence-length-difference [1-1000000]] [--skip]\n\noptions:\n  -h, --help            show this help message and exit\n\nParameter:\n  --min-sequence-identity [1-100]\n                        Minimal plasmid sequence identity (default = 90%)\n  --max-sequence-length-difference [1-1000000]\n                        Maximal plasmid sequence length difference in basepairs (default = 1000)\n  --skip, -s            Skips clustering, one group for each plasmid\n```\n\n### Example\n\n```bash\ntadrep -v cluster\n```\n\n## Detect\n\nThe `detect` module aligns contigs of bacterial draft genomes to reference plasmids using BLAST+. Each match is evaluated by coverage and sequence identity of the aligned plasmid section and can be individualy adjusted by using `--min-plasmid-identity` and `--min-plasmid-coverage`. If various contigs match a plasmid and the combined coverage and identity exceed a certain threshold, the combination of aligned contigs is saved.\n\nEach detected plasmid is reconstructed as a pseudo sequence, where matching contigs are linked by a sequence of `N`. Information on detected \u0026 reconstructed plasmids and in which draft genomes they were found in provided in a summary and a presence-absence table.\n\n```bash\nusage: TaDReP detect [-h] [--genome GENOME [GENOME ...]] [--min-contig-coverage [1-100]] [--min-contig-identity [1-100]] [--min-plasmid-coverage [1-100]] [--min-plasmid-identity [1-100]]\n                     [--gap-sequence-length GAP_SEQUENCE_LENGTH]\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nInput / Output:\n  --genome GENOME [GENOME ...], -g GENOME [GENOME ...]\n                        Draft genome path\n\nAnnotation:\n  --min-contig-coverage [1-100]\n                        Minimal contig coverage (default = 90%)\n  --min-contig-identity [1-100]\n                        Maximal contig identity (default = 90%)\n  --min-plasmid-coverage [1-100]\n                        Minimal plasmid coverage (default = 80%)\n  --min-plasmid-identity [1-100]\n                        Minimal plasmid identity (default = 90%)\n  --gap-sequence-length GAP_SEQUENCE_LENGTH\n                        Gap sequence N length (default = 10)\n```\n\n### Examples\n\nDetect reference plasmids from directory `\u003coutput-path\u003e` in file `draft.fna` with default settings:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e detect --genome draft.fna\n```\n\nDetect reference plasmids from directory `\u003coutput-path\u003e` in file `draft.fna`;\n\n`75%` of `contig length` has to be covered by a match;\n\n `Combined contig matches` have to cover at least `95%` of `reference plasmid` length:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e detect --genome draft.fna --min-contig-coverage 75 --min-plasmid-coverage 95\n```\n\nDetect reference plasmids from directory `\u003coutput-path\u003e` in file `draft.fna`;\n\n`Contig sequence` of a match has to be at least `80%` identical to reference plasmid;\n\n`Combined contig matches` have to sum up to at least `95%` identity of `reference plasmid` sequence:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e detect --genome draft.fna --min-contig-identity 80 --min-plasmid-identity 95\n```\n\nNote: `--min-contig-coverage` / `--min-plasmid-identity` and `--min-contig-identity` / `--min-plasmid-coverage` can be combined as well.\n\n## Visualize\n\nThe `visualize` module visualizes matching contigs from draft genomes for each detected plasmid.\n\nBy default, contigs are represented by boxes, either on top or bottom of the plasmid center line. The position of the boxes represents a match on either forward or backward strand respectively. A colour gradient is used to indicate the identity between contig and plasmid section, a brighter colorization implies smaller sequence identity. The start of this gradient, where it is the brightest, can be individually set with the `--interval-start` parameter.\n\n```bash\nusage: TaDReP visualize [-h] [--plotstyle {bigarrow,arrow,bigbox,box,bigrbox,rbox}] [--labelcolor LABELCOLOR] [--linewidth LINEWIDTH] [--arrow-shaft-ratio ARROW_SHAFT_RATIO] [--size-ratio SIZE_RATIO]\n                        [--labelsize LABELSIZE] [--labelrotation LABELROTATION] [--labelhpos {left,center,right}] [--labelha {left,center,right}] [--interval-start [0-100]] [--number-of-intervals [1-100]]\n                        [--omit_ratio [0-100]]\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nStyle:\n  --plotstyle {bigarrow,arrow,bigbox,box,bigrbox,rbox}\n                        Contig representation in plot\n  --labelcolor LABELCOLOR\n                        Contig label color\n  --linewidth LINEWIDTH\n                        Contig edge linewidth\n  --arrow-shaft-ratio ARROW_SHAFT_RATIO\n                        Size ratio between arrow head and shaft\n  --size-ratio SIZE_RATIO\n                        Contig size ratio to track\n\nLabel:\n  --labelsize LABELSIZE\n                        Contig label size\n  --labelrotation LABELROTATION\n                        Contig label rotation\n  --labelhpos {left,center,right}\n                        Contig label horizontal position\n  --labelha {left,center,right}\n                        Contig label horizontal alignment\n\nGradient:\n  --interval-start [0-100]\n                        Percentage where gradient should stop\n  --number-of-intervals [1-100]\n                        Number of gradient intervals\n\nOmit:\n  --omit_ratio [0-100]  Omit contigs shorter than X percent of plasmid length from plot\n```\n\n### Examples\n\nVisualize results from detection in directory `\u003coutput-path\u003e` with default settings:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e visualize\n```\n\nVisualize results from detection in directory `sho\u003coutput-path\u003ewcase`;\n\n`Brightest colour` of gradient starts at `95.5%` sequence identity (darkest colour is always 100% identity);\n\n`Surround` contig blocks with `1px` line:\n\n```bash\ntadrep -v -o \u003coutput-path\u003e visualize --interval-start 95.5 --linewidth 1\n```\n\n## Issues \u0026 Feature Requests\n\nTaDReP is brand new and like in every software, expect some bugs lurking around. So, if you run into any issues with TaDReP, we'd be happy to hear about it.\nTherefore, please, execute it in verbose mode (`-v`) and do not hesitate to file an issue including as much information as possible:\n\n- a detailed description of the issue\n- command line output\n- log file (`tadrep.log`)\n- a reproducible example of the issue with an input file that you can share _if possible_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foschwengers%2Ftadrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foschwengers%2Ftadrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foschwengers%2Ftadrep/lists"}