Hello Bioc,
I'm trying to work with ggbio to plot some "mismatch proportion plot"
(my goal is to make a proportion plot but for a specific position, but someone has to start from somewhere),
the code is from this vignette on page 22-23.
I am not sure why there is the issue about the seqlevels()
as the bam file is made using STAR,
with an index of Genome sequence, primary assembly (GRCh38)
So the seqlevels should be : "chr1", "chr2", "chr3" ...
Let me know if there is a need to upload part of the bam file also.
Thank you for your time. Konstantinos
library("BSgenome.Hsapiens.UCSC.hg38")
library(ggbio)
bg <- BSgenome.Hsapiens.UCSC.hg38
# import the bam
my_bam <- "my_bam.featureCounts.bam"
Rsamtools::indexBam(my_bam )
p.mis <- autoplot(my_bam ,
bsgenome = bg,
which = wh,
stat = "mismatch")
reading in as Bamfile
Error in GenomeInfoDb:::makeNewSeqnames(x, new2old = new2old, seqlevels(value)) :
when 'new2old' is NULL, the first elements in the
supplied 'seqlevels' must be identical to 'seqlevels(x)'
sessionInfo( )
R Under development (unstable) (2021-01-07 r79806)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=C
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] splines stats4 parallel stats graphics grDevices utils datasets
[9] methods base
other attached packages:
[1] ggbio_1.39.0 BSgenome.Hsapiens.UCSC.hg38_1.4.3
[3] BSgenome_1.59.2 rtracklayer_1.51.3
[5] Biostrings_2.59.2 XVector_0.31.1
[7] RColorBrewer_1.1-2 pheatmap_1.0.12
[9] rafalib_1.0.0 NOISeq_2.35.0
[11] Matrix_1.3-2 Biobase_2.51.0
[13] edgeR_3.33.0 limma_3.47.3
[15] tximport_1.19.1 plyranges_1.11.0
[17] GenomicRanges_1.43.1 GenomeInfoDb_1.27.3
[19] IRanges_2.25.6 S4Vectors_0.29.6
[21] BiocGenerics_0.37.0 data.table_1.13.6
[23] forcats_0.5.0 stringr_1.4.0
[25] dplyr_1.0.2 purrr_0.3.4
[27] readr_1.4.0 tidyr_1.1.2
[29] tibble_3.0.4 ggplot2_3.3.3
[31] tidyverse_1.3.0 BiocManager_1.30.10
loaded via a namespace (and not attached):
[1] readxl_1.3.1 backports_1.2.1
[3] Hmisc_4.4-2 aroma.light_3.21.0
[5] BiocFileCache_1.15.1 plyr_1.8.6
[7] lazyeval_0.2.2 BiocParallel_1.25.2
[9] digest_0.6.27 ensembldb_2.15.1
[11] htmltools_0.5.0 fansi_0.4.1
[13] checkmate_2.0.0 magrittr_2.0.1
[15] memoise_1.1.0 cluster_2.1.0
[17] modelr_0.1.8 matrixStats_0.57.0
[19] R.utils_2.10.1 vroom_1.3.2
[21] askpass_1.1 prettyunits_1.1.1
[23] jpeg_0.1-8.1 colorspace_2.0-0
[25] blob_1.2.1 rvest_0.3.6
[27] rappdirs_0.3.1 haven_2.3.1
[29] xfun_0.20 crayon_1.3.4
[31] RCurl_1.98-1.2 jsonlite_1.7.2
[33] graph_1.69.0 VariantAnnotation_1.37.1
[35] survival_3.2-7 glue_1.4.2
[37] gtable_0.3.0 zlibbioc_1.37.0
[39] DelayedArray_0.17.7 scales_1.1.1
[41] DBI_1.1.0 GGally_2.1.0
[43] Rcpp_1.0.5 htmlTable_2.1.0
[45] progress_1.2.2 foreign_0.8-81
[47] bit_4.0.4 OrganismDbi_1.33.0
[49] Formula_1.2-4 htmlwidgets_1.5.3
[51] httr_1.4.2 ellipsis_0.3.1
[53] reshape_0.8.8 pkgconfig_2.0.3
[55] XML_3.99-0.5 R.methodsS3_1.8.1
[57] nnet_7.3-14 dbplyr_2.0.0
[59] locfit_1.5-9.4 utf8_1.1.4
[61] reshape2_1.4.4 tidyselect_1.1.0
[63] rlang_0.4.10 AnnotationDbi_1.53.0
[65] munsell_0.5.0 cellranger_1.1.0
[67] tools_4.1.0 cli_2.2.0
[69] generics_0.1.0 RSQLite_2.2.2
[71] broom_0.7.3 evaluate_0.14
[73] yaml_2.2.1 knitr_1.30
[75] bit64_4.0.5 fs_1.5.0
[77] AnnotationFilter_1.15.0 RBGL_1.67.0
[79] EDASeq_2.25.0 R.oo_1.24.0
[81] xml2_1.3.2 biomaRt_2.47.1
[83] compiler_4.1.0 rstudioapi_0.13
[85] filelock_1.0.2 curl_4.3
[87] png_0.1-7 reprex_0.3.0
[89] stringi_1.5.3 GenomicFeatures_1.43.3
[91] lattice_0.20-41 ProtGenerics_1.23.6
[93] vctrs_0.3.6 pillar_1.4.7
[95] lifecycle_0.2.0 bitops_1.0-6
[97] R6_2.5.0 BiocIO_1.1.2
[99] latticeExtra_0.6-29 hwriter_1.3.2
[101] ShortRead_1.49.1 gridExtra_2.3
[103] dichromat_2.0-0 assertthat_0.2.1
[105] SummarizedExperiment_1.21.1 openssl_1.4.3
[107] rjson_0.2.20 withr_2.3.0
[109] GenomicAlignments_1.27.2 Rsamtools_2.7.0
[111] GenomeInfoDbData_1.2.4 hms_0.5.3
[113] rpart_4.1-15 grid_4.1.0
[115] rmarkdown_2.6 MatrixGenerics_1.3.0
[117] biovizBase_1.39.0 base64enc_0.1-3
[119] lubridate_1.7.9.2 tinytex_0.28
[121] restfulr_0.0.13
Dear James,
I checked my bam file:
if I'm not missing something, the names of the chromosomes start with "chr".