This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Code Used to Work Not Working anymore

I had a granges object. The problem was a lot of times one range with the same feature type, entrezgene_id and etc ended right before another range with the same feature type. For example, two exons one 1-100 the next at 100-500 in these cases I used the following code to store this as exon 1-500 but the code bellow does not work anymore and gives me the error: "Error in getListElement(x, i, ...) : IRanges objects don't support [[, as.list(), lapply(), or unlist() at the moment".

Can someone please help me with this problem? Is there an alternative to this solution?

all.df[, as.data.table(reduce(IRanges(start, end))), by = .(seqnames, strand,entrezgene_id, gene_name, feature_type, exon_name)
r annotation txdb reduce granges

Can you provide some example data in your post?

Suppose we have:

seqnames    start      end      strand     gene_name     feature_type
chr11   1         5000        -    XYZ        utr5*        
chr11   5000   10,000     -    XYZ        utr5*

I want to get

chr11   1        10,000     -    XYZ        utr5*

Your example data has 6 header values but 7 columns, and your example result has 8 columns.

0 answers

No answers yet.

Log in to answer this question.