Package: tadrep
TaDReP: Targeted Detection and Reconstruction of PlasmidsTaDReP is a tool for the rapid targeted detection and reconstruction of plasmids within bacterial draft genomes.DescriptionInstallationInput & OutputOverviewUsageSetupDatabaseExtractCharacterizeClusterDetectVisualizeIssues & Feature RequestsDescriptionTaDReP facilitates the rapid screening for target plasmids within single or cohorts of draft genomes.It 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.InstallationTaDRep can be installed via Conda and Pip. However, we encourage to useCondato automatically install all required 3rd party dependencies.Condacondainstall-cconda-forge-cbiocondatadrepPip$python3-mpipinstall--usertadrepInput and OutputInputTaDReP 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 theextractsection below.OutputFor 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 asN-merged scaffolds, as well as mere contigs. Furthermore, for each reconstructed plasmid, the reference plasmid backbone and all contig alignments are visualized (PDF).<genome>-summary.tsv: detailed per contig alignment summary<genome>-<plasmid>-contigs.fna: ordered and rearranged contigs of the reconstructed plasmid<genome>-<plasmid>-pseudo.fna: pseudomolecule sequence of the reconstructed plasmid<genome>-<plasmid>.pdf: visualization of aligned contigs against the detected reference plasmidIf 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.plasmids.info: plasmid characterization summaryplasmids.tsv: presence/absence table of detected plasmidssummary.tsv: short summary of matched contigs through all genomestadrep.log: log-file for debuggingOverviewUsageTaDReP's workflow comprises seven steps implement in CLI submodules to ease semi-automated multi-step analyses.usage: TaDReP [--help] [--verbose] [--threads THREADS] [--tmp-dir TMP_DIR] [--version] [--output OUTPUT] [--prefix PREFIX]  ...

Targeted Detection and Reconstruction of Plasmids

General:
  --help, -h            Show this help message and exit
  --verbose, -v         Print verbose information
  --threads THREADS, -t THREADS
                        Number of threads to use (default = number of available CPUs)
  --tmp-dir TMP_DIR     Temporary directory to store blast hits
  --version             show program's version number and exit

General Input / Output:
  --output OUTPUT, -o OUTPUT
                        Output directory (default = current working directory)
  --prefix PREFIX       Prefix for all output files (default = None)

Submodules:
  
    setup               Download and prepare inc-types
    database            Download and create database for TaDReP
    extract             Extract unique plasmid sequences
    characterize        Identify plasmids with GC content, Inc types, conjugation genes
    cluster             Cluster related plasmids
    detect              Detect and reconstruct plasmids in draft genomes
    visualize           Visualize plasmid coverage of contigs

Citation:
Schwengers et al. (2023)
TaDReP: Targeted Detection and Reconstruction of Plasmids.
GitHub https://github.com/oschwengers/tadrepSetupThesetupmodule downloads external databases,e.g.PlasmidFinders incompatibility groups that are required to characterize plasmids.ExampleVerbosely download inc-types:tadrep-v-o<output-path>setupDatabaseThedatabasemodule downloads public plasmid databases (PLSDB / RefSeq) into a reference plasmid file. This creates a subdirectory in a user specified output directory.If you downloaded a database, you can skip the extract step and start with thecharacterization.usage:TaDRePdatabase[-h][--type{refseq,plsdb}][--force]options:-h,--helpshowthishelpmessageandexitInput/Output:--type{refseq,plsdb}ExternalDBtoimport(default='refseq')--force,-fForcedownloadandnewsetupofdatabaseExamplesCreate refseq database:tadrep-v-o<output-path>database--typerefseqCreate PLSDB database:tadrep-v-o<output-path>database--typeplsdbOverwrite existing refseq files with newly downloaded data.tadrep-v-o<output-path>database--typerefseq-fExtractTheextractmodule Extracts reference plasmid sequences from complete genomes, (semi-)draft genomes or plasmid files.usage:TaDRePextract[-h][--type{genome,plasmid,draft}][--headerHEADER][--filesFILES[FILES...]][--discard-longestDISCARD_LONGEST][--max-lengthMAX_LENGTH]options:-h,--helpshowthishelpmessageandexitInput:--type{genome,plasmid,draft},-t{genome,plasmid,draft}Typeofinputfiles--headerHEADERTemplateforheaderdescriptioninsideinputfiles:e.g.:header:">pl1234"-->--header"pl"--filesFILES[FILES...],-fFILES[FILES...]Filepath--discard-longestDISCARD_LONGEST,-dDISCARD_LONGESTDiscardnlongestsequencesinoutput--max-lengthMAX_LENGTH,-mMAX_LENGTHMaxsequencelength(default=1000000bp)For different input types specified via--type:genome: extract all but the longest sequence. This can be adjusted via--discard-longest.draft: extracts only sequences with specific headers. Headers can be specified via--header.plasmid: extracts all sequences from a given file without any filtering.If you extracted references, you can skip the database step and start with thecharacterization.ExamplesExtract all sequences from fileplasmids.fnaignoring the two longest:tadrep-v--typegenome--discard-longest2--filesplasmids.fnaExtract all sequences from fileplasmids.fnawhereheadercontainspl:tadrep-v--typedraft--header"pl"--filesplasmids.fnaExtract all potential plasmid sequences (one of 'plasmid', 'complete', 'circular=true' in header) from fileplasmids.fnaignoring sequences longer than 500000 bp:tadrep-v--typedraft--max-length500000--filesplasmids.fnaExtract all sequences from fileplasmids.fna:tadrep-v--typeplasmid--filesplasmids.fnaCharacterizeThecharacterizemodule characterizes all reference plasmids by the following features:LengthGC contentIncompatibility typesNumber of coding sequencesIf you downloaded a reference database this is the step to start with.usage:TaDRePcharacterize[-h][--dbDATABASE][--inc-typesINC_TYPES]optionalarguments:-h,--helpshowthishelpmessageandexitInput:--dbDATABASEImportjsonfilefromagivendatabasepathintoworkingdirectory--inc-typesINC_TYPESImportinc-typesfromgivenpathintoworkingdirectoryExamplesCharacterize plasmids in working directory<output-path>and import inc-types frominc-typesfolder:tadrep-v-o<output-path>characterize--inc-typesinc-types/inc-types.fastaIf inc-types is already present inside the working directory, the parameter--inc-typescan be omitted:tadrep-v-o<output-path>characterizeIf you downloaded a database you can import it into the working directory<output-path>with the--dbparameter:tadrep-v-o<output-path>characterize--dbdatabases/plsdb/plsdb.json--inc-typesinc-types/inc-types.fastaClusterTheclustermodule groups plasmids with similar sequences and features.usage:TaDRePcluster[-h][--min-sequence-identity[1-100]][--max-sequence-length-difference[1-1000000]][--skip]options:-h,--helpshowthishelpmessageandexitParameter:--min-sequence-identity[1-100]Minimalplasmidsequenceidentity(default=90%)--max-sequence-length-difference[1-1000000]Maximalplasmidsequencelengthdifferenceinbasepairs(default=1000)--skip,-sSkipsclustering,onegroupforeachplasmidExampletadrep-vclusterDetectThedetectmodule 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-identityand--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.Each detected plasmid is reconstructed as a pseudo sequence, where matching contigs are linked by a sequence ofN. Information on detected & reconstructed plasmids and in which draft genomes they were found in provided in a summary and a presence-absence table.usage:TaDRePdetect[-h][--genomeGENOME[GENOME...]][--min-contig-coverage[1-100]][--min-contig-identity[1-100]][--min-plasmid-coverage[1-100]][--min-plasmid-identity[1-100]][--gap-sequence-lengthGAP_SEQUENCE_LENGTH]optionalarguments:-h,--helpshowthishelpmessageandexitInput/Output:--genomeGENOME[GENOME...],-gGENOME[GENOME...]Draftgenomepath

Annotation:--min-contig-coverage[1-100]Minimalcontigcoverage(default=90%)--min-contig-identity[1-100]Maximalcontigidentity(default=90%)--min-plasmid-coverage[1-100]Minimalplasmidcoverage(default=80%)--min-plasmid-identity[1-100]Minimalplasmididentity(default=90%)--gap-sequence-lengthGAP_SEQUENCE_LENGTHGapsequenceNlength(default=10)ExamplesDetect reference plasmids from directory<output-path>in filedraft.fnawith default settings:tadrep-v-o<output-path>detect--genomedraft.fnaDetect reference plasmids from directory<output-path>in filedraft.fna;75%ofcontig lengthhas to be covered by a match;Combined contig matcheshave to cover at least95%ofreference plasmidlength:tadrep-v-o<output-path>detect--genomedraft.fna--min-contig-coverage75--min-plasmid-coverage95Detect reference plasmids from directory<output-path>in filedraft.fna;Contig sequenceof a match has to be at least80%identical to reference plasmid;Combined contig matcheshave to sum up to at least95%identity ofreference plasmidsequence:tadrep-v-o<output-path>detect--genomedraft.fna--min-contig-identity80--min-plasmid-identity95Note:--min-contig-coverage/--min-plasmid-identityand--min-contig-identity/--min-plasmid-coveragecan be combined as well.VisualizeThevisualizemodule visualizes matching contigs from draft genomes for each detected plasmid.By 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-startparameter.usage:TaDRePvisualize[-h][--plotstyle{bigarrow,arrow,bigbox,box,bigrbox,rbox}][--labelcolorLABELCOLOR][--linewidthLINEWIDTH][--arrow-shaft-ratioARROW_SHAFT_RATIO][--size-ratioSIZE_RATIO][--labelsizeLABELSIZE][--labelrotationLABELROTATION][--labelhpos{left,center,right}][--labelha{left,center,right}][--interval-start[0-100]][--number-of-intervals[1-100]][--omit_ratio[0-100]]optionalarguments:-h,--helpshowthishelpmessageandexitStyle:--plotstyle{bigarrow,arrow,bigbox,box,bigrbox,rbox}Contigrepresentationinplot--labelcolorLABELCOLORContiglabelcolor--linewidthLINEWIDTHContigedgelinewidth--arrow-shaft-ratioARROW_SHAFT_RATIOSizeratiobetweenarrowheadandshaft--size-ratioSIZE_RATIOContigsizeratiototrack

Label:--labelsizeLABELSIZEContiglabelsize--labelrotationLABELROTATIONContiglabelrotation--labelhpos{left,center,right}Contiglabelhorizontalposition--labelha{left,center,right}Contiglabelhorizontalalignment

Gradient:--interval-start[0-100]Percentagewheregradientshouldstop--number-of-intervals[1-100]Numberofgradientintervals

Omit:--omit_ratio[0-100]OmitcontigsshorterthanXpercentofplasmidlengthfromplotExamplesVisualize results from detection in directory<output-path>with default settings:tadrep-v-o<output-path>visualizeVisualize results from detection in directorysho<output-path>wcase;Brightest colourof gradient starts at95.5%sequence identity (darkest colour is always 100% identity);Surroundcontig blocks with1pxline:tadrep-v-o<output-path>visualize--interval-start95.5--linewidth1Issues & Feature RequestsTaDReP 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.
Therefore, please, execute it in verbose mode (-v) and do not hesitate to file an issue including as much information as possible:a detailed description of the issuecommand line outputlog file (tadrep.log)a reproducible example of the issue with an input file that you can shareif possible