I am trying to use taxonomizr in R to get taxonomy from a csv file with NCBI accession numbers.
However, using these lines:
bacterial<-read.csv('unique_accession.csv')
taxaId<-accessionToTaxa("bacterial$Accession_Number","accessionTaxa.sql")
getTaxonomy(taxaId,taxaNodes,taxaNames)
I followed taxonomizr vignette in correctly setting it up. I've tested it by giving just accession numbers, and it has been able to give taxonomic classifications.
But when I provide it with my csv file, instead of getting taxonomic classifications for all my accession numbers, I am getting NA in the classification.
I was wondering if anyone else has run into this issue, and how to solve it.
Please use the formatting bar (especially the
code
option) to present your post better. I've done it for you this time.This looks like a problem with how you read the file. Tweak the parser parameters passed to
read.csv
and ensure the data that was read looks as it should - often times, you will need options such asstringsAsFactors=FALSE
,quote=FALSE
,comment.char=""
, etc.