Package: dnaapler
dnaaplerDnaapler is a simple tool that reorients complete circular microbial genomes.Quick Start# creates empty conda environment
conda create -n dnaapler_env

# activates conda environment
conda activate dnaapler_env

# installs dnaapler
conda install -c bioconda dnaapler

# runs dnaapler all 
dnaapler all -i input_mixed_contigs.fasta -o output_directory_path -p my_bacteria_name -t 8

# runs dnaapler chromosome
dnaapler chromosome -i input_chromosome.fasta -o output_directory_path -p my_bacteria_name -t 8PaperDnaapler has been published in JOSShere. If you use Dnaapler in your work, please cite it as follows:George Bouras, Susanna R. Grigson, Bhavya Papudeshi, Vijini Mallawaarachchi, Michael J. Roach (2024). Dnaapler: A tool to reorient circular microbial genomes. Journal of Open Source Software, 9(93), 5968, https://doi.org/10.21105/joss.05968Additionally, please consider citing the dependencies where relevant:Altschul S.F., Gish W., Miller W., Myers E.W., Lipman D.J. Basic local alignment search tool. J Mol Biol. 1990 Oct 5;215(3):403-10. doi: 10.1016/S0022-2836(05)80360-2. PMID: 2231712.

Larralde, M., (2022). Pyrodigal: Python bindings and interface to Prodigal, an efficient method for gene prediction in prokaryotes. Journal of Open Source Software, 7(72), 4296, https://doi.org/10.21105/joss.04296.

Hyatt, D., Chen, GL., LoCascio, P.F. et al. Prodigal: prokaryotic gene recognition and translation initiation site identification. BMC Bioinformatics 11, 119 (2010). https://doi.org/10.1186/1471-2105-11-119.Table of ContentsdnaaplerQuick StartPaperTable of ContentsDescriptionDocumentationCommandsInstallationCondaPipUsageExample UsageDatabasesMotivationContributingAcknowledgementsDescriptiondnaapleris a simple python program that takes a single nucleotide input sequence (in FASTA format), finds the desired start gene usingblastxagainst an amino acid sequence database, checks that the start codon of this gene is found, and if so, then reorients the chromosome to begin with this gene on the forward strand.It was originally designed to replicate the reorientation functionality ofUnicyclerwith dnaA, but for for long-read first assembled chromosomes. We have extended it to work with plasmids (dnaapler plasmid) and phages (dnaapler phage), or for any input FASTA desired withdnaapler custom,dnaapler mysteryordnaapler nearest.For bacterial chromosomes,dnaapler chromosomeshould ensure the chromosome breakpoint never interrupts genes or mobile genetic elements like prophages. It is intended to be used with good-quality completed bacterial genomes, generated with methods such asTrycycler,Dragonflyeor my own pipelinehybracter.Additionally, you can also reorient multiple bacterial chromosomes/plasmids/phages at once using thednaapler bulksubcommand.If your input FASTA is mixed (e.g. has chromosome and plasmids), you can also usednaapler all, with the option to ignore some contigs with the--ignoreparameter.DocumentationThe full documentation fordnaaplercan be foundhere.Commandsdnaapler all: Reorients 1 or more contigs to begin with any of dnaA, terL, repA.Practically, this should be the most useful command for most users.dnaapler chromosome: Reorients your sequence to begin with the dnaA chromosomal replication initiator genednaapler plasmid: Reorients your sequence to begin with the repA plasmid replication initiation genednaapler phage: Reorients your sequence to begin with the terL large terminase subunit genednaapler custom: Reorients your sequence to begin with a custom amino acid FASTA format gene that you specifydnaapler mystery: Reorients your sequence to begin with a random CDSdnaapler largest: Reorients your sequence to begin with the largest CDSdnaapler nearest: Reorients your sequence to begin with the first CDS (nearest to the start). Designed for fixing sequences where a CDS spans the breakpoint.dnaapler bulk: Reorients multiple contigs to begin with the desired start gene - either dnaA, terL, repA or a custom gene.Installationdnaaplerrequires only BLAST v2.10 or higher as an external dependency.Installation from conda is highly recommended as this will install BLAST automatically.Condadnaapleris available on bioconda.conda install -c bioconda dnaaplerPipYou can also installdnaaplerwith pip.pip install dnaaplerIf you installdnaaplerwith pip, then you will then need to install BLAST v 2.9 or higher separately. It will need to be available in the$PATHor elsednaaplerwill not work.UsageUsage: dnaapler [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --help     Show this message and exit.
  -V, --version  Show the version and exit.

Commands:
  all         Reorients contigs to begin with any of dnaA, repA...
  bulk        Reorients multiple genomes to begin with the same gene
  chromosome  Reorients your genome to begin with the dnaA chromosomal...
  citation    Print the citation(s) for this tool
  custom      Reorients your genome with a custom database
  largest     Reorients your genome the begin with the largest CDS as...
  mystery     Reorients your genome with a random CDS
  nearest     Reorients your genome the begin with the first CDS as...
  phage       Reorients your genome to begin with the terL large...
  plasmid     Reorients your genome to begin with the repA replication...Usage: dnaapler all [OPTIONS]

Reorients contigs to begin with any of dnaA, repA or terL

Options:
-h, --help               Show this message and exit.
-V, --version            Show the version and exit.
-i, --input PATH         Path to input file in FASTA format  [required]
-o, --output PATH        Output directory   [default: output.dnaapler]
-t, --threads INTEGER    Number of threads to use with BLAST  [default: 1]
-p, --prefix TEXT        Prefix for output files  [default: dnaapler]
-f, --force              Force overwrites the output directory
-e, --evalue TEXT        e value for blastx  [default: 1e-10]
--ignore PATH            Text file listing contigs (one per row) that are to
                         be ignored
-a, --autocomplete TEXT  Choose an option to autocomplete reorientation if
                         BLAST based approach fails. Must be one of: none,
                         mystery, largest, or nearest [default: none]
--seed_value INTEGER     Random seed to ensure reproducibility.  [default:
                         13]The reoriented output FASTA will be{prefix}_reoriented.fastain the specified output directory.Example UsageFor more detailed example usage, please see theexamplessection of the documentation.dnaapler all -i input.fasta -o output_directory_path -p my_genome_name --ignore list_of_contigs_to_ignore.txtdnaapler chromosome -i input.fasta -o output_directory_path -p my_bacteria_name -t 8dnaapler phage -i input.fasta -o output_directory_path -p my_phage_name -t 8dnaapler plasmid -i input.fasta -o output_directory_path -p my_plasmid_name -t 8dnaapler custom -i input.fasta -o output_directory_path -p my_genome_name -t 8 -c my_custom_database_filednaapler mystery -i input.fasta -o output_directory_path -p my_genome_namednaapler nearest -i input.fasta -o output_directory_path -p my_genome_namednaapler largest -i input.fasta -o output_directory_path -p my_genome_name# to reorient multiple bacterial chromosomes
dnaapler bulk -i input_file_with_multiple_chromosomes.fasta -m chromosome -o output_directory_path -p my_genome_nameDatabasesdnaapler chromosomeuses 584 proteins downloaded from Swissprot with the query "Chromosomal replication initiator protein DnaA" on 24 May 2023 as its database for dnaA. All hits from the query were also filtered to ensure "GN=dnaA" was included in the header of the FASTA entry.dnaapler plasmiduses the repA database curated by Ryan Wick inUnicycler.dnaapler phageuses a terL database curated usingPHROGs. All the AA sequences of the 55 phrogs annotated as 'large terminase subunit' were downloaded, combined and depduplicated usingseqkitseqkit rmdup -s -o terL.faa phrog_terL.faa.dnaapler alluses all three databases combined into one.dnaapler customuses a custom amino acid FASTA format file that you specify using-c.The matching is strict - it requires a strong BLASTx match (default e-value 1E-10), and the first amino acid of a BLASTx hit gene to be identified as Methionine, Valine or Leucine, the 3 most used start codons in bacteria/phages.For the most commonly studied microbes (ESKAPE pathogens, etc), the dnaA database should suffice.If you trydnaapleron a more novel or under-studied microbe with a dnaA gene that has little sequence similarity to the database, you may need to provide your own dnaA gene(s) in amino acid FASTA format usingdnaapler custom.After thisissue,dnaapler mysterywas added. It predicts all ORFs in the input usingpyrodigal, then picks a random gene to re-orient your sequence with.MotivationI couldn't getCirclatorto work and it is no longer supported.berokkadoesn't orient chromosomes to begin with dnaa.After reading Ryan Wick's masterful bacterial genome assemblytutorial, I realised that it is probably optimal to run 2 polishing steps, once before then once after rotating the chromosome, to ensure the breakpoint is polished. Further, for some "complete" long read bacterial assemblies that didn't circularise properly, I figured that as long as you have a complete assembly (even if not "circular" as marked as in Flye), polishing after a re-orientation would be likely to circularise the chromosome. A bit like Ryan'srotate_circular_gfa.pyscript, without the requirement of strict circularity.While researching MGEs inS. aureuswhole genome sequences, I repeatedly found instances where MGEs were interrupted by the chromosome breakpoint. So I thought I'd add a tool to automate it in my pipeline.It's probably good to have all your sequences start at the same location for synteny analyses.ContributingIf you would like to help improvednaapleryou are very welcome!For changes to be accepted, they must pass the CI checks.Please seeCONTRIBUTING.mdfor more details.AcknowledgementsThanks to Torsten Seemann, Ryan Wick and the Circlator team for their existing work in the space. Also toMichael Hall, whose repositorytbporewe took and adapted a lot of scaffolding code from because he writes really nice code.