PoisonAlien / maftools

Summarize, Analyze and Visualize MAF files from TCGA or in-house studies.
http://bioconductor.org/packages/release/bioc/html/maftools.html
MIT License
440 stars 217 forks source link

Error in .Call2("solve_user_SEW", refwidths, start, end, width, translate.negative.coord #707

Closed huangwb8 closed 3 years ago

huangwb8 commented 3 years ago

Describe the issue Here is the code and error information:

all_maf.tnm <- trinucleotideMatrix(maf =  all_maf, ref_genome = "BSgenome.Hsapiens.UCSC.hg38")
-Extracting 5' and 3' adjacent bases
Error in .Call2("solve_user_SEW", refwidths, start, end, width, translate.negative.coord,  : 
  solving row 115044: 'allow.nonnarrowing' is FALSE and the supplied start (249107064) is > refwidth + 1

I'm sure the reference of my data is hg38.

Actually, my data only have 13136 rows.

nrow(all_maf@data) 
[1] 13136

I don't know where is 'row 115044'.

Session info R version 4.0.3 (2020-10-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 [2] LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 [4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936

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

other attached packages: [1] BSgenome.Hsapiens.UCSC.hg19_1.4.3 [2] BSgenome.Hsapiens.UCSC.hg38_1.4.3 [3] BSgenome_1.56.0
[4] rtracklayer_1.48.0
[5] Biostrings_2.56.0
[6] XVector_0.28.0
[7] maftools_2.4.12
[8] pacman_0.5.1
[9] easyGgplot2_1.0.0.9000
[10] extrafont_0.17
[11] Rmisc_1.5
[12] lattice_0.20-41
[13] data.table_1.13.2
[14] clusterProfiler_3.16.1
[15] cowplot_1.1.0
[16] tableone_0.12.0
[17] SummarizedExperiment_1.18.2
[18] DelayedArray_0.14.1
[19] matrixStats_0.57.0
[20] Biobase_2.48.0
[21] GenomicRanges_1.40.0
[22] GenomeInfoDb_1.24.2
[23] IRanges_2.22.2
[24] S4Vectors_0.26.1
[25] BiocGenerics_0.34.0
[26] stringr_1.4.0
[27] circlize_0.4.10
[28] ggthemes_4.2.0
[29] ggpubr_0.4.0
[30] ggplot2_3.3.2
[31] dplyr_1.0.2
[32] plyr_1.8.6
[33] tidyr_1.1.2
[34] reshape2_1.4.4
[35] readr_1.4.0
[36] writexl_1.3.1
[37] readxl_1.3.1
[38] lucky_1.1.6

loaded via a namespace (and not attached): [1] ModelMetrics_1.2.2.2 exactRankTests_0.8-31
[3] bit64_4.0.5 knitr_1.30
[5] rpart_4.1-15 RCurl_1.98-1.2
[7] doParallel_1.0.16 generics_0.0.2
[9] preprocessCore_1.50.0 usethis_1.6.3
[11] RSQLite_2.2.1 europepmc_0.4
[13] bit_4.0.4 enrichplot_1.8.1
[15] xml2_1.3.2 lubridate_1.7.9
[17] viridis_0.5.1 gower_0.2.2
[19] xfun_0.18 hms_0.5.3
[21] progress_1.2.2 km.ci_0.5-2
[23] igraph_1.2.6 DBI_1.1.0
[25] geneplotter_1.66.0 htmlwidgets_1.5.2
[27] reshape_0.8.8 purrr_0.3.4
[29] ellipsis_0.3.1 backports_1.1.10
[31] survey_4.0 rmda_1.6
[33] annotate_1.66.0 vctrs_0.3.4
[35] abind_1.4-5 caret_6.0-86
[37] withr_2.3.0 ggforce_0.3.2
[39] minerva_1.5.8 triebeard_0.3.0
[41] checkmate_2.0.0 GenomicAlignments_1.24.0 [43] prettyunits_1.1.1 cluster_2.1.0
[45] DOSE_3.14.0 crayon_1.3.4
[47] genefilter_1.70.0 glmnet_4.0-2
[49] edgeR_3.30.3 recipes_0.1.14
[51] pkgconfig_2.0.3 tweenr_1.0.1
[53] nlme_3.1-149 nnet_7.3-14
[55] rlang_0.4.8 lifecycle_0.2.0
[57] downloader_0.4 extrafontdb_1.0
[59] cellranger_1.1.0 polyclip_1.10-0
[61] Matrix_1.2-18 urltools_1.7.3
[63] KMsurv_0.1-5 carData_3.0-4
[65] boot_1.3-25 zoo_1.8-8
[67] base64enc_0.1-3 ggridges_0.5.2
[69] GlobalOptions_0.1.2 png_0.1-7
[71] viridisLite_0.3.0 bitops_1.0-6
[73] pROC_1.16.2 pander_0.6.3
[75] blob_1.2.1 shape_1.4.5
[77] maxstat_0.7-25 qvalue_2.20.0
[79] jpeg_0.1-8.1 rstatix_0.6.0
[81] gridGraphics_0.5-0 ggsignif_0.6.0
[83] scales_1.1.1 memoise_1.1.0
[85] magrittr_1.5 zlibbioc_1.34.0
[87] compiler_4.0.3 scatterpie_0.1.5
[89] RColorBrewer_1.1-2 DESeq2_1.28.1
[91] Rsamtools_2.4.0 htmlTable_2.1.0
[93] Formula_1.2-4 MASS_7.3-53
[95] mgcv_1.8-33 WGCNA_1.69
[97] tidyselect_1.1.0 stringi_1.5.3
[99] forcats_0.5.0 mitools_2.4
[101] GOSemSim_2.14.2 locfit_1.5-9.4
[103] latticeExtra_0.6-29 ggrepel_0.8.2
[105] survMisc_0.5.5 grid_4.0.3
[107] fastmatch_1.1-0 tools_4.0.3
[109] rio_0.5.16 rstudioapi_0.11
[111] foreach_1.5.1 foreign_0.8-80
[113] gridExtra_2.3 prodlim_2019.11.13
[115] farver_2.0.3 ggraph_2.0.3
[117] digest_0.6.26 rvcheck_0.1.8
[119] BiocManager_1.30.10 lava_1.6.8
[121] Rcpp_1.0.5 car_3.0-10
[123] broom_0.7.2 org.Hs.eg.db_3.11.4
[125] httr_1.4.2 survminer_0.4.8
[127] AnnotationDbi_1.50.3 colorspace_1.4-1
[129] rvest_0.3.6 XML_3.99-0.5
[131] fs_1.5.0 splines_4.0.3
[133] graphlayouts_0.7.0 ggplotify_0.0.5
[135] xtable_1.8-4 jsonlite_1.7.1
[137] dynamicTreeCut_1.63-1 tidygraph_1.2.0
[139] timeDate_3043.102 UpSetR_1.4.0
[141] ipred_0.9-9 R6_2.4.1
[143] Hmisc_4.4-1 pillar_1.4.6
[145] htmltools_0.5.0 glue_1.4.2
[147] DT_0.16 BiocParallel_1.22.0
[149] class_7.3-17 codetools_0.2-16
[151] fgsea_1.14.0 mvtnorm_1.1-1
[153] tibble_3.0.4 sva_3.36.0
[155] curl_4.3 zip_2.1.1
[157] GO.db_3.11.4 openxlsx_4.2.2
[159] Rttf2pt1_1.3.8 survival_3.2-7
[161] limma_3.44.3 munsell_0.5.0
[163] DO.db_2.9 fastcluster_1.1.25
[165] GenomeInfoDbData_1.2.3 iterators_1.0.13
[167] impute_1.62.0 haven_2.3.1
[169] gtable_0.3.0

PoisonAlien commented 3 years ago

Hi, The function uses synonymous variants (in all_maf@maf.silent) as well. It is hard to guess the issue, but maybe the problematic row is coming from one of the chrM or unknown contigs?

huangwb8 commented 3 years ago

Hi, The function uses synonymous variants (in all_maf@maf.silent) as well. It is hard to guess the issue, but maybe the problematic row is coming from one of the chrM or unknown contigs?

Hi~Sorry for late reply. I found it suddenly works and I don't know why. I also test chromosome of the MAF object

table(all_maf@maf.silent$Chromosome)
chr1 chr10 chr11 chr12 chr13 chr14 chr15 chr16 chr17 chr18 
26988 12838 15202 15771  5726  9180  9070 10659 14067  4886 
chr19  chr2 chr20 chr21 chr22  chr3  chr4  chr5  chr6  chr7 
16917 20024  7117  3540  5907 15202 11732 11984 12421 13618 
 chr8  chr9  chrX  chrY 
 8867 11209  5018    31 

It seems that no abnormal issues like chrM.

I generate the MAF object via annovar results. Here's the example:

# merge
  all.maf <- annovarToMaf(
    annovar = c("raw/ST1.snp.vcf.gz.hg38_multianno.txt",
                "raw/ST1.indel.vcf.gz.hg38_multianno.txt",
                "raw/ST1_BA.snp.vcf.gz.hg38_multianno.txt",
                "raw/ST1_BA.indel.vcf.gz.hg38_multianno.txt"),
    refBuild = 'hg38', 
    table = 'refGene'
  )

  # clinic data
  clinicalData <- data.frame(
    Tumor_Sample_Barcode = c('ST1', 'ST1_BA'),
    Group = c('tissue', 'organoid'),
    stringsAsFactors = F
  )

  all_maf <- read.maf(maf = all.maf,
                      clinicalData = clinicalData)

I hope it may help someone with similar problem.