stianlagstad / chimeraviz

chimeraviz is an R package that automates the creation of chimeric RNA visualizations.
36 stars 14 forks source link

No coverage data for plot_fusion #98

Closed Aisha-D closed 7 months ago

Aisha-D commented 1 year ago

I am trying to plot the fusion with gene coverage. I have my BAM aligned used Starfusion to hg38, which contains "chr". I've matched it to an annotation gtf of the same version and added "chr" to it. What I realised was that the BAM file is the issue and that when i set the bamfile = NULL, there is no change in track. Is there anything specific needed for the coverage to be plotted? The code worked fine in the example dataset.

I'm using starfusion v1.11 and operating system is Ubuntu 20.04.

Example code leading to the error (and the plot it generates).

FI_fusion = import_starfusion("SeraSeqControl.star-fusion.fusion_predictions.abridged.tsv", "hg38")
fusion <- get_fusion_by_id(FI_fusion, 1)
# get bam file
sample_bam <- "SeraSeqControl.star.bam"
# bam has chr, so gtf needs to be chr too
# Create EnsDb from a downloaded .gtf file
edbSqliteFile <- ensDbFromGtf(gtf = "Homo_sapiens.GRCh38.103.withchr.gtf")
edb <- ensembldb::EnsDb(edbSqliteFile)
# edb <- ensembldb::EnsDb("Homo_sapiens.GRCh38.103.sqlite" )
# plot
plot_fusion(
 fusion = fusion,
 bamfile = sample_bam,
 edb = edb,
 non_ucsc = T,
 reduce_transcripts= T)

Screenshot from 2023-05-23 17-25-20

Session info:

Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3;  LAPACK version 3.9.0

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/London
tzcode source: system (glibc)

attached base packages:
[1] grid      stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] tidyr_1.3.0               EnsDb.Hsapiens.v86_2.99.0 chimeraviz_1.26.0         data.table_1.14.8         ensembldb_2.24.0          AnnotationFilter_1.24.0  
 [7] GenomicFeatures_1.52.0    AnnotationDbi_1.62.1      Biobase_2.60.0            Gviz_1.44.0               GenomicRanges_1.52.0      Biostrings_2.68.1        
[13] GenomeInfoDb_1.36.0       XVector_0.40.0            IRanges_2.34.0            S4Vectors_0.38.1          BiocGenerics_0.46.0       DT_0.28                  

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3          jsonlite_1.8.4              rstudioapi_0.14             magrittr_2.0.3              rmarkdown_2.21             
  [6] BiocIO_1.10.0               zlibbioc_1.46.0             vctrs_0.6.2                 memoise_2.0.1               Rsamtools_2.16.0           
 [11] RCurl_1.98-1.12             base64enc_0.1-3             htmltools_0.5.5             S4Arrays_1.0.4              progress_1.2.2             
 [16] curl_5.0.0                  Formula_1.2-5               sass_0.4.6                  bslib_0.4.2                 htmlwidgets_1.6.2          
 [21] plyr_1.8.8                  cachem_1.0.8                GenomicAlignments_1.36.0    lifecycle_1.0.3             pkgconfig_2.0.3            
 [26] Matrix_1.5-4.1              R6_2.5.1                    fastmap_1.1.1               GenomeInfoDbData_1.2.10     MatrixGenerics_1.12.0      
 [31] digest_0.6.31               colorspace_2.1-0            crosstalk_1.2.0             Hmisc_5.1-0                 RSQLite_2.3.1              
 [36] org.Hs.eg.db_3.17.0         filelock_1.0.2              org.Mm.eg.db_3.17.0         fansi_1.0.4                 httr_1.4.6                 
 [41] compiler_4.3.0              withr_2.5.0                 bit64_4.0.5                 htmlTable_2.4.1             backports_1.4.1            
 [46] BiocParallel_1.34.1         DBI_1.1.3                   biomaRt_2.56.0              rappdirs_0.3.3              DelayedArray_0.26.2        
 [51] rjson_0.2.21                gtools_3.9.4                tools_4.3.0                 foreign_0.8-84              nnet_7.3-19                
 [56] glue_1.6.2                  restfulr_0.0.15             checkmate_2.2.0             cluster_2.1.4               generics_0.1.3             
 [61] gtable_0.3.3                BSgenome_1.68.0             hms_1.1.3                   xml2_1.3.4                  utf8_1.2.3                 
 [66] pillar_1.9.0                stringr_1.5.0               RCircos_1.2.2               dplyr_1.1.2                 BiocFileCache_2.8.0        
 [71] lattice_0.21-8              rtracklayer_1.60.0          bit_4.0.5                   deldir_1.0-9                biovizBase_1.48.0          
 [76] tidyselect_1.2.0            knitr_1.42                  gridExtra_2.3               ProtGenerics_1.32.0         SummarizedExperiment_1.30.1
 [81] xfun_0.39                   matrixStats_0.63.0          stringi_1.7.12              lazyeval_0.2.2              yaml_2.3.7                 
 [86] evaluate_0.21               codetools_0.2-19            interp_1.1-4                tibble_3.2.1                BiocManager_1.30.20        
 [91] cli_3.6.1                   rpart_4.1.19                jquerylib_0.1.4             munsell_0.5.0               dichromat_2.0-0.1          
 [96] Rcpp_1.0.10                 dbplyr_2.3.2                png_0.1-8                   XML_3.99-0.14               parallel_4.3.0             
[101] ellipsis_0.3.2              ggplot2_3.4.2               blob_1.2.4                  prettyunits_1.1.1           latticeExtra_0.6-30        
[106] jpeg_0.1-10                 bitops_1.0-7                VariantAnnotation_1.46.0    scales_1.2.1                purrr_1.0.1                
[111] crayon_1.5.2                BiocStyle_2.28.0            rlang_1.1.1                 KEGGREST_1.40.0            
stianlagstad commented 1 year ago

Hi @Aisha-D, thank you for the bug report. Would you be able to share the data that you're trying to use? That would make it easy for me to investigate this issue.

Aisha-D commented 1 year ago

Hi Stian,

I managed to resolve this issue although its not the optimal method. I used samtools to remove "chr" from the bam file, then the function worked and the coverages were plotted.

Would you still want the data?

Many thanks, Aisha