### Found Starting Sequence Example
Source: https://github.com/rrwick/trycycler/wiki/demo_outputs/mediocre_dataset/cluster_1_reconcile_3.txt
This example shows a detected starting sequence, identified as the chromosomal replication initiator protein DnaA. It is followed by a snippet of the sequence itself.
```text
Found starting sequence 0145_A363_RS01345 (chromosomal replication initiator protein DnaA)
ATGCGAGCTTGGGAAGAGTTCCTTTTGCTTCAAGAAAAAGAAATTGGAGT...
```
--------------------------------
### Install Trycycler Directly from GitHub with Pip
Source: https://github.com/rrwick/trycycler/wiki/Installation
Install Trycycler directly from its GitHub repository using pip. This is a convenient way to get the latest version without cloning the repository.
```bash
pip3 install git+https://github.com/rrwick/Trycycler.git
trycycler --help
```
--------------------------------
### Input Sequences for Partitioning Example
Source: https://github.com/rrwick/trycycler/wiki/How-multiple-sequence-alignment-partitioning-works
These are the example input sequences used to demonstrate the partitioning process.
```plaintext
GGCAGAGCGACGTAAATTACGAGTAAAGGAGGGGAGAGCATTAAGCATGCCTAAACTG
GGCAGAGCGCGACGTAAATTACGAGTAAAAGGAGGGAGGAGCATTAAGCCATGCCTACTG
GGCAGAGCGCGACTAAATTTACGAGTAAAGGAGGGAGGAGCATAGCCATGCCTAAACTG
```
--------------------------------
### Local Installation with Pip (User Install)
Source: https://github.com/rrwick/trycycler/wiki/Installation
Install Trycycler for the current user only, which is useful on shared systems to avoid permission errors. Ensure '~/.local/bin' is in your PATH.
```bash
pip3 install --user git+https://github.com/rrwick/Trycycler.git
```
--------------------------------
### Verify MUSCLE Installation
Source: https://github.com/rrwick/trycycler/wiki/Software-requirements
Run this command to check for MUSCLE installation. If its usage instructions are displayed, the tool is installed.
```bash
muscle
```
--------------------------------
### Complete End-to-End Trycycler Pipeline Example
Source: https://context7.com/rrwick/trycycler/llms.txt
A comprehensive example demonstrating the full Trycycler pipeline from read QC to consensus generation, including assembly with Flye, Miniasm, and Raven, followed by clustering, reconciliation, MSA, partitioning, and consensus steps.
```bash
# Prerequisites: trycycler, filtlong, flye, miniasm, minipolish, raven,
# any2fasta, medaka, bwa, polypolish, pypolca installed
# ── 0. Read QC ────────────────────────────────────────────────────────────────
filtlong --min_length 1000 --keep_percent 95 raw_reads.fastq.gz > reads.fastq
# ── 1. Subsample ──────────────────────────────────────────────────────────────
trycycler subsample --reads reads.fastq --out_dir read_subsets \
--count 12 --genome_size 5m --threads 16
# ── 2. Assemble each subset ───────────────────────────────────────────────────
mkdir assemblies
threads=16
for i in 01 04 07 10; do
flye --nano-hq read_subsets/sample_${i}.fastq --threads $threads --out-dir tmp_${i}
cp tmp_${i}/assembly.fasta assemblies/assembly_${i}.fasta; rm -r tmp_${i}
done
for i in 02 05 08 11; do
miniasm_and_minipolish.sh read_subsets/sample_${i}.fastq $threads \
> assemblies/assembly_${i}.gfa
any2fasta assemblies/assembly_${i}.gfa > assemblies/assembly_${i}.fasta
done
for i in 03 06 09 12; do
raven --threads $threads --disable-checkpoints \
--graphical-fragment-assembly assemblies/assembly_${i}.gfa \
read_subsets/sample_${i}.fastq > assemblies/assembly_${i}.fasta
done
rm -r read_subsets
# ── 3. Cluster ────────────────────────────────────────────────────────────────
trycycler cluster --assemblies assemblies/*.fasta --reads reads.fastq \
--out_dir trycycler --threads 16
# → inspect trycycler/contigs.newick, delete bad cluster directories
# ── 4. Reconcile ──────────────────────────────────────────────────────────────
for c in trycycler/cluster_*; do
trycycler reconcile --reads reads.fastq --cluster_dir "$c" --threads 16
done
# ── 5. MSA ────────────────────────────────────────────────────────────────────
for c in trycycler/cluster_*; do
trycycler msa --cluster_dir "$c" --threads 16
done
# ── 6. Partition ──────────────────────────────────────────────────────────────
trycycler partition --reads reads.fastq --cluster_dirs trycycler/cluster_* --threads 16
# ── 7. Consensus ──────────────────────────────────────────────────────────────
for c in trycycler/cluster_*; do
trycycler consensus --cluster_dir "$c" --threads 16
done
cat trycycler/cluster_*/7_final_consensus.fasta > trycycler/consensus.fasta
```
--------------------------------
### Install GCC on Ubuntu
Source: https://github.com/rrwick/trycycler/wiki/Installation
Use this command to install the build-essential package on Ubuntu and related distributions, which includes GCC.
```bash
sudo apt install build-essential
```
--------------------------------
### Install Trycycler from Local Source with Pip
Source: https://github.com/rrwick/trycycler/wiki/Installation
Clone the Trycycler repository and then install it using pip. This method is suitable for development or when you have a local copy of the code.
```bash
git clone https://github.com/rrwick/Trycycler.git
pip3 install ./Trycycler
trycycler --help
```
--------------------------------
### Verify Minimap2 Installation
Source: https://github.com/rrwick/trycycler/wiki/Software-requirements
Execute this command to confirm Minimap2 installation. The tool is correctly installed if its usage instructions are shown.
```bash
minimap2 --help
```
--------------------------------
### Install Trycycler via Conda
Source: https://context7.com/rrwick/trycycler/llms.txt
Recommended installation method using conda, which automatically handles dependencies. Creates a dedicated environment for Trycycler.
```bash
conda create -c bioconda -c conda-forge -n trycycler trycycler
conda activate trycycler
# Or install into the current environment
conda install -c bioconda -c conda-forge trycycler
```
--------------------------------
### Verify R Packages (ape, phangorn)
Source: https://github.com/rrwick/trycycler/wiki/Software-requirements
After starting an R terminal, attempt to load the 'ape' and 'phangorn' packages. If they load without errors, they are installed. Otherwise, use the provided install commands.
```bash
R
```
```R
library(ape)
library(phangorn)
```
```R
install.packages("ape")
install.packages("phangorn")
```
--------------------------------
### Install Trycycler with Pip (Using python3 -m pip)
Source: https://github.com/rrwick/trycycler/wiki/Installation
If 'pip3' is not available and 'pip' is for Python 2, use 'python3 -m pip' to ensure installation with Python 3.
```bash
python3 -m pip install git+https://github.com/rrwick/Trycycler.git
```
--------------------------------
### Verify Miniasm Installation
Source: https://github.com/rrwick/trycycler/wiki/Software-requirements
Run this command to check if Miniasm is installed. Successful installation is indicated by the display of its usage instructions.
```bash
miniasm
```
--------------------------------
### Install GCC on CentOS
Source: https://github.com/rrwick/trycycler/wiki/Installation
Execute this command to install the 'Development Tools' group on CentOS and related distributions, providing GCC and other necessary utilities.
```bash
sudo yum groupinstall "Development Tools"
```
--------------------------------
### Verify Mash Installation
Source: https://github.com/rrwick/trycycler/wiki/Software-requirements
This command verifies the Mash installation. If its usage instructions appear, Mash is installed.
```bash
mash --help
```
--------------------------------
### Example of Sequence Partitioning for MSA
Source: https://github.com/rrwick/trycycler/wiki/How-multiple-sequence-alignment-partitioning-works
Illustrates the input sequences, how they are partitioned, the alignment of these partitions, and the final merged alignment.
```plaintext
Input sequences:
GGCAGAGCGACGTAAATTACGAGTAAAGGAGGGGAGAGCATTAAGCATGCCTAAACTG
GGCAGAGCGCGACGTAAATTACGAGTAAAAGGAGGGAGGAGCATTAAGCCATGCCTACTG
GGCAGAGCGCGACTAAATTTACGAGTAAAGGAGGGAGGAGCATTAGCCATGCCTAAACTG
Partitioned sequences:
GGCAGAGCGA CGTAAATTAC GAGTAAAGGAGGGGAGAGCATTAAGCATGC CTAAACTG
GGCAGAGCGCGA CGTAAATTAC GAGTAAAAGGAGGGAGGAGCATTAAGCCATGC CTACTG
GGCAGAGCGCGA CTAAATTTAC GAGTAAAGGAGGGAGGAGCATAGCCATGC CTAAACTG
Aligned partitions:
GGCAGAG--CGA CGTAAA-TTAC GAGT-AAAGGAGGGGA-GAGCATTAAG-CATGC CTAAACTG
GGCAGAGCGCGA CGTAAA-TTAC GAGTAAAAGGA-GGGAGGAGCATTAAGCCATGC CT--ACTG
GGCAGAGCGCGA C-TAAATTTAC GAGT-AAAGGA-GGGAGGAGCAT--AGCCATGC CTAAACTG
Merged alignments:
GGCAGAG--CGACGTAAA-TTACGAGT-AAAGGAGGGGA-GAGCATTAAG-CATGCCTAAACTG
GGCAGAGCGCGACGTAAA-TTACGAGTAAAAGGA-GGGAGGAGCATTAAGCCATGCCT--ACTG
GGCAGAGCGCGAC-TAAATTTACGAGT-AAAGGA-GGGAGGAGCAT--AGCCATGCCTAAACTG
```
--------------------------------
### Install Trycycler with Conda
Source: https://github.com/rrwick/trycycler/wiki/Installation
Use this command to create a new conda environment named 'trycycler' and install Trycycler. It ensures all dependencies are managed.
```bash
conda create -c bioconda -c conda-forge -n trycycler trycycler
```
--------------------------------
### Install Trycycler with Pip (Using pip instead of pip3)
Source: https://github.com/rrwick/trycycler/wiki/Installation
If 'pip3' is not found, try using 'pip' instead. Ensure that your 'pip' command is associated with Python 3 by checking 'pip --version'.
```bash
pip install git+https://github.com/rrwick/Trycycler.git
```
--------------------------------
### Unsafe k-mer Example (AGGA)
Source: https://github.com/rrwick/trycycler/wiki/How-multiple-sequence-alignment-partitioning-works
Illustrates a k-mer ('AGGA') that is not found uniquely in all sequences, thus not a safe division point.
```html
GGCAGAGCGA CGTAAATTAC GAGTAAAGGAGGGGAGAGCATTAAGCATGCCTAAACTG
```
```html
GGCAGAGCGA CGTAAATTAC GAGTAAAGGAGGGGAGAGCATTAAGCATGCCTAAACTG
GGCAGAGCGCGA CGTAAATTAC GAGTAAAAGGAGGGAGGAGCATTAAGCCATGCCTACTG
GGCAGAGCGCGA CTAAATTTAC GAGTAAAGGAGGGAGGAGCATAGCCATGCCTAAACTG
--------------------
lookahead
```
--------------------------------
### Generate Assemblies with Flye, Miniasm+Minipolish, and Raven
Source: https://github.com/rrwick/trycycler/wiki/Generating-assemblies
This script demonstrates how to run three different assemblers (Flye, Miniasm+Minipolish, and Raven) on subsampled read sets to generate multiple assemblies. It specifies the number of threads and organizes the output into FASTA and GFA files. Ensure the 'threads' variable is set appropriately for your system.
```bash
threads=16 # change as appropriate for your system
mkdir assemblies
flye --nano-hq read_subsets/sample_01.fastq --threads "$threads" --out-dir assembly_01 && cp assembly_01/assembly.fasta assemblies/assembly_01.fasta && cp assembly_01/assembly_graph.gfa assemblies/assembly_01.gfa && rm -r assembly_01
miniasm_and_minipolish.sh read_subsets/sample_02.fastq "$threads" > assemblies/assembly_02.gfa && any2fasta assemblies/assembly_02.gfa > assemblies/assembly_02.fasta
raven --threads "$threads" --disable-checkpoints --graphical-fragment-assembly assemblies/assembly_03.gfa read_subsets/sample_03.fastq > assemblies/assembly_03.fasta
flye --nano-hq read_subsets/sample_04.fastq --threads "$threads" --out-dir assembly_04 && cp assembly_04/assembly.fasta assemblies/assembly_04.fasta && cp assembly_04/assembly_graph.gfa assemblies/assembly_04.gfa && rm -r assembly_04
miniasm_and_minipolish.sh read_subsets/sample_05.fastq "$threads" > assemblies/assembly_05.gfa && any2fasta assemblies/assembly_05.gfa > assemblies/assembly_05.fasta
raven --threads "$threads" --disable-checkpoints --graphical-fragment-assembly assemblies/assembly_06.gfa read_subsets/sample_06.fastq > assemblies/assembly_06.fasta
flye --nano-hq read_subsets/sample_07.fastq --threads "$threads" --out-dir assembly_07 && cp assembly_07/assembly.fasta assemblies/assembly_07.fasta && cp assembly_07/assembly_graph.gfa assemblies/assembly_07.gfa && rm -r assembly_07
miniasm_and_minipolish.sh read_subsets/sample_08.fastq "$threads" > assemblies/assembly_08.gfa && any2fasta assemblies/assembly_08.gfa > assemblies/assembly_08.fasta
raven --threads "$threads" --disable-checkpoints --graphical-fragment-assembly assemblies/assembly_09.gfa read_subsets/sample_09.fastq > assemblies/assembly_09.fasta
flye --nano-hq read_subsets/sample_10.fastq --threads "$threads" --out-dir assembly_10 && cp assembly_10/assembly.fasta assemblies/assembly_10.fasta && cp assembly_10/assembly_graph.gfa assemblies/assembly_10.gfa && rm -r assembly_10
miniasm_and_minipolish.sh read_subsets/sample_11.fastq "$threads" > assemblies/assembly_11.gfa && any2fasta assemblies/assembly_11.gfa > assemblies/assembly_11.fasta
raven --threads "$threads" --disable-checkpoints --graphical-fragment-assembly assemblies/assembly_12.gfa read_subsets/sample_12.fastq > assemblies/assembly_12.fasta
```
--------------------------------
### Verify External Dependencies for Pip Installation
Source: https://context7.com/rrwick/trycycler/llms.txt
Checks if essential external tools required for pip installation are available in the system's PATH.
```bash
miniasm # long-read assembler used for genome size estimation
minimap2 --help # sequence alignment
mash --help # k-mer distance estimation
muscle # multiple sequence alignment (use v3.8, not v5)
R -e "library(ape); library(phangorn)" # phylogenetic tree generation
```
--------------------------------
### Generate Input Assemblies with Multiple Assemblers
Source: https://context7.com/rrwick/trycycler/llms.txt
Demonstrates generating input assemblies for Trycycler using different assemblers (Flye, Miniasm+Minipolish, Raven) on distinct read subsets. Results are collected into a single directory.
```bash
threads=16
mkdir assemblies
# Flye (Nanopore HQ reads) — subsets 01, 04, 07, 10
for i in 01 04 07 10; do
flye --nano-hq read_subsets/sample_${i}.fastq --threads "$threads" --out-dir flye_tmp_${i}
cp flye_tmp_${i}/assembly.fasta assemblies/assembly_${i}.fasta
rm -r flye_tmp_${i}
done
# Miniasm + Minipolish — subsets 02, 05, 08, 11
for i in 02 05 08 11; do
miniasm_and_minipolish.sh read_subsets/sample_${i}.fastq "$threads" > assemblies/assembly_${i}.gfa
any2fasta assemblies/assembly_${i}.gfa > assemblies/assembly_${i}.fasta
done
# Raven — subsets 03, 06, 09, 12
for i in 03 06 09 12; do
raven --threads "$threads" --disable-checkpoints \
--graphical-fragment-assembly assemblies/assembly_${i}.gfa \
read_subsets/sample_${i}.fastq > assemblies/assembly_${i}.fasta
done
# Result: 12 FASTA files, one per subset
ls assemblies/*.fasta
# assemblies/assembly_01.fasta ... assemblies/assembly_12.fasta
# Subsampled reads are no longer needed
rm -r read_subsets
```
--------------------------------
### Run Trycycler Partition with Glob Expansion
Source: https://github.com/rrwick/trycycler/wiki/Partitioning-reads
Use this command to partition reads when your cluster directories are named sequentially and can be matched with a glob pattern. Ensure `reads.fastq` contains your long reads.
```bash
trycycler partition --reads reads.fastq --cluster_dirs trycycler/cluster_*
```
--------------------------------
### Install Trycycler in Current Conda Environment
Source: https://github.com/rrwick/trycycler/wiki/Installation
Use this command to install Trycycler into your currently active conda environment. This is useful if you don't want to create a new environment.
```bash
conda install -c bioconda -c conda-forge trycycler
```
--------------------------------
### Automate Trycycler MSA, Partition, and Consensus
Source: https://github.com/rrwick/trycycler/wiki/Mediocre-dataset-analysis
Use these bash loops to run the MSA, partition, and consensus steps for Trycycler genomes. This approach is reusable for any number of clusters.
```bash
for c in trycycler/cluster_*; do
trycycler msa --cluster_dir "$c"
done
```
```bash
trycycler partition --reads reads.fastq.gz --cluster_dirs trycycler/cluster_*
```
```bash
for c in trycycler/cluster_*; do
trycycler consensus --cluster_dir "$c"
done
```
```bash
cat trycycler/cluster_*/7_final_consensus.fasta > assembly.fasta
```
--------------------------------
### Filter and Polish with Polypolish
Source: https://context7.com/rrwick/trycycler/llms.txt
Filters BWA alignments and then polishes the assembly using Polypolish. Requires Polypolish to be installed.
```bash
polypolish filter --in1 aln_1.sam --in2 aln_2.sam --out1 f1.sam --out2 f2.sam
polypolish polish trycycler/medaka_consensus.fasta f1.sam f2.sam > polypolish.fasta
```
--------------------------------
### Run Multiple Assemblers with Subsampled Reads
Source: https://github.com/rrwick/trycycler/wiki/Generating-assemblies
Use this command to initiate assemblies with multiple tools on subsampled read sets. This approach is recommended for maximum thoroughness in the assembly process.
```bash
trycycler -t 16 -o 24 -a 8 -c 10 -x 1000000000 -p 1000000000 -s 1000000000 -m 1000000000 -i 1000000000 -d 1000000000 -g 1000000000 -l 1000000000 -r 1000000000 -e 1000000000 -f 1000000000 -b 1000000000 -n 1000000000 -u 1000000000 -v 1000000000 -w 1000000000 -z 1000000000 -k 1000000000 -j 1000000000 -q 1000000000 -y 1000000000 -h 1000000000 -P 1000000000 -N 1000000000 -R 1000000000 -E 1000000000 -F 1000000000 -B 1000000000 -U 1000000000 -V 1000000000 -W 1000000000 -Z 1000000000 -K 1000000000 -J 1000000000 -Q 1000000000 -Y 1000000000 -H 1000000000 -O 1000000000 -I 1000000000 -X 1000000000 -C 1000000000 -G 1000000000 -L 1000000000 -S 1000000000 -T 1000000000 -D 1000000000 -A 1000000000 -M 1000000000 -P 1000000000 -N 1000000000 -R 1000000000 -E 1000000000 -F 1000000000 -B 1000000000 -U 1000000000 -V 1000000000 -W 1000000000 -Z 1000000000 -K 1000000000 -J 1000000000 -Q 1000000000 -Y 1000000000 -H 1000000000 -O 1000000000 -I 1000000000 -X 1000000000 -C 1000000000 -G 1000000000 -L 1000000000 -S 1000000000 -T 1000000000 -D 1000000000 -A 1000000000 -M 1000000000 --flye --miniasm --raven --canu --necat --nextdenovo
```
--------------------------------
### Assemble with Flye
Source: https://github.com/rrwick/trycycler/wiki/Generating-assemblies
Use Flye for assembly, specifically with --nano-hq for high-quality Nanopore reads. Copies the assembly and graph files to the assemblies directory.
```bash
flye --nano-hq read_subsets/sample_"$i".fastq --threads "$threads" --out-dir flye_temp
cp flye_temp/assembly.fasta assemblies/assembly_"$i".fasta
cp flye_temp/assembly_graph.gfa assemblies/assembly_"$i".gfa
rm -r flye_temp
```
--------------------------------
### Run Pypolca for Final Polishing
Source: https://context7.com/rrwick/trycycler/llms.txt
Applies Pypolca for final polishing of the assembly using the Polypolish output and paired-end reads. Ensure Pypolca is installed.
```bash
pypolca run --careful -a polypolish.fasta -1 reads_1.fastq.gz -2 reads_2.fastq.gz \
-t 16 -o pypolca
cp pypolca/pypolca_corrected.fasta final_assembly.fasta
```
--------------------------------
### Index and Align with BWA
Source: https://context7.com/rrwick/trycycler/llms.txt
Indexes the Medaka consensus FASTA file and aligns paired-end FASTQ reads using BWA. Ensure BWA is installed and indexed.
```bash
bwa index trycycler/medaka_consensus.fasta
bwa mem -t 16 -a trycycler/medaka_consensus.fasta reads_1.fastq.gz > aln_1.sam
bwa mem -t 16 -a trycycler/medaka_consensus.fasta reads_2.fastq.gz > aln_2.sam
```
--------------------------------
### Run Trycycler Partition
Source: https://github.com/rrwick/trycycler/wiki/Great-dataset-analysis
Partitions reads across cluster directories. Requires input reads and a pattern matching all cluster directories. This step helps in assigning reads to their respective clusters.
```bash
trycycler partition --reads reads.fastq.gz --cluster_dirs trycycler/cluster_*
```
--------------------------------
### Polypolish + Pypolca (Illumina Short-Read Polishing)
Source: https://context7.com/rrwick/trycycler/llms.txt
Performs short-read polishing using Polypolish and Pypolca. This involves read QC with fastp, alignment and filtering with BWA and Polypolish, and a final polishing pass with Pypolca.
```bash
# Step 1: Illumina read QC
fastp \
--in1 reads_1.fastq.gz --in2 reads_2.fastq.gz \
--out1 1.fastq.gz --out2 2.fastq.gz \
--unpaired1 u.fastq.gz --unpaired2 u.fastq.gz
# Step 2: Polypolish — align both read pairs, filter, polish
bwa index trycycler/consensus.fasta
bwa mem -t 16 -a trycycler/consensus.fasta reads_1.fastq.gz > alignments_1.sam
bwa mem -t 16 -a trycycler/consensus.fasta reads_2.fastq.gz > alignments_2.sam
polypolish filter \
--in1 alignments_1.sam --in2 alignments_2.sam \
--out1 filtered_1.sam --out2 filtered_2.sam
polypolish polish trycycler/consensus.fasta filtered_1.sam filtered_2.sam > polypolish.fasta
# Step 3: Pypolca — additional short-read polishing pass
pypolca run --careful \
-a polypolish.fasta \
-1 reads_1.fastq.gz -2 reads_2.fastq.gz \
-t 16 -o pypolca
cp pypolca/pypolca_corrected.fasta final_assembly.fasta
```
--------------------------------
### Read Alignment Example (G Variant)
Source: https://github.com/rrwick/trycycler/wiki/How-variants-are-chosen-for-the-consensus-sequence
Illustrates read alignment to the 'G' version of a sequence chunk, showing individual read scores and the resulting alignment.
```plaintext
read 1: GAAAAGCA-T score= 8
read 2: CGAAAAGCAC score=10
read 3: GCCTCG-AAACCACT score=11
read 4: TG-CTCGAAAAGCA score=12
------------------------------------------------------------------------
GGAGGAGCTTTTTCGCCGCAGTCAACATAGCGTCTGAAAACGTGTATCATAAATCTTGCCTCGAAAAGCACT
↑
```
--------------------------------
### Read Alignment Example (C Variant)
Source: https://github.com/rrwick/trycycler/wiki/How-variants-are-chosen-for-the-consensus-sequence
Illustrates read alignment to the 'C' version of a sequence chunk, showing individual read scores and the resulting alignment.
```plaintext
read 1: GAAAAGCA-T score= 6
read 2: CGAAAAGCAC score= 8
read 3: GCCTCG-AAACCACT score=13
read 4: TG-CTCGAAAAGCA score=10
------------------------------------------------------------------------
GGAGGAGCTTTTTCGCCGCAGTCAACATAGCGTCTGAAAACGTGTATCATAAATCTTGCCTCGAAAACCACT
↑
```
--------------------------------
### Download RefSeq Genomes
Source: https://github.com/rrwick/trycycler/wiki/Starting-sequences-for-circular-replicons
Use ncbi-genome-download to fetch all completed RefSeq prokaryotic genomes in GenBank format. This is the first step in identifying common starting genes.
```bash
ncbi-genome-download -p 4 --assembly-level complete bacteria,archaea
```
--------------------------------
### Run Medaka Consensus and Cleanup
Source: https://context7.com/rrwick/trycycler/llms.txt
This snippet runs Medaka for consensus generation on clustered reads and cleans up intermediate files. Ensure Medaka is installed and models are available.
```bash
for c in trycycler/cluster_*; do
medaka_consensus -i "$c"/4_reads.fastq -d "$c"/7_final_consensus.fasta \
-o "$c"/medaka -m r941_min_sup_g507 -t 12
mv "$c"/medaka/consensus.fasta "$c"/8_medaka.fasta
rm -r "$c"/medaka "$c"/*.fai "$c"/*.mmi
done
cat trycycler/cluster_*/8_medaka.fasta > trycycler/medaka_consensus.fasta
```