### Run Autocycler and List Installed Tools Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Dockerfile_by_Ryan_Wick/README.md Runs the Autocycler container and prints a list of successfully installed tools. This is a basic execution command. ```bash docker run --rm autocycler ``` -------------------------------- ### Example Autocycler Decompress Command Source: https://github.com/rrwick/autocycler/wiki/Autocycler-decompress This command demonstrates a basic usage of autocycler decompress, specifying the input GFA file and the output directory for the decompressed sequences. ```bash autocycler decompress -i autocycler_out/input_assemblies.gfa -o assemblies ``` -------------------------------- ### Generate TSV Header and Append Sample Metrics Source: https://github.com/rrwick/autocycler/wiki/Autocycler-table This example demonstrates how to create a TSV header and then append metric rows for each sample directory. Ensure the glob pattern accurately captures your sample directories. ```bash autocycler table > metrics.tsv # create the TSV header for sample in SAM*; do autocycler table -a "$sample" -n "$sample" >> metrics.tsv # append a TSV row done ``` -------------------------------- ### Autocycler Pairwise Distance Matrix Example Source: https://github.com/rrwick/autocycler/wiki/Autocycler-cluster Illustrates the asymmetric pairwise distance matrix output by Autocycler, highlighting differences in distance calculation based on contig containment. ```text 3 assembly_01.fasta contig_a (1044289 bp) 0.00000000 0.00052292 0.31332140 assembly_02.fasta contig_b (1044294 bp) 0.00052388 0.00000000 0.31329124 assembly_03.fasta contig_c (713618 bp) 0.00047100 0.00042614 0.00000000 ``` -------------------------------- ### Run autoautocycler with specified assemblers and parameters Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Auto-Autocycler_by_Tom_Stanton/README.md Example of running autoautocycler to assemble reads using 'flye', 'miniasm', and 'raven' assemblers. This command specifies the output directory, subsampling count, genome size, and the assemblers to use, followed by the input read files. ```sh ./autoautocycler.sh -o autocycler -c 2 -s 5500000 -a "flye miniasm raven" reads/*.fastq.gz ``` -------------------------------- ### Run Autocycler Interactively with Mounted Data Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Dockerfile_by_Ryan_Wick/README.md Starts an interactive session within the Autocycler container, mounting a local directory to the container's /data path. Useful for processing local data. ```bash docker run --rm -it -v /path/to/data:/data autocycler bash ``` -------------------------------- ### Running Assemblers with Conda Environments Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Automated_Autocycler_Bash_script_by_Ryan_Wick/README.md This snippet demonstrates how to activate specific conda environments before running an assembler and deactivate them afterward. This is useful when assemblers are installed in separate environments. ```bash for i in 01 02 03 04; do conda activate canu autocycler helper canu --reads subsampled_reads/sample_"$i".fastq --out_prefix assemblies/canu_"$i" --threads "$threads" --genome_size "$genome_size" conda deactivate conda activate flye autocycler helper flye --reads subsampled_reads/sample_"$i".fastq --out_prefix assemblies/flye_"$i" --threads "$threads" --genome_size "$genome_size" conda deactivate # and so on... done ``` -------------------------------- ### Run Autocycler Assembly Workflow Source: https://github.com/rrwick/autocycler/wiki/Demo-dataset This script demonstrates the full Autocycler workflow for assembling a demo dataset. It includes subsampling reads, running multiple assemblers, compressing results, clustering, trimming, resolving, and combining final assemblies. ```bash threads="16" genome_size="242000" autocycler subsample --reads reads.fastq.gz --out_dir subsampled_reads --genome_size "$genome_size" mkdir assemblies for assembler in flye miniasm raven; do for i in 01 02 03 04; do autocycler helper "$assembler" --reads subsampled_reads/sample_"$i".fastq --out_prefix assemblies/"$assembler"_"$i" --threads "$threads" --genome_size "$genome_size" done done rm subsampled_reads/*.fastq autocycler compress -i assemblies -a autocycler_out autocycler cluster -a autocycler_out for c in autocycler_out/clustering/qc_pass/cluster_*; do autocycler trim -c "$c" autocycler resolve -c "$c" done autocycler combine -a autocycler_out -i autocycler_out/clustering/qc_pass/cluster_*/5_final.gfa ``` -------------------------------- ### Display autoautocycler help message Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Auto-Autocycler_by_Tom_Stanton/README.md Run the script with -h or --help to see all available options and their default values. ```sh Usage: autoautocycler [ ...] [options] Long reads to assemble in fastq(.gz) format -o, --out Output directory (default: .) -t, --threads #threads to use (default: all available) -c, --count #subsampled read sets to output (default: 4) -k, --kmer K-mer size for De Bruijn graph (default: 51) -s, --size Genome size (default: AUTO) -a, --assemblers Assemblers to use (default: all available) Possible assemblers: canu flye lja metamdbg miniasm necat nextdenovo raven redbean Note: this argument MUST BE WRAPPED in quotes ``` -------------------------------- ### Remove multiple tigs with spaces in input Source: https://github.com/rrwick/autocycler/wiki/Autocycler-clean This example shows how to remove multiple tigs by enclosing the comma-separated list in quotes, allowing for spaces. This is useful for copy-pasting from tools like Bandage. ```bash -r "7, 8" ``` -------------------------------- ### Build Autocycler from Source Source: https://github.com/rrwick/autocycler/wiki/Software-requirements-and-installation Clone the Autocycler repository, navigate into the directory, and build the release version using Cargo. The executable will be located in `target/release/autocycler`. ```bash git clone https://github.com/rrwick/Autocycler.git cd Autocycler cargo build --release ``` -------------------------------- ### Parallel Assembly with GNU Parallel Source: https://github.com/rrwick/autocycler/wiki/Parallelising-input-assemblies Use this script to set up and run multiple Autocycler assemblies concurrently using GNU Parallel. Adjust 'jobs' and 'threads' based on system resources. Ensure 'reads' points to your input FASTQ file. ```bash reads=ont.fastq.gz # your read set goes here threads=16 # set as appropriate for your system (no more than 128) jobs=4 # set as appropriate for your system genome_size=$(autocycler helper genome_size --reads "$reads" --threads "$threads") # can set this manually if you know the value mkdir -p assemblies rm -f assemblies/jobs.txt for assembler in canu flye metamdbg miniasm necat nextdenovo plassembler raven; do for i in 01 02 03 04; do echo "autocycler helper $assembler --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/${assembler}_$i --threads $threads --genome_size $genome_size" >> assemblies/jobs.txt done done nice -n 19 parallel --jobs "$jobs" --joblog assemblies/joblog.tsv --results assemblies/logs < assemblies/jobs.txt ``` -------------------------------- ### Basic Autocycler Slurm Script Usage Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Slurm_Autocycler_Bash_script_by_Michael_Hall/README.md Performs long-read assembly using Autocycler on a Slurm cluster. This is a basic example specifying output directory, threads, minimum read length, and the input FASTQ file. ```bash ./autocycler_slurm.sh -o output_directory -t 16 -l 1000 reads.fastq ``` -------------------------------- ### Activate Conda Environment in SLURM Job Source: https://github.com/rrwick/autocycler/wiki/Parallelising-input-assemblies This example shows how to activate a Conda environment before running an Autocycler assembly command within a SLURM job. This is useful when the required tools are not available in the default system PATH. ```bash sbatch --job-name=canu_"$i" --time=12:00:00 --ntasks=1 --mem=128000 --cpus-per-task=16 --wrap "conda activate autocycler && autocycler helper canu --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/canu_$i --threads $threads --genome_size $genome_size" ``` -------------------------------- ### Build the Autocycler Docker Image Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Dockerfile_by_Ryan_Wick/README.md Builds the Docker image for Autocycler from the current directory. Use this command to create the container image. ```bash docker build -t autocycler . ``` -------------------------------- ### Create Conda Environment Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Slurm_Autocycler_Bash_script_by_Michael_Hall/README.md Creates a conda environment with all required software dependencies listed in the environment.yaml file. ```bash conda env create -f environment.yaml ``` -------------------------------- ### Autocycler Compress Full Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-compress Displays the full usage and available options for the autocycler compress command, including required directories and optional parameters like k-mer size and thread count. ```bash Usage: autocycler compress [OPTIONS] --assemblies_dir --autocycler_dir Options: -i, --assemblies_dir Directory containing input assemblies (required) -a, --autocycler_dir Autocycler directory to be created (required) --kmer K-mer size for De Bruijn graph [default: 51] --max_contigs refuse to run if mean contigs per assembly exceeds this value [default: 25] -t, --threads Number of CPU threads [default: 8] -h, --help Print help -V, --version Print version ``` -------------------------------- ### Autocycler gfa2fasta Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-gfa2fasta Displays the full usage instructions and available options for the autocycler gfa2fasta command. ```bash Usage: autocycler gfa2fasta --in_gfa --out_fasta Options: -i, --in_gfa Input Autocycler GFA file (required) -o, --out_fasta Output FASTA file (required) -h, --help Print help -V, --version Print version ``` -------------------------------- ### Basic Autocycler Compress Command Source: https://github.com/rrwick/autocycler/wiki/Autocycler-compress This command compresses input assemblies into a compacted De Bruijn graph. It requires an input directory containing FASTA files and an output directory for the autocycler files. ```bash autocycler compress -i assemblies -a autocycler_out ``` -------------------------------- ### Autocycler Dotplot Full Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-dotplot This displays the full command-line usage for the autocycler dotplot tool, including all available options and their descriptions. It is useful for understanding all configurable parameters. ```bash Usage: autocycler dotplot [OPTIONS] --input --out_png Options: -i, --input Input Autocycler GFA file, FASTA file or directory (required) -o, --out_png File path where dotplot PNG will be saved (required) --res Size (in pixels) of dotplot image [default: 2000] --kmer K-mer size to use in dotplot [default: 32] -h, --help Print help -V, --version Print version ``` -------------------------------- ### Basic Autocycler Subsample Command Source: https://github.com/rrwick/autocycler/wiki/Autocycler-subsample This command creates a directory containing subsampled read files from a specified input read set. It requires the input FASTQ file, an output directory, and an estimated genome size. ```bash autocycler subsample --reads ont.fastq.gz --out_dir subsampled_reads --genome_size 5.5m ``` -------------------------------- ### Subsample Reads and Generate Input Assemblies Source: https://github.com/rrwick/autocycler/wiki/Manually-curated-assembly This script prepares reads for assembly and then generates initial assemblies using various assemblers. It includes steps for setting parameters like reads, threads, and genome size, and optionally removes subsampled reads to save space. ```bash reads=ont.fastq.gz # your read set goes here threads=16 # set as appropriate for your system (no more than 128) genome_size=$(autocycler helper genome_size --reads "$reads" --threads "$threads") # can set this manually if you know the value autocycler subsample --reads "$reads" --out_dir subsampled_reads --genome_size "$genome_size" mkdir assemblies for assembler in canu flye metamdbg miniasm necat nextdenovo plassembler raven; do for i in 01 02 03 04; do autocycler helper "$assembler" --reads subsampled_reads/sample_"$i".fastq --out_prefix assemblies/"$assembler"_"$i" --threads "$threads" --genome_size "$genome_size" done done # Optional step: remove the subsampled reads to save space rm subsampled_reads/*.fastq ``` -------------------------------- ### Convert GFA to FASTA Source: https://github.com/rrwick/autocycler/wiki/Autocycler-gfa2fasta Run the autocycler gfa2fasta command with input GFA and output FASTA file paths. ```bash autocycler gfa2fasta -i autocycler.gfa -o autocycler.fasta ``` -------------------------------- ### Autocycler Cluster Full Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-cluster Displays the full command-line usage and available options for the 'autocycler cluster' command. This includes parameters for setting clustering cutoffs, minimum assembly counts, maximum contigs, and manual cluster definition. ```bash Usage: autocycler cluster [OPTIONS] --autocycler_dir Options: -a, --autocycler_dir Autocycler directory containing input_assemblies.gfa file (required) --cutoff cutoff distance threshold for hierarchical clustering [default: 0.2] --min_assemblies exclude clusters with fewer than this many assemblies [default: automatic] --max_contigs refuse to run if mean contigs per assembly exceeds this value [default: 25] --manual manually define clusters using tree node numbers [default: automatic] -h, --help Print help -V, --version Print version ``` -------------------------------- ### Compress and Cluster Input Assemblies Source: https://github.com/rrwick/autocycler/wiki/Manually-curated-assembly Compresses input assemblies and then clusters them using Autocycler. This step prepares the assemblies for further processing and consensus generation. ```bash autocycler compress -i assemblies -a autocycler_out autocycler cluster -a autocycler_out ``` -------------------------------- ### Basic Autocycler Cluster Command Source: https://github.com/rrwick/autocycler/wiki/Autocycler-cluster This command initiates the clustering process for input assemblies. It requires a directory previously created by 'Autocycler compress' and outputs clustering results into a subdirectory. ```bash autocycler cluster -a autocycler_out ``` -------------------------------- ### Run Assemblers with Autocycler Helper Source: https://github.com/rrwick/autocycler/wiki/Autocycler-helper Invoke different assemblers like Canu, Flye, or Raven using the autocycler helper. Specify input reads, output prefix, threads, and genome size. ```bash autocycler helper canu --reads subsampled_reads/sample_01.fastq --out_prefix canu_01 --threads 16 --genome_size 5.5m autocycler helper flye --reads subsampled_reads/sample_01.fastq --out_prefix flye_01 --threads 16 --genome_size 5.5m autocycler helper raven --reads subsampled_reads/sample_01.fastq --out_prefix raven_01 --threads 16 --genome_size 5.5m ``` -------------------------------- ### Autocycler Resolve Full Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-resolve Displays the full command-line usage for the 'autocycler resolve' command, including required options and available flags. ```bash Usage: autocycler resolve [OPTIONS] --cluster_dir Options: -c, --cluster_dir Autocycler directory (required) --verbose Enable verbose output -h, --help Print help -V, --version Print version ``` -------------------------------- ### Loop Through Assemblers with Autocycler Helper Source: https://github.com/rrwick/autocycler/wiki/Autocycler-helper Automate the process of running multiple assemblers by using a Bash loop with the autocycler helper. This is useful for comparing different assembly results. ```bash for assembler in canu flye metamdbg miniasm necat nextdenovo plassembler raven; do autocycler helper "$assembler" --reads subsampled_reads/sample_01.fastq --out_prefix "$assembler"_01 --threads 16 --genome_size 5.5m done ``` -------------------------------- ### Autocycler Combine Full Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-combine Displays the full usage and available options for the autocycler combine command. Requires specifying the Autocycler directory and input cluster GFA files. ```bash Usage: autocycler combine --autocycler_dir --in_gfas ... Options: -a, --autocycler_dir Autocycler directory (required) -i, --in_gfas ... Autocycler cluster GFA files (one or more required) -h, --help Print help -V, --version Print version ``` -------------------------------- ### Autocycler Trim Full Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-trim Displays the full usage information for the 'autocycler trim' command, including all available options and their default values. The '--cluster_dir' option is required. ```bash Usage: autocycler trim [OPTIONS] --cluster_dir Options: -c, --cluster_dir Autocycler cluster directory containing 1_untrimmed.gfa file (required) --min_identity Minimum alignment identity for trimming alignments [default: 0.75] --max_unitigs Maximum unitigs used for overlap alignment, set to 0 to disable trimming [default: 5000] --mad Allowed variability in cluster length, measured in median absolute deviations, set to 0 to disable exclusion of length outliers [default: 5.0] -t, --threads Number of CPU threads [default: 8] -h, --help Print help -V, --version Print version ``` -------------------------------- ### Run Autocycler Full Pipeline Source: https://github.com/rrwick/autocycler/wiki/Very-quick-start Execute the complete Autocycler pipeline using a Bash script. Provide the input long-read file, number of threads, and number of parallel jobs. ```bash autocycler_full.sh reads.fastq.gz 16 4 ``` -------------------------------- ### Run Autocycler Resolve on Clusters Source: https://github.com/rrwick/autocycler/wiki/Autocycler-resolve This Bash loop iterates through cluster directories and runs the 'autocycler resolve' command on each. Ensure each cluster directory contains a '2_trimmed.gfa' file. ```bash for c in autocycler_out/clustering/qc_pass/cluster_*; do autocycler resolve -c "$c" done ``` -------------------------------- ### Generate Input Assemblies with Autocycler Helper Source: https://github.com/rrwick/autocycler/wiki/Generating-input-assemblies This script iterates through multiple assemblers and subsampled read sets to generate alternative genome assemblies. It first determines the genome size and then calls `autocycler helper` for each assembler-sample combination. Ensure reads are long enough for complete assemblies. ```bash threads=16 # set as appropriate for your system (no more than 128) genome_size=$(autocycler helper genome_size --reads "$reads" --threads "$threads") # can set this manually if you know the value mkdir assemblies for assembler in canu flye metamdbg miniasm necat nextdenovo plassembler raven; do for i in 01 02 03 04; autocycler helper "$assembler" --reads subsampled_reads/sample_"$i".fastq --out_prefix assemblies/"$assembler"_"$i" --threads "$threads" --genome_size "$genome_size" done done ``` -------------------------------- ### Submit SLURM Jobs for Multiple Assemblers Source: https://github.com/rrwick/autocycler/wiki/Parallelising-input-assemblies This script automates the submission of assembly jobs to a SLURM cluster. It iterates through samples and launches individual SLURM jobs for Canu, Flye, Miniasm, NECA T, NextDenovo, and Raven assemblers, allowing for distinct resource configurations for each. ```bash genome_size=$(autocycler helper genome_size --reads "$reads" --threads "$threads") # can set this manually if you know the value mkdir -p assemblies for i in 01 02 03 04; do sbatch --job-name=canu_"$i" --time=12:00:00 --mem=128000 --ntasks=1 --cpus-per-task=16 --wrap "autocycler helper canu --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/canu_$i --threads $threads --genome_size $genome_size" sbatch --job-name=flye_"$i" --time=2:00:00 --mem=64000 --ntasks=1 --cpus-per-task=16 --wrap "autocycler helper flye --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/flye_$i --threads $threads --genome_size $genome_size" sbatch --job-name=miniasm_"$i" --time=1:00:00 --mem=64000 --ntasks=1 --cpus-per-task=16 --wrap "autocycler helper miniasm --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/miniasm_$i --threads $threads --genome_size $genome_size" sbatch --job-name=necat_"$i" --time=2:00:00 --mem=64000 --ntasks=1 --cpus-per-task=16 --wrap "autocycler helper necat --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/necat_$i --threads $threads --genome_size $genome_size" sbatch --job-name=nextdenovo_"$i" --time=2:00:00 --mem=64000 --ntasks=1 --cpus-per-task=16 --wrap "autocycler helper nextdenovo --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/nextdenovo_$i --threads $threads --genome_size $genome_size" sbatch --job-name=raven_"$i" --time=1:00:00 --mem=64000 --ntasks=1 --cpus-per-task=16 --wrap "autocycler helper raven --reads subsampled_reads/sample_$i.fastq --out_prefix assemblies/raven_$i --threads $threads --genome_size $genome_size" done ``` -------------------------------- ### Generate Dotplots for Untrimmed and Trimmed Cluster Sequences Source: https://github.com/rrwick/autocycler/wiki/Autocycler-dotplot Use these commands to generate dotplots for sequences within an Autocycler cluster, comparing the state before and after trimming. This helps verify the effectiveness of the trimming process. ```bash autocycler dotplot -i qc_pass/cluster_002/1_untrimmed.gfa -o qc_pass/cluster_002/1_untrimmed.png ``` ```bash autocycler dotplot -i qc_pass/cluster_002/2_trimmed.gfa -o qc_pass/cluster_002/2_trimmed.png ``` -------------------------------- ### Autocycler Subsample Full Usage Source: https://github.com/rrwick/autocycler/wiki/Autocycler-subsample This displays the full usage and available options for the autocycler subsample command. Key options include specifying input reads, output directory, genome size, the number of subsampled sets, and minimum read depth. ```bash Usage: autocycler subsample [OPTIONS] --reads --out_dir --genome_size Options: -r, --reads Input long reads in FASTQ format (required) -o, --out_dir Output directory (required) -g, --genome_size Estimated genome size (required) -c, --count Number of subsampled read sets to output [default: 4] -d, --min_read_depth Minimum allowed read depth [default: 25.0] -s, --seed Seed for random number generator [default: 0] -h, --help Print help -V, --version Print version ``` -------------------------------- ### Looping Through Clusters for Trimming Source: https://github.com/rrwick/autocycler/wiki/Autocycler-trim This Bash loop iterates through each cluster directory in 'autocycler_out/clustering/qc_pass/' and runs the 'autocycler trim' command on it. Ensure that each cluster directory contains a '1_untrimmed.gfa' file. ```bash for c in autocycler_out/clustering/qc_pass/cluster_*; do autocycler trim -c "$c" done ``` -------------------------------- ### Autocycler Slurm Script Help Message Source: https://github.com/rrwick/autocycler/blob/main/pipelines/Slurm_Autocycler_Bash_script_by_Michael_Hall/README.md Displays the help message for the autocycler_slurm.sh script, outlining all available arguments and options. ```bash Usage: autocycler_slurm.sh [options] This script performs long-read assembly using Autocycler on a Slurm cluster. In particular, it submits each assembly job to the cluster scheduler, thus enabling parallel execution of multiple assemblers and subsamples. Required: Input FASTQ file for long-read assembly General options: -o, --outdir Output directory [default: current directory] -t, --threads Threads per assembly job [default: 8] -r, --read-type Read type: ont_r9 | ont_r10 | pacbio_clr | pacbio_hifi [default: ont_r10] -k, --keep-intermediate Keep subsampled and filtered FASTQ files after assembly -w, --overwrite Delete output directory if it exists (use with caution!) -c, --count Number of subsamples to create [default: 4] -T, --max-time Slurm time limit per job [default: 8h] -M, --max-mem Slurm memory per job [default: 32g] -R, --resume-after-assembly Resume pipeline after assembly step (skip read filtering, subsampling, and assembly) Assembler selection: -A, --assemblers Comma-separated list of assemblers to use (overrides default) --include-assemblers Comma-separated list to add to default/specified list --exclude-assemblers Comma-separated list to remove from default/specified list -L, --list-assemblers List the default assemblers and exit Read filtering with filtlong: -l, --min-length Filter out reads shorter than this length -b, --target-bases Keep top reads until total base count is reached -p, --keep-percent Keep best X% of reads (e.g. 90) Help: -h, --help Show this help message and exit ```