This makes sense, thank you!
Hello/Bonjour
I cannot get taxid to work with nr, or my custom database (the custom database does work); I cannot get the output to include the results for staxids.
Error: Warning: [blastx] Taxonomy name lookup from taxid requires installation of taxdb database with ftp://ftp.ncbi.nlm.nih.gov/blast/db/taxdb.tar.gz
The taxdb.btd and taxdb.bti are both in my BLASTDB dir
Code:
blastx -query SPAdes/contigs.fasta -db ../../BLASTDB/nr -outfmt "6 qseqid sseqid pident qlen length mismatch gapope evalue bitscore staxids sscinames" -num_threads 24 -out D446_S2_viral_fraction_nr_taxadb_test.blastx -max_target_seqs 20
Any help is appreciated!
1 answer
You need to add the taxonIDs when you make the database.
I think you first need to download this file: ftp://ftp.ncbi.nih.gov/pub/taxonomy/accession2taxid/prot.accession2taxid.gz
After that you need to extract two columns:
sed '1d' prot.accession2taxid | awk '{print $2" "$3}' > accession_taxonid
Then you make the database like this:
sudo makeblastdb -in yourseqs.fa -dbtype prot -taxid_map accession_taxonid -parse_seqids
I have never done it with protein data, but I think it is the same as the nt.
EDIT: I think the process of adding the taxonIDs consumes a lot of memory. If it does not work blast will not give an error, so keep that in mind. If memory is a problem you first need to extract the accessions that you have from accession_taxonid and try it again.
Log in to answer this question.
Did you set the BLASTDB environment variable?
Scientific Names In Blast Output And Databases
It was set when I installed Blast originally, do I need to do it again/another way now that I have added the 2 taxdb files to the same dir?
What is the result of:
and:
:/home/emily/blast/bin/
Is all the files in my home dir
Does
echo $BLASTDBreally have : at the beginning?The result of
ls -lh $BLASTDBshould be the contents of the folder where your blast databases are located, not your home folder.Fixed both of those, thank you. It still won't return taxaID with a custom db though.
With custom database I suppose you made a database with the makeblastdb command. Did you used sequences from genbank for that or from an other source? And did you added taxaid's when you made the database?
Yes, it was made the makeblastdb, and the contents are a fraction or rn - so yes GenBank. I did not add taxaIDs, but the taxadb is in the same dir as the custom db.