GoekeLab / bambu

Reference-guided transcript discovery and quantification for long read RNA-Seq data
GNU General Public License v3.0
171 stars 22 forks source link

Failed to find a rowRanges() method for CompressedGRangesList objects. #385

Closed alexyfyf closed 11 months ago

alexyfyf commented 11 months ago

Hi team,

Thanks for developing this tool. I have encountered an error when I want to output the gtf. I have run bambu to output all novel transcript without quantification.

> se1 <- bambu(reads = bam.file, 
+             annotations = bambuAnnotations, genome = fa.file, ncore = 48,
+             NDR = 1, quant = F, rcOutDir = 'default',
+             trackReads = T, returnDistTable = T, 
+             lowMemory = F, fusionMode = T)
WARNING - If you change the number of cores (ncore) between Bambu runs and there is no progress please restart your R session to resolve the issue that originates from the XGboost package.
--- Start generating read class files ---
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details

replacement repositories:
    CRAN: https://cran.rstudio.com/

Detected 1 warnings across the samples during read class construction. Access warnings with metadata(bambuOutput)$warnings
--- Start extending annotations ---
For your combination of sample and reference annotations we recommend an NDR of 0.068. You are currently using an NDR threshold of 1. A higher NDR is suited for samples where the reference annotations are poor and more novel transcripts are expected,whereas a lower NDR is suited for samples with already high quality annotations
Warning message:
There was 1 warning in `summarise()`.
ℹ In argument: `intersectWidth = max(intersectWidth)`.
Caused by warning in `max()`:
! no non-missing arguments to max; returning -Inf 
> writeBambuOutput(se1, path = 'SGNex_K562_cDNA_replicate3_run4', prefix = "default")
Error in MatrixGenerics:::.load_next_suggested_package_to_search(x) : 
  Failed to find a rowRanges() method for CompressedGRangesList objects.

I have also tried to use DelayedMatrixStats::rowRanges and sparseMatrixStats::rowRanges, and both showed the same error. I'm using the bambu 3.3.4 from devel branch. Thank you if you could look into this.

Cheers, Alex

cying111 commented 11 months ago

Hi @alexyfyf , given that you have run bambu without quantification, the returned output is a CompressedGrangesList object instead of a SummarizedExperiment object, so the way you extract the annotations is not correct.

You can just directly call se1 and it should already return you what you are looking for and if you want to check the metadata you can call mcols(se1)

Hope this helps to solve your problem.

Thank you Regards, Ying

alexyfyf commented 11 months ago

Hi @cying111 , thank you for your reply. Yes I know I can use mcols. But I want to output the transcripts as GTF file, and I'm not sure how to do that with mcols.

Thank you!

cying111 commented 11 months ago

Hi @alexyfyf , sorry I missed that part, to write it out, you can use this function instead:

writeToGTF(se1, file='SGNex_K562_cDNA_replicate3_run4.gtf')

alexyfyf commented 11 months ago

Thank you so much, I thought it will break writeToGTF as well. Seems only affecting writeBambuOutput. I'll close the issue.