Closed arteteco closed 3 years ago
Hey, a nicer problem to think about than some others in the world just now ....
I think this is an issue with 'FJ688104' not having any nuccore_pubmed
links. In an interactive session
r<-entrez_summary(db="nuccore", id=args)
p<-entrez_link(dbfrom="nuccore", id=args, db="all")
names(p$links)
[1] "nuccore_taxonomy
Might want to try some if statements for these cases? (An I could test that id
is not null)
Hi, thanks for your answer! I hope I understood what you mean.
I thought about the case that there was no nuccore_pubmed
entry. In this case it's NULL
, that is why I used that if
, so that if it's null it would make p="No article found"
A very weird thing is that I tried it now and it was working. I will have to run around 100 more genbanks codes by tomorrow so I'll surely find another not working one. I hope so, at this point, otherwise I'd feel really dumb!
Hi @arteteco , looks like the line
pubm<-entrez_summary(db="pubmed", id=p$links$nuccore_pubmed)
is not part of the else block, though? So it will be called not matter what and lead to the error.
Hi, thanks.
Seems like using a simple if
solves the issue in RStudio. If I run the code from there, by hardcoding args<-"FJ688104"
it works.
What I don't understand at this point is: why if I save the script and run it from the command line I still have the error output? This happens either with R < q02.R --no-save
or ./q02.R
I am not sure this is the right place to ask such questions anymore, so feel free to tell me to go do my homework if I missed something.
$ ./q02.R
Error: Must specify either (not both) 'id' or 'web_history' arguments
Execution halted
This is the little if just to catch the exception
pubm<-entrez_summary(db="pubmed", id=p$links$nuccore_pubmed)
if(is.null(pubm)){
pubm= 'No article found'
}
Hello everyone,
I had this error today, and it seems to only happen with some codes, and not in others.
I have R 3.6.2 Debian 10 rentrez 1.2.2
If I run it, say, with sequence
EU583721
I have the desired result:If I use for example
FJ688104
, which exists and is a valid code, I have the following error:This is the code, I'm not a programmer so don't judge me on the form please!
Thanks!