Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In your R script (create_regions_from_gencode.R) there is a small bug #3

Open
Alex-Nesta opened this issue Feb 25, 2019 · 5 comments
Open

Comments

@Alex-Nesta
Copy link

transcripts.data <- unlist(transcripts.data) ###ERROR
exons.data <- unlist(exons.data)
threeUTRs.data <- unlist(threeUTRs.data)
fiveUTRs.data <- unlist(fiveUTRs.data)
cds.data <- unlist(cds.data)
introns.data <- unlist(introns.data)
genes.data <- unlist(genes.data) ####ERROR

There error is:

Error in getListElement(x, i, ...) : 
  GRanges objects don't support [[, as.list(), lapply(), or unlist() at
  the moment
Calls: unlist ... FUN -> [[ -> [[ -> getListElement -> getListElement
Execution halted

I did not need those lines to work for my purposes, but just an FYI on the issue.

@BioLaoXu
Copy link

I have the same problem,Bioconductor 3.8 may not support the this,but I didn't solve it

@saketkc
Copy link
Owner

saketkc commented Feb 28, 2019

Thanks @Alex-Nesta and @xf78 for reporting the issue. I will try to have a fix soonish. In the meantime, can you check if the data you need is here: https://github.com/saketkc/gencode_regions/tree/master/data Happy to add if it's missing (which is very likely!)

@bug1303
Copy link
Contributor

bug1303 commented May 23, 2019

I had the same issue, using GenomicFeatures v 1.34.3 (not sure which other packages/versions might be relevant for this). It appears that genes(), transcripts(), and promoters() return a GRanges object ["The only exception being when genes is used with single.strand.genes.only=FALSE, in which case a GRangesList object is returned."], while threeUTRsByTranscript(), fiveUTRsByTranscript(), cdsBy(), exonsBy(), intronsByTranscript() return a GRangesList object, so for the latter ones the unlist is required, but not for the former ones.

By simply removing the lines as mentioned above
transcripts.data <- unlist(transcripts.data)
and
genes.data <- unlist(genes.data)

as well as replacing
promoters.data <- unlist(promoters(TxDb, upstream=len, downstream=len))
with
promoters.data <- promoters(TxDb, upstream=len, downstream=len)

I managed to recreate the files as provided in data/GRCm38/vM14/

@longqh3
Copy link

longqh3 commented Nov 27, 2020

I also encountered this issue currently, using conda hosted R-3.3.2 to install dependencies solved the issue.
However, while conducting problem searching, I noticed that

The overall goal of all these changes is to bring more consitency between IRanges and GRanges objects
 (GRanges objects will also support [[, unlist(), as.list(), and lapply() in Bioconductor 3.8).

in unlist doesn't work for IRanges, so maybe downgrading to Bioconductor 3.8 version can also solve the issue (I'm not pretty sure, haven't tried yet).

@DodotheMath
Copy link

Running into this same issue now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants