Entering edit mode
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.
SAF files must not have a header.
I tried reading in the .csv version of the SAF with header = F and I'm still getting an error. I'm running:
and it's returning:
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."
I was talking about the command line version.
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.
Your bam file names should be stored in a vector and then provided to the
files
parameter.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.