Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to covert genbank IDs to lineage #15

Closed
sankadinesh opened this issue Dec 10, 2019 · 7 comments
Closed

Unable to covert genbank IDs to lineage #15

sankadinesh opened this issue Dec 10, 2019 · 7 comments

Comments

@sankadinesh
Copy link

@sankadinesh sankadinesh commented Dec 10, 2019

I am trying to convert a csv file with 1000 genbank IDs to taxonomic lineage using the following commands in R Taxonomizr. I have attached db link of input file also. Thanks in advance.
https://www.dropbox.com/s/e80fg5ucydqfdsr/nifHgbID.csv?dl=0

image

@sherrillmix

This comment has been minimized.

Copy link
Owner

@sherrillmix sherrillmix commented Dec 10, 2019

Small screenshots of code might not be the best way to debug problems so I can't tell if you created the "accessionTaxa.sql" database necessary for processing. Maybe post your full taxonomizr code. Also were things working previously? Do the examples work?

@sankadinesh

This comment has been minimized.

Copy link
Author

@sankadinesh sankadinesh commented Dec 11, 2019

Hi there,
Sorry. Please check the text of the codes given and output.

library(taxonomizr)
x<-data.table::fread(file="nifHgbID.csv",header = F,sep=",")
taxaId<-accessionToTaxa("x","accessionTaxa.sql")
Warning messages:
1: In file.remove(tmp) :
cannot remove file 'C:\Users\Admin\AppData\Local\Temp\RtmpyIgQ6H\file2a1c5fe462d8', reason 'Permission denied'
2: In file.remove(tmp) :
cannot remove file 'C:\Users\Admin\AppData\Local\Temp\RtmpyIgQ6H\file2a1c5fe462d8', reason 'Permission denied'

Example did work. Hence, I think accessionTaxa.sql (56.4 GB) is there and working.

taxaId<-accessionToTaxa(c("LN847353.1","AL079352.3"),"accessionTaxa.sql")
Warning messages:
1: In file.remove(tmp) :
cannot remove file 'C:\Users\Admin\AppData\Local\Temp\RtmpyIgQ6H\file2a1c387e54fd', reason 'Permission denied'
2: In file.remove(tmp) :
cannot remove file 'C:\Users\Admin\AppData\Local\Temp\RtmpyIgQ6H\file2a1c387e54fd', reason 'Permission denied'
print(taxaId)
[1] 1313 9606
getTaxonomy(taxaId,'accessionTaxa.sql')
superkingdom phylum class order family
1313 "Bacteria" "Firmicutes" "Bacilli" "Lactobacillales" "Streptococcaceae"
9606 "Eukaryota" "Chordata" "Mammalia" "Primates" "Hominidae"
genus species
1313 "Streptococcus" "Streptococcus pneumoniae"
9606 "Homo" "Homo sapiens"
There were 31 warnings (use warnings() to see them)

@sherrillmix

This comment has been minimized.

Copy link
Owner

@sherrillmix sherrillmix commented Dec 11, 2019

It seems like something weird is going on with your temp directory. As a start, in the same session, could you create a tempfile and try to delete it e.g.:

tmp<-tempfile()
file.create(tmp)
print(list.files(tempdir(),basename(tmp)))
file.remove(tmp)
print(list.files(tempdir(),basename(tmp)))

Does that generate a warning?

@sherrillmix

This comment has been minimized.

Copy link
Owner

@sherrillmix sherrillmix commented Dec 11, 2019

Also it looks like the only visible problems are just warnings that files couldn't be deleted. That shouldn't affect the computations and the files should be deleted when R exits (at least on a normal system with functioning temp directory) so that's really not that big a deal. If you run your code and print(taxaId) do you get answers that look reasonable?

@sankadinesh

This comment has been minimized.

Copy link
Author

@sankadinesh sankadinesh commented Dec 12, 2019

Hi Sherrillmix
I used those commands and got the following errors.

temp<-tempfile()
file.create(tmp)
Error in file.create(tmp) : object 'tmp' not found
print(list.files(tempdir(),basename(tmp)))
Error in basename(tmp) : object 'tmp' not found
file.remove(tmp)
Error in file.remove(tmp) : object 'tmp' not found
print(list.files(temp(), basename(tmp)))
Error in temp() : could not find function "temp"

@sankadinesh

This comment has been minimized.

Copy link
Author

@sankadinesh sankadinesh commented Dec 12, 2019

Dear All,
can anyone please give me a script for import and export through .csv format. I am creating custom database of 35k sequences. Thanks
Regards,
Dinesh S L

@sherrillmix

This comment has been minimized.

Copy link
Owner

@sherrillmix sherrillmix commented Dec 12, 2019

You entered temp<-tempfile() when the example used tmp<-tempfile() and also had a few similar typos. So that output does not provide me with any information.

I definitely appreciate not blindly copy and pasting but if things aren't working and you don't want to debug yourself then perhaps copy-paste would be more appropriate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.