Introduction

nf-core/genephylo is a bioinformatics pipeline that retrieves the orthologs of one or more genes of interest across species and builds codon-aware alignments and phylogenetic trees for them. Starting from one seed sequence per gene, it searches a BLAST database for homologs, assigns them to species, extracts their coding sequences, and uses gene/species tree reconciliation to isolate the orthogroup of each gene. Its outputs are designed as inputs for evolutionary analyses, such as those run by nf-core/genephylomodeler.

  1. Prepare a BLAST database: download one from NCBI, build one from your own sequences, or use an existing one (BLAST+)
  2. Search for homologs of each seed gene (blastn or tblastn) and retrieve their sequences (BLAST+), removing duplicates (SeqKit)
  3. Assign species from the NCBI taxonomy and rename sequences as SPECIES|GENE|ACCESSION (ETE 3)
  4. Extract the coding sequence, keeping the longest ORF per sequence (TD2)
  5. Initial alignment (MAFFT) and fast gene tree (FastTree)
  6. Reconcile the gene tree with the species tree (Treerecs) and select the orthogroup of each seed gene
  7. Final alignment of the orthogroup (MAFFT), refined codon by codon (MACSE)
  8. Final maximum-likelihood tree (IQ-TREE)

Usage

Note

If you are new to Nextflow and nf-core, please refer to this page on how to set-up Nextflow. Make sure to test your setup with -profile test before running the workflow on actual data.

First, prepare a samplesheet with one row per gene of interest:

samplesheet.csv:

id,fastafile
TSTG1,TSTG1_nt.fasta
TSTG2,TSTG2_nt.fasta

Each row represents one gene (not a sample). id is the gene name, used to name all output files. fastafile contains a single seed sequence for that gene: a nucleotide CDS with --blast_type nt, or a protein sequence with --blast_type aa.

You also need a species tree in Newick format (.nwk) whose leaf names are species codes (first 3 letters of the genus + first 3 letters of the species, e.g. HOMSAP for Homo sapiens; for three-part names, 3 + 2 + 1 letters, e.g. CANLUF for Canis lupus familiaris).

Now, you can run the pipeline using:

nextflow run nf-core/genephylo \
-profile <docker/singularity/.../institute> \
--input samplesheet.csv \
--blastdb_option build \
--blastdb_build sequences.fasta \
--blastdb_buildmap taxid_map.txt \
--species_tree species_tree.nwk \
--outdir <OUTDIR>

--blastdb_option selects how the BLAST database is provided: build (from your own sequences, as above), update (download a pre-formatted NCBI database, set with --blastdb_update) or current (an existing database, given with --blastdb_dir).

--taxdump is optional. By default, the pipeline downloads the NCBI taxonomy at runtime. If the pipeline’s tasks have no internet access (e.g. on offline compute nodes or behind some VPNs), or to keep the same taxonomy version across runs, download taxdump.tar.gz yourself and pass it with --taxdump /path/to/taxdump.tar.gz.

Warning

Please provide pipeline parameters via the CLI or Nextflow -params-file option. Custom config files including those provided by the -c Nextflow option can be used to provide any configuration except for parameters; see docs.

For more details and further functionality, please refer to the usage documentation and the parameter documentation.

Pipeline output

To see the results of an example test run with a full size dataset refer to the results tab on the nf-core website pipeline page. For more details about the output files and reports, please refer to the output documentation.

Credits

nf-core/genephylo was originally written by Lea Picard.

We thank the following people for their extensive assistance in the development of this pipeline:

Patricia C. Carter

Contributions and Support

If you would like to contribute to this pipeline, please see the contributing guidelines.

For further information or help, don’t hesitate to get in touch on the Slack #genephylo channel (you can join with this invite).

Citations

An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.

You can cite the nf-core publication as follows:

The nf-core framework for community-curated bioinformatics pipelines.

Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.

Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.