# Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class ‘"SeqFastaAA"’ to a data.frame

The example that I am trying to follow is this PGA tutorial. I want to use the information in the analysis of the mzML raw files from the proteomics data analysis. When I try to load the fasta file, I get the following error:

> msfile=openMSfile("/scratch/oknjav001/transcriptomics/proteogenomics/ms_rnaseqdata/msData/LTB/t16BCG.180731_C0_CH_T016BCG.mzML")
> msfile
Mass Spectrometry file handle.
Filename: 1807_C0_CH_T016BCG.mzML
Number of scans: 52332
> idfile <- runTandem(
+    spectra = msfile, fasta = dbfile, outdir = "./", cpu = 6,
+    enzyme = "[KR]|[X]", varmod = "15.994915@M", itol = 0.05,
+    fixmod = "57.021464@C", tol = 10, tolu = "ppm",
+    itolu = "Daltons", miss = 2, maxCharge = 8, ti = FALSE
+ )
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
cannot coerce class '"SeqFastaAA"' to a data.frame


How can I go about fixing this error?

The example that I am trying to follow this PGA tutorial. I want to use this information in the analysis if the mzML raw files from the proteomics data analysis. When I try to load the fasta file I then get the above error.

msfile <- system.file("extdata/input", "pga.mgf",package="PGA")
idfile <- runTandem(spectra = msfile, fasta = dbfile, outdir = "./", cpu = 6,enzyme = "[KR]|[X]", varmod = "15.994915@M",itol = 0.05,fixmod = "57.021464@C", tol = 10, tolu = "ppm",itolu = "Daltons", miss = 2, maxCharge = 8, ti = FALSE)

• sorry can you provide a bit more information, which package is this and what does your fasta file lloks like? May 9 '20 at 9:24
• Hi Javan, welcome to Bioinformatics Stackexchange. To help you with your question, its often best to provide a minimal working example to see what causes your problem, and what you've attempted to try and solve it. You can edit your question to include code snippets, information about what libraries you're using, and what you expect your output to look like. At the moment, including the snapshot doesn't help us since we don't know what the input file is, what libraries you're using, etc. Not having that information makes it difficult for others to help answer your question May 9 '20 at 15:16
• It looks like somewhere internally that spectra or fasta is expected to be a data.frame object, but is actually a SeqFastaAA object. The internal code is trying to convert is, but the class definition of SeqFastaAA has no method to be recast as a data.frame. What is the dbfile you're using? Is is from the PGA tutorial you linked? And does your msfile coming from the mzML file need to be converted to a different object, like a data.frame before being used as an input for runTandem? May 9 '20 at 21:25