-
Notifications
You must be signed in to change notification settings - Fork 17
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
Error in getListElement(x, i, ...) : GRanges objects don't support [[, as.list(), lapply(), or unlist() at the moment #76
Comments
Hi @AntoniaChroni,
Is this really your script? It doesn't make much sense because with your code
Please provide:
Thanks, |
This is the whole script: inputFiles <- c("./sample1/outs/fragments.tsv.gz", names(inputFiles) = c("sample1", "sample2", "sample3") matrixFiles = gsub(inputFiles,pattern = "fragments.tsv.gz", replacement = "") barcodes = list() for(i in names(matrixFiles)){ combined.peaks <- reduce(c(peaks$sample1, peaks$sample2, peaks$sample3)) |
Please provide a self-contained reproducible example. The code you share with us is not self-contained because we don't have access to all those files that you are using, so we can't run it. And if we can't run it we can't reproduce the problem. And if we can't reproduce the problem then we can't fix it. 🤷♂️ Also you're still not providing your |
is there an email that I could share this data with you? |
Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
I don't know what files exactly you want to send me by email but your code above uses 9 possibly big files. Indiscriminately sending me all that stuff by email and let me figure out what I really need to reproduce the problem is not the way to go. You need to figure out what's strictly needed i.e. it's on you to try to reduce the size of the requirements as much as possible. This usually starts by trying to simplify your example as much as possible to isolate the code that reproduces the problem, and get rid of anything else. For example, we don't care about the 3 fragments.tsv.gz or 3 barcodes.tsv files, because they are not used at all to construct GRangesList object
BTW you also want to make the effort to indent your code properly to make it easier for others to read and understand it. Also now that the code is smaller, we can actually start to focus on it and pay attention to details. FWIW I notice that the
when they should probably be:
So before you share the peaks.bed data with us, can you run this code and confirm that it still reproduces the problem?Also can you share here what you get when you dispay |
So, I have done all these and still have the same error. The code was working fine before. $sample2 That returns a list of peaks per sample. I am sorry for the confusion with the code and session info, but I was not aware of it. |
What about sharing what you get when you display Also what do you think of the misplaced parentheses in |
changing the parentheses is returning NULL for additional samples. If I keep the parentheses as they are:
|
What about |
Also please show what you get when doing:
BTW it wouldn't hurt that you take some time to learn the basics of how to properly format your posts here on GitHub e.g. any code or output produced by the code should be placed between triple backticks lines ( |
I wanted to keep it simple, so I only included 2 samples when following your suggestions when using reduce function. |
And you still get the error when doing |
|
Formatting is still not good. I wrote "between triple backticks lines". This means that you must put a line with triple backticks before and after the code or the output of the code (so that's 2 lines with triple backticks). Also you can press Preview to see how things get formatted before you actually post. It's free so do not hesitate to use it. Ok so now we've simplified your original reproducible example to this:
Again, can you show what you get when doing |
hey, this hasn't been resolved yet. I woudl appreciate your help on this.
|
At this point I will ask you to make your 2 bed files ( However you absolutely want to make sure that you can still reproduce the issue using the files that you're going to share with us, and with BioC 3.16. The idea is that me and others can also reproduce the issue by just running the code that I posted in my last comment above using these files. So make sure you can do that too. Thanks! |
Hey,
I am getting this error when I am using reduce function on a GRangesList (it was working fine a few days ago).
Error in getListElement(x, i, ...) :
GRanges objects don't support [[, as.list(), lapply(), or unlist() at
the moment
My script is:
peaks = GRangesList()
combined.peaks <- reduce(c(peaks$sample1, peaks$sample2, peaks$sample3))
And the output looks like this:
seqinfo: 24 sequences from an unspecified genome; no seqlengths
...
<10 more elements>
Any thoughts on what is happening?
Thanks!
The text was updated successfully, but these errors were encountered: