m-orton / Evolutionary-Rates-Analysis-Pipeline

The purpose of this repository is to develop software pipelines in R that can perform large scale phylogenetics comparisons of various taxa found on the Barcode of Life Database (BOLD) API.
GNU General Public License v3.0
7 stars 1 forks source link

Jacqueline got an error line 569 of Annelida branch #37

Closed jmay29 closed 7 years ago

jmay29 commented 7 years ago

So I got this error when running line 571 of the Annelida branch:

dnaStringSet3 <- foreach(i=1:nrow(dfRefSeq)) %do% DNAStringSet(alignmentSequencesPlusRef[[i]]) Error in DNAStringSet(alignmentSequencesPlusRef[[i]]) : task 1 failed - "key 49 (char '1') not in lookup table"

I believe this happens when only using 1 class, as it has troubles with the code on line 565:

alignmentSequencesPlusRef <- foreach(i=1:nrow(dfRefSeq)) %do% append(classSequences[[i]],alignmentRef[[i]])

Would an if statement that checks for the length of classSequences be appropriate before creating alignmentSequencesPlusRef?

m-orton commented 7 years ago

Hey Jacqueline, I dont seem to be getting this error when I run through Annelida with only one class. I think a 1 must have been mistakenly inserted to a sequence since this error indicates the character 1 is located somewhere in one of the sequences.

Try running this code to check: find1 <- foreach(i=1:length(alignmentSequencesPlusRef)) %do% grep( "[1]", alignmentSequencesPlusRef[[i]])

This will give the list element where the 1 would be. If its the last list element, then its the reference sequence that has a 1 inserted somewhere.

Let me know if this helps.

jmay29 commented 7 years ago

So weird. For some reason, my sequences were being treated as factors. So doing this:

append(as.character(classSequences[[i]]),alignmentRef[[i]])

fixed the problem. I'll try to find out why it was handling them as factor in the first place!!! :S

m-orton commented 7 years ago

Ok glad the problem is fixed, I wonder why the sequences are being changed to factors instead of char type? Should I update all the branches with this code just in case this happens again?

jmay29 commented 7 years ago

I think that would be a good idea, just in case it happens to someone else. Still haven't figured out why it happened, though . I'll let you know if I do!

m-orton commented 7 years ago

Ok thanks. Edited the branches with this change. Lets keep this issue open in case this pops up again.

jmay29 commented 7 years ago

So I tried running line 565 again and came across a different error:

alignmentSequencesPlusRef <- foreach(i=1:nrow(dfRefSeq)) %do% append(as.character(classSequences[[i]],alignmentRef[[i]])) Error in append(as.character(classSequences[[i]], alignmentRef[[i]])) : task 1 failed - "argument "values" is missing, with no default"

Not sure what the problem is now, but I am running 1 class (Actinopterygii) and subset dfInitial to 10,000 sequences. I'll let you know if I can figure it out!

jmay29 commented 7 years ago

I don't seem to be having the same problem as before, when the sequences were considered as factors. That might have resulted from the way I was reading in my data. I tried using the following line:

alignmentSequencesPlusRef <- lapply(classSequences, function(x) append(x, alignmentRef[[i]]))

instead of using a foreach loop on line 565 and it seemed to help. But if you don't reproduce the error using a single class then maybe it's just me!! (lol)

sadamowi commented 7 years ago

Is this error still coming up for you, Jacqueline, or for you Matt? If not, then I suggest we close this issue to reduce the list of issues. Issues can be easily reopened if a prior issue surfaces again.

Best wishes, Sally

m-orton commented 7 years ago

Hi Sally, I have not encountered this error running through taxa on the server.

sadamowi commented 7 years ago

OK thanks Matt! I will close this issue as it doesn't seem to be an active issue any more, particularly for V1.

Jacqueline - Please feel free to reopen issues at any time if you'd like to discuss something further. The full thread is retained for closed issues, and it is easy to reopen something.

Best wishes, Sally