Hi,
is there a way to automatically convert the featureCounts result matrix into a GRanges (IRanges) object? by feeding it into GRanges?
I ran featureCounts for the data set and have this matrix (first 5 columns):
Chr Start End Strand Length ENSMUSG00000102693 1 3073253 3074322 + 1070 ENSMUSG00000064842 1 3102016 3102125 + 110 ENSMUSG00000102851 1 3252757 3253236 + 480 ENSMUSG00000103377 1 3365731 3368549 - 2819 ENSMUSG00000104017 1 3375556 3377788 - 2233
When I am trying to do it, I get the following error, that GRanges can't understand negative values. I guess the problem occurs with the reverse strand where the start position is smaller than the end position of the gene.
countsTable <- read.delim2(file = "../featureCounts/featureCounts.geneLevel.txt", 
                           header = TRUE, sep = "\t", quote = "", skip = 1, 
                           row.names = 1 )
geneRanges <- GRanges(seqnames = countsTable$Chr,
                      ranges = IRanges(start = as.numeric(countsTable$Start), 
                                       end = as.numeric(countsTable$End)),
                      strand = countsTable$Strand
)
Error in .Call2("solve_user_SEW0", start, end, width, PACKAGE = "IRanges") : 
  solving row 2: negative widths are not allowed
thanks in advance for any suggestions
Assa
