Skip to content

4. Obtaining genomes

jaclew edited this page Nov 21, 2023 · 3 revisions

Obtaining Genome Sequences for FlexTaxD

The FlexTaxD tool requires genome sequences to format output for downstream applications, such as metagenomic read classification databases. Below you'll find instructions for gathering these sequences depending on the taxonomy source you have used to build your FlexTaxD database. These sequences must be collected and stored under a single folder, and can be obtained either manually or through FlexTaxD.

For NCBI Taxonomy Based Database

If you built your FlexTaxD database using NCBI taxonomy, you should already have the genome sequences from the previous steps detailed in the Creating a FlexTaxD database document. Make sure all genomes are downloaded and placed in a specified folder.

For GTDB Taxonomy Based Database

To download genome sequences when using a GTDB taxonomy based database, use the FlexTaxD command:

flextaxd-create --db gtdb.fdb --genomes_path genomes --download

If you need to use the smaller GTDB representative dataset, use the --rep_path argument with the command.

Automated Download of Missing Genomes

FlexTaxD can identify and download missing genomes from NCBI:

flextaxd-create --db francisellaceae.fdb --genomes_path genomes

Listing Missing Genome Accessions

To list missing genomes and save the accession numbers in a file for later use:

flextaxd-create --db francisellaceae.fdb --genomes_path genomes --keep
wc -l tmp/FlexTaxD.missing

This list can then be used to download sequences from other sources like NCBI datasets.

Manual Genome Addition

If you have genome sequences obtained from other sources or assembled locally, you can manually add them to the genomes folder. Be sure the file names match those expected by FlexTaxD:

  • NCBI format: GCA_123456789.fna.gz
  • Custom assembly: my_local_assembly_file.fasta

Example Using Multiple Strategies

In a scenario where a GTDB-based general database was created and some species require additional genomes for higher taxonomic resolution, follow these steps:

  1. Download GTDB representative genomes with FlexTaxD or manually:
# With FlexTaxD
flextaxd-create --db gtdb.fdb --genomes_path genomes --download

# Manually
wget https://data.gtdb.ecogenomic.org/releases/latest/genomic_files_reps/gtdb_genomes_reps.tar.gz
tar -zxf gtdb_genomes_reps*.tar.gz
mkdir genomes
find gtdb_genomes_reps* -name "*fna.gz" -exec mv {} genomes/ \;
  1. Purge the GTDB database of entries not part of the representative genomes dataset:
flextaxd --db gtdb.fdb --purge_database genomes --purge_database_force
  1. Download any remaining genomes:
flextaxd-create --db gtdb.fdb --genomes_path genomes

The tool will prompt you to download missing genomes from NCBI if there are any discrepancies.

By following these instructions, you should be able to compile a comprehensive set of genomes required for your FlexTaxD database to facilitate your downstream bioinformatics analyses.

Clone this wiki locally