R unused arguments, Biostrings
0
0
Entering edit mode
3.0 years ago

HI, I'm trying to convert my nucleotide set in the nt.DNAString column to an AA sequence. I have:

library(Biostrings)
sample1$nt.DNAString <- DNAStringSet(sample1$seq.nt)
sample1$Seq.AA <- translate(sample1$nt.DNAString, genetic.code = GENETIC_CODE)
sample1$p226 <- paste(subseq(sample1_R1$Seq.AA, 5,5))
sample1$p227 <- paste(subseq(sample1_R1$Seq.AA, 6,6))


I keep getting this error:

Error in translate(sample1\$nt.DNAString, genetic.code = "GENETIC_CODE",  :
unused arguments (genetic.code = "GENETIC_CODE", if.fuzzy.codon = "error")


I thought the DNAStringSet solved the vector issue with the data?

R Biostrings unused argument • 1.7k views
2
Entering edit mode

You can use the code option in the formatting box to format your code for easier readability. One of the possibilities is that you have loaded another library which also has a translate function and that is the function being called. You can try being explicit with Biostrings::translate() and check again.

0
Entering edit mode

check which namespace the 'translate' function is defined in with find("translate"). It's likely you've imported a package that contains a translate function (other than Biostrings) that has a different set of parameters (eg Hmisc / AnnotationFuncs).

0
Entering edit mode

Thanks for the tip, I tried this, and it returns Biostrings.

0
Entering edit mode

The Biostrings::translate worked. Thank you both!!