Using featureCounts with SAF annotation file gives "Error: only GTF files contain additional attributes"
0
0
Entering edit mode
atan • 0
@86ae790f
Last seen 3 days ago
United States

I can't figure out how to get featureCounts to generate a count matrix. I have a gff3 file that I've converted to a SAF. Regardless of whether I use the gff3 or the SAF (and whether the SAF is referenced as a .cvs, .tsv, or a data frame), I get an output of "Error: only GTF files contain additional attributes." I don't have a gtf file available for the version of the genome that I'm working with.

counts <- featureCounts(
  annot.ext = "~/Desktop/Spurp_reference_files/Spurp_genome/Sp5_genome_new_download/sp5_0_GCF.saf",
  isPairedEnd = TRUE,
  "C10St14_R-final.bam", "C10St18_R-final.bam", "C11F14_R-final.bam",
  "C11F18_R-final.bam", "C12F14_R2-final.bam", "C12F18_R-final.bam",
  "C13F14_R-final.bam", "C13F18_R-final.bam", "C8St14_R2-final.bam",
  "C8St18_R-final.bam", "C9St14_R2-final.bam", "C9St18_R-final.bam"
)

Output is:

ERROR: only GTF files contain additional attributes
No counts were generated.
Warning messages:
1: In paste("readSummary", ann, files_C, fout, .flatten.and.numeric(countReadPairs),  :
  NAs introduced by coercion
##followed by four more of the same warning

Head of my SAF looks like:

   GeneID            Chr    Start      End Strand
185/333 NW_022145545.1   759692   759767      +
185/333 NW_022145545.1   760175   761104      +
4e-bp NW_022145595.1 15804524 15804558      -
4e-bp NW_022145595.1 15805788 15805952      -
4e-bp NW_022145595.1 15808337 15808478      -
ABCB1 NW_022145604.1  6642470  6642583      +

I've also tried running featureCounts via command line but that gave an error that "no features loaded in format SAF" and terminated.

RNASeq Rsubread • 632 views
ADD COMMENT
0
Entering edit mode

SAF files must not have a header.

ADD REPLY
0
Entering edit mode

I tried reading in the .csv version of the SAF with header = F and I'm still getting an error. I'm running:

counts <- featureCounts(
  annot.ext = inSaf,
  isPairedEnd = TRUE,
  isGTFAnnotationFile = F,
  "C10St14_R-final.bam", "C10St18_R-final.bam", "C11F14_R-final.bam",
  "C11F18_R-final.bam", "C12F14_R2-final.bam", "C12F18_R-final.bam",
  "C13F14_R-final.bam", "C13F18_R-final.bam", "C8St14_R2-final.bam",
  "C8St18_R-final.bam", "C9St14_R2-final.bam", "C9St18_R-final.bam"
)

and it's returning:

Error in .get.annotation.file(annot.inbuilt, annot.ext, isGTFAnnotationFile) : 
  One or more required columns are missing in the provided annotation data. Please refer to help page for annotation format.

Although, if I remove the "GeneID", etc. as column names, R puts in V1, etc. in place? That still gives the same error of the "required columns are missing."

ADD REPLY
0
Entering edit mode

I was talking about the command line version.

ADD REPLY
0
Entering edit mode

For some reason, that's still not working for me on command line.

I ended up figuring out another way around, though, by converting the gff3 to gtf and then double checking which GTF feature type needed to be listed in the options.

ADD REPLY
0
Entering edit mode

Your bam file names should be stored in a vector and then provided to the files parameter.

ADD REPLY
0
Entering edit mode

Thank you! I ended up running it with a gtf on command line, partially because I couldn't figure out how to list multiple files in R for input. I'll note this for future reference.

ADD REPLY

Login before adding your answer.

Traffic: 447 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6