trouble with sangerseqR package

Hello everyone! I successfully downloaded the Bioconductor packages sangerseqR and sangeranalyseR, however when I try to use this function: sangerseq(), I get the following error:

Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘sangerseq’ for signature ‘"list"’

I'm stuck.

My R version is 4.1.3 (2022-03-10)

This is the code:

if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("sangerseqR")

if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("sangeranalyseR")

#Load library
library(Biostrings)
library(BiocGenerics)
library(sangerseqR)
library(sangeranalyseR)

#Import data
LF1 <- read.abif(file.choose("~/Work space/chlamydia"))
LF2 <- read.abif(file.choose("~/Work space/chlamydia"))

str(LF1)
str(LF2)

LF1seq<-sangerseq(LF1)
LF2seq<-sangerseq(LF2)

unable to find an inherited method for function ‘sangerseq’ for signature ‘"list"’

This suggests that the LF1 object has the wrong class. From the code you posted, I don't think it's possible: read.abif() is supposed to always return an abif object (or fail with an error message).

I would start by restarting R to clean the memory (in RStudio, press ctrl+shift+F10), then check the result of this:

library(sangerseqR)

LF1 <- read.abif(file.choose("~/Work space/chlamydia"))

class(LF1)

LF1seq <- sangerseq(LF1)

In particular, class(LF1) should return:

[1] "abif"
attr(,"package")
[1] "sangerseqR"
1 Like

Yess! it worked! Thank you so much!

I'm having another problem now, using sangeranalyseR.
When I try to use the trim.mott(), I get this error:

trims=trim.mott(LF1)

Error in trim.mott(LF1) :
could not find function "trim.mott"

I'm sure I successfully installed the package.

Do you have any idea why I'm getting this?
Thank you!

Yes: it's in the package sangeranalyseR, and I made you remove the line library(sangeranalyseR ).

So either you have to add that line back, or you can explicitly tell R where to find that function with sangeranalyseR::trim.mott()

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.