This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Retrieve family data using blastn command line

Dear all,

it is possible to extract the family name of an organism using its version number and blastn command line?

I have the accession code for some (actually many thousands) viruses, would be possible to determine what family do they belong?

For instance, NC_18874.1 should return Herpesviridae; how can I get that information?

Thank you

blast family name genomes

I'm pretty sure there will be an efetch/elink approach to get that info but unfortunately I'm not a good enough user of those, so we'll have to wait for some else to way in here.

Not sure why you threw in blastn in this question? how does that comes into play here? if you have the IDs you can work with those.

I mentioned blastn because it has many options for retrieving codes, such as qseqid sseqid staxids sscinames. I thought it could retrieve also family names.

Ah, ok, yes I can see how you got to that.

with blastn you will indeed be able to select the species name where the sequence belongs to (given that you use one of the newer version of blast and a recent updated blastDB) and even other taxonomic info (with the latest DB update that is), not sure however if you can request the level you want based on the info you have.

1 answer

You can't get family information directly from blastn outfmt custom options. The closest alternative would be to get the staxids of hits and then use Entrezdirect to get the family information.

$ esearch -db nuccore -query "NC_018874" | elink -target taxonomy | efetch -format native -mode xml | xtract -pattern TaxaSet -element ScientificName,
Abalone herpesvirus Victoria/AUS/2009   Viruses Herpesvirales   Malacoherpesviridae     Aurivirus       Haliotid herpesvirus 1

Using the taxid for this virus the same information can be obtained as

$ efetch -db taxonomy -id "1241371" -format native -mode xml | xtract -pattern TaxaSet -element ScientificName
Abalone herpesvirus Victoria/AUS/2009   Viruses Herpesvirales   Malacoherpesviridae     Aurivirus       Haliotid herpesvirus 1

Note: sskingdoms gets you just the top level kingdom (e.g. Bacteria).

not even with this new v5 DB format (with taxonomy included)? Not that I assume so, just checking ;)

Log in to answer this question.