Skip to content

Error with function cnvOncoPrint using a colorectal cancer dataset of 34 WES samples #34

Description

@Jasonmbg

Dear @lgeistlinger,

moving from email where I tried to reach you for a specific error appeared when trying to implement CNVRanger for 34 WES samples from colorectal cancer patients:

briefly, based on an international collaborative project between DKFZ and other Greek research institutions regarding personalized medicine in cancer (http://www.accc.gr/aboutACCC_info.html), we have acquired around 34 samples with DNA and RNA which were sequenced and pre-processed in the DKFZ bioinformatics facility. Overall, my major goal is to investigate, if there any specific mutational patterns in any of the 3 separated groups of patients, that might interrelate the presence of specific mutational patterns (KRASonly, BRAFonly and wild type), as the ultimate goal is to investigate the molecular landscape of these 3 defined groups-we also utilize additionally public TCGA data to enhance our sample size-

My major question would be for the actual analysis of the CNV data from our 34 patients-as already copy number alterations were called with cnvkit, and as a further step purity and ploidy estimated; for a start, I tried to analyze all data collectively, based on the segmented log2 rations, as in your vignette, with the following code:

head(DT)
# A tibble: 6 x 5
  file        chromosome    start       end     log2
  <chr>       <chr>         <int>     <int>    <dbl>
1 CRC_ACCC_01 1             12080   3743427  0.191  
2 CRC_ACCC_01 1           3745760  12942340  0.00996
3 CRC_ACCC_01 1          12942900  13802754 -0.278  
4 CRC_ACCC_01 1          13803254  43766223 -0.0250 
5 CRC_ACCC_01 1          43766723  44684459  0.107  
6 CRC_ACCC_01 1          44684588 103345463 -0.0443 

smean <- DT$log2
state <- round(2^smean * 2)
state[state > 4] <- 4
DT$log2 <- state
names(DT)[names(DT) == "log2"] <- "state"
DT <- DT[DT$state != 2,]
head(DT)
# A tibble: 6 x 5
  file        chromosome     start       end state
  <chr>       <chr>          <int>     <int> <dbl>
1 CRC_ACCC_01 1          109778935 109823258     3
2 CRC_ACCC_01 1          152080055 152329130     3
3 CRC_ACCC_01 2              10500  28856096     3
4 CRC_ACCC_01 2           28863705  71742899     3
5 CRC_ACCC_01 2           71743258  74786985     3
6 CRC_ACCC_01 2           74787273  92325671     3

grl <- GenomicRanges::makeGRangesListFromDataFrame(DT, split.field="file", keep.extra.columns=TRUE)

saveRDS(grl, file = "Input.test.grl.CRC.rds")

grl.2 <- populationRanges(grl, density=0.1, est.recur=FALSE)

sel.freq.grl <- subset(grl.2, freq > 1)

library(EnsDb.Hsapiens.v75)
human.hg19.genes <- ensembldb::genes(EnsDb.Hsapiens.v75)

sel.hg19.genes <- subset(human.hg19.genes, gene_biotype == "protein_coding")

olaps <- GenomicRanges::findOverlaps(sel.hg19.genes, sel.freq.grl, ignore.strand=TRUE)

qh <- S4Vectors::queryHits(olaps)

sh <- S4Vectors::subjectHits(olaps)

cgenes <- sel.hg19.genes[qh]

cgenes$type <- sel.freq.grl$type[sh]

However, initially in the following step of trying the visualization through the function cnvOncoPrint:

cnvOncoPrint(sel.freq.grl, cgenes, top.features=15, top.samples = 34)
Error in as(calls, "RaggedExperiment") : 
  no method or default for coercing "GRanges" to "RaggedExperiment"

cnvOncoPrint(grl, cgenes, top.features=15, top.samples = 34)
Following `at` are removed: GAIN1, GAIN2, because no color was defined for them.
Error: Length of `graphics` should be the same as number of labels.

Thus, in your opinion, how this error could be fixed? It is something wrong with any of the input files? For simplicity I have attached also the initial created GRangeslist object;

sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] EnsDb.Hsapiens.v75_2.99.0 ensembldb_2.17.4          AnnotationFilter_1.17.1  
 [4] GenomicFeatures_1.45.2    AnnotationDbi_1.55.1      Biobase_2.53.0           
 [7] CNVRanger_1.9.0           RaggedExperiment_1.17.4   GenomicRanges_1.45.0     
[10] GenomeInfoDb_1.29.8       IRanges_2.27.2            S4Vectors_0.31.5         
[13] BiocGenerics_0.39.2       data.table_1.14.2         forcats_0.5.1            
[16] stringr_1.4.0             dplyr_1.0.7               purrr_0.3.4              
[19] readr_2.0.2               tidyr_1.1.4               tibble_3.1.5             
[22] ggplot2_3.3.5             tidyverse_1.3.1

Input.test.grl.CRC.rds.zip

With Kind Regards,

Efstathios

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions