Body: <p>The example that I am trying to follow is <a href="http://bioconductor.org/packages/devel/bioc/vignettes/PGA/inst/doc/PGA.pdf" rel="nofollow noreferrer">this PGA tutorial</a>.
  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:</p>
  
  <pre class="lang-r prettyprint-override"><code>&gt; msfile=openMSfile("/scratch/oknjav001/transcriptomics/proteogenomics/ms_rnaseqdata/msData/LTB/t16BCG.180731_C0_CH_T016BCG.mzML")
  &gt; msfile
  Mass Spectrometry file handle.
  Filename: 1807_C0_CH_T016BCG.mzML
  Number of scans: 52332
  &gt; idfile &lt;- 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
  </code></pre>
  
  <p>How can I go about fixing this error?</p>
  
  <p>The example that I am trying to follow this <a href="http://bioconductor.org/packages/devel/bioc/vignettes/PGA/inst/doc/PGA.pdf" rel="nofollow noreferrer">PGA tutorial</a>. 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.</p>
  
  <pre><code>msfile &lt;- system.file("extdata/input", "pga.mgf",package="PGA")
  idfile &lt;- 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)
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-09T09:24:39.543Z
Comments.Text: sorry can you provide a bit more information, which package is this and what does your fasta file lloks like?
Comments.UserDisplayName: StupidWolf
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-09T15:16:18.033Z
Comments.Text: 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
Comments.UserDisplayName: James Hawley
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-09T21:25:50.393Z
Comments.Text: 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`?
Comments.UserDisplayName: James Hawley
Tags: <r><bioconductor><proteomics>
Title: Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class ‘"SeqFastaAA"’ to a data.frame
ThreadText: # Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class ‘"SeqFastaAA"’ to a data.frame
  
  (Asked by: username_0 on 2020-05-09)
  
  The example that I am trying to follow is [this PGA tutorial](http://bioconductor.org/packages/devel/bioc/vignettes/PGA/inst/doc/PGA.pdf).
  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:
  
  ```r
  > 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](http://bioconductor.org/packages/devel/bioc/vignettes/PGA/inst/doc/PGA.pdf). 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)
  
  ```
  
  **Tags:** r, bioconductor, proteomics
  
  > **Comments:**
  > **username_1**: sorry can you provide a bit more information, which package is this and what does your fasta file lloks like?  
  > **username_2**: Hi username_0, 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  
  > **username_2**: 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`?  
  
  ---
  
  ## 0 answers
  
  