Hysen Labs
Open-source project
stajichlab/AAFTF avatar
stajichlab

AAFTF

Automatic Assembly For The Fungi

27 stars6 forksPythonMIT
DEEP OPEN-SOURCE ANALYSIS

AAFTF assembles and cleans fungal genome sequences

A Python pipeline that trims reads, builds mitochondrial and nuclear assemblies, screens contaminants, polishes contigs, and reports assembly completeness for fungal genomes.

What the pipeline does

AAFTF stands for Automatic Assembly For The Fungi, and the README describes it as a genome assembly pipeline written largely in Python. The authors listed are Jason Stajich and Jon Palmer, and the README notes the project is partly a Python rewrite of an earlier shell-based tool called JAAWS. The pipeline is organized as a set of subcommands that the user runs in sequence or through a single pipeline command. The steps begin with trimming FASTQ input reads, then de novo assembly of the mitochondrial genome, then filtering of contaminating reads. Nuclear assembly follows using SPAdes, megahit, or dipspades. Vector and contaminant screening of assembled contigs uses a BlastN based method meant to replicate NCBI screening. Contigs are then purged based on sourmash results or on NCBI fcs-gx output, duplicate contigs are removed using minimap2, and the contigs are polished with POLCA, Pilon, or NextPolish. The final steps sort contigs by length, assess assembly completeness, and calculate read depth of coverage. A single pipeline subcommand runs the whole flow at once. The README presents the tool as aimed at fungal genomes but built from general read aligners, assemblers, and screening tools, so the individual stages apply to a broad range of assembly cleanup work. Because each stage is a separate subcommand, a user can run only the parts they need, for example just trimming and filtering, or just the depth calculation, without invoking the full pipeline, which keeps the tool flexible for non-fungal data as well.

Tools and dependencies

The README lists the external tools AAFTF wraps rather than reimplements. For read alignment during polishing and depth calculation it expects bwa, minimap2, and optionally bowtie2, plus BBTools. Quality control and trimming use BBTools and fastp, with Trimmomatic noted as an optional alternative. Assemblers include SPAdes, megahit, dipspades, NOVOPlasty for mitochondrial assembly, and unicycler. Contamination screening relies on sourmash, NCBI BLAST plus, ncbi-fcs, and ncbi-fcs-gx. Polishing uses POLCA from MaSuRCA, Pilon, and NextPolish. The README warns about a samtools version mismatch: some dependencies expect an old samtools while AAFTF prefers samtools 1.0 or newer, and it offers a patch for the POLCA script's sort step. Installation is shown as creating a conda environment with the bioconda channel and then installing the package from PyPI or directly from GitHub with pip. The sourmash database location is set through an environment variable, and running ncbi-fcs-gx through singularity requires that tool to be present, with the fcs-gx database needing large memory or an SSD. The documentation also points readers to detailed usage output for each subcommand, including the trim, assemble, vecscreen, and depth steps. The README also lists the citation for the project as Palmer and Stajich 2023, Automatic assembly for the fungi, with a Zenodo DOI, and it points contributors to a CONTRIBUTING style note, so the pipeline is presented as a citable scientific tool as well as a command line utility. The notes section adds that the project is partly a Python rewrite of an earlier shell based cleanup tool written by one of the authors.

Depth and assessment output

The depth subtool, also callable as coverage or cov, maps reads back to the final assembly and computes per-contig depth statistics using mosdepth, requiring samtools and mosdepth plus minimap2 or bwa. The README shows it accepts Illumina reads and can add long reads alongside or instead. The report it writes, coverage_stats.txt by default, has three sections. The first is a read input summary with per-file read counts and samtools flagstat alignment rates. The second is whole-assembly coverage with two mean depth estimates: a mosdepth global figure that is length-weighted, and a per-contig arithmetic mean, plus the percentage of bases covered at one times or more. The third is a per-contig depth table sorted by depth in descending order, and each contig is flagged when its mean depth is far above the assembly mean. A contig with mean depth above the assembly mean plus three standard deviations is marked as an outlier, likely a contaminant or organelle, while a contig between two and three standard deviations above is marked as elevated and worth inspecting. When matplotlib is available the tool also produces three coverage plots next to the report. The README presents these flags as a way to spot contamination or organelle sequences that survived the earlier purge steps, closing the loop on assembly quality.

Editorial conclusion

AAFTF is made available under the MIT license, and the repository's most recent commit was on 2026-08-26. The code is hosted at github.com/stajichlab/AAFTF.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes