ensembl_bulk
ensembl_bulk prepares a folder of Ensembl bulk files that transcript_query
reads with --bulk-dir, instead of querying the Ensembl REST API and BioMart
gene by gene. All the inputs then come from one Ensembl release, whatever the
date of the run, and building the input folder of a gene takes seconds:
ensembl_bulk download ensembl_115 --release 115
ensembl_bulk index ensembl_115
transcript_query ENSG00000107643 --bulk-dir ensembl_115 --orthology 1:n
download fetches the Compara gene trees and homologies, and, for each
species, the GTF, the unmasked toplevel genome and part of the core database
dump from the Ensembl FTP site, and one exon table from the BioMart archive
site of the release. By default the species are the query species and every
species with an ortholog of it, i.e. those transcript_query uses without
--specieslist: 199 species and about 120 GB for human in Ensembl 115.
--specieslist restricts the download to some species. Every file is checked
against the Ensembl checksums, and running the command again resumes an
interrupted download. index then builds the indexes that transcript_query
reads. With the decompressed genomes, a species takes about 3 GB (about
0.55 TB for the 199 species).
On a SLURM cluster, thoraxe/bulk_ensembl/ensembl_bulk.sbatch runs both
steps as one job, then thoraxe/transcript_query/transcript_query_bulk.sbatch
builds the folders of many genes as a job array (by default, every
protein-coding gene of the query species):
sbatch thoraxe/bulk_ensembl/ensembl_bulk.sbatch 115 /data/ensembl_115
sbatch thoraxe/transcript_query/transcript_query_bulk.sbatch \
/data/ensembl_115_<date> /data/genes_115
The first job downloads into /data/ensembl_115_downloading and renames it
with the date the download finished. Both jobs resume when submitted again.
transcript_query --bulk-dir writes the same files as transcript_query,
with two expected differences: the order of sibling subtrees in tree.nh can
differ, as it does between two REST queries, and sequences.fasta can contain
some exons of overlapping genes that the REST API omits, which thoraxe does
not read. Without --specieslist, the species of the bulk folder are used.
ensembl_bulk downloads and indexes the Ensembl bulk files that transcript_query reads with --bulk-dir, instead of querying the Ensembl REST API and BioMart gene by gene. Run “ensembl_bulk download”, then “ensembl_bulk index”.
usage: ensembl_bulk [-h] [--version] {download,index} ...
Positional Arguments
- command
Possible choices: download, index
Named Arguments
- --version
show program’s version number and exit
Sub-commands
download
download the bulk files of an Ensembl release
ensembl_bulk download [-h] [-l SPECIESLIST] [-r RELEASE] [-s QUERY_SPECIES]
[--homology-species [HOMOLOGY_SPECIES [HOMOLOGY_SPECIES ...]]]
[--biomart-host BIOMART_HOST] [-w WORKERS]
bulk_dir
Positional Arguments
- bulk_dir
bulk folder (created if needed)
Named Arguments
- -l, --specieslist
restrict the download to these species, as in transcript_query: a list separated by commas without spaces, or a file with one species per line. If empty, every species with an ortholog of the query species is downloaded. The query species is always added.
Default: “”
- -r, --release
Ensembl release, e.g. 115 (required the first time)
- -s, --query-species
species of the genes given to transcript_query (default: homo_sapiens)
- --homology-species
species whose Compara homology file is also read (default: those found for homo_sapiens in release 115; “ensembl_bulk index” tells if others are needed)
- --biomart-host
BioMart site serving the release (default: its Ensembl archive site)
- -w, --workers
parallel downloads (at most 4)
Default: 4
index
build the indexes that transcript_query --bulk-dir reads
ensembl_bulk index [-h] [-l SPECIESLIST] [-w WORKERS] bulk_dir
Positional Arguments
- bulk_dir
bulk folder
Named Arguments
- -l, --specieslist
species to index; all downloaded species if empty
Default: “”
- -w, --workers
species indexed in parallel (a few GB of memory each)
Default: 1
It has been developed at LCQB (Laboratory of Computational and Quantitative Biology), UMR 7238 CNRS, Sorbonne Université.
Note
The bulk mode was validated on Ensembl 115 by running thoraxe on 19 species from REST and from bulk input folders, for the 23,262 human genes of a production run. Outputs were equivalent for 19,304 genes. Both sources found no 1:n ortholog in the 19 species for 61 genes and no ortholog at all for 3,855, and thoraxe failed on both for 9. Each of the 33 remaining genes had a defect in its REST download (corrupted or missing exon sequences of an ortholog, orthologs without exons, empty exon table) or made thoraxe fail on the extra species of the REST folder.