How to get domain/kingdom name in a table of taxid in R tidyverse?
0
0
Entering edit mode
18 months ago
DNAngel ▴ 240

Hi all,

I have over 100 textfiles that contain BLAST hit results for each contig in that sample. The format includes taxids. I have opened these textfiles into R tidyverse for some data manipulation, but the first thing I really want to get are the domains/kingdoms for each species. For example, contig-1 top hit was a bacteria and it's taxid was 343509. I'd want to create a new column that adds "Bacteria" to it, and possibly also later on get the "Family" and "Genus" level names for the species.

Is there an R package that can look at a species name or taxid and output such information easily which I can then add into my tibble?

The R taxa package doesn't seem to be what I want, as it focuses on creating your own taxonomy definitions using taxids, but I was hoping for something that would do it automatically since I have hundreds of files to go through.

Thanks!

R • 370 views
0
Entering edit mode

I think you'll end up having to mess around with the rentrez package for this. But the taxonomizr might be the more appropriate approach here. I'd try that first.

0
Entering edit mode

I tried taxonomizr...had no clue what the sql node table was supposed to be or how to even make one.