mskilab-org / dryclean

Irons out wrinkles in noisy coverage data using robust PCA
12 stars 14 forks source link

"Error in m.vec - s : non-conformable arrays" when running the tutorial #8

Closed tinyheero closed 2 years ago

tinyheero commented 2 years ago

Hi,

I've tried to follow the tutorial to run dryclean on tumor sample within R but have run into this error:

Error in m.vec - s : non-conformable arrays

What I have run is:

# Install the latest version of dryclean
devtools::install_github("mskilab/dryclean", ref = "87a1a4f")

#
# Start of the tutorial
#
options(warn = 1)
library("dryclean")
library("magrittr")
library("GenomicRanges")

normal_dt <-
  data.frame(sample = c("samp1", "samp2", "samp3")) %>%
  dplyr::mutate(
    normal_cov =
      system.file(
        "extdata", paste0(.data[["sample"]], ".rds"), package = "dryclean"
      ),
  ) %>%
  data.table::setDT()

saveRDS(normal_dt, "normal_table.rds")

dir.create("detergent", showWarnings = FALSE)

# use.all: Use all samples
# save.pon: Saves the PoN (detergent) to the destinated folder
detergent <-
  prepare_detergent(
    normal.table.path = "normal_table.rds",
    path.to.save = "detergent",
    num.cores = 1,
    use.all = TRUE,
    save.pon = TRUE
  )

# Running dryclean on tumor sample within R
coverage_file <-
  readRDS(system.file("extdata", "dummy_coverage.rds", package = "dryclean"))
cov_out <-
  start_wash_cycle(
    cov = coverage_file,
    detergent.pon.path = file.path("detergent", "detergent.rds"),
    whole_genome = TRUE,
    chr = NA,
  )

This was the output:

Starting the preparation of Panel of Normal samples a.k.a detergent
3 samples available
Using all samples
Balancing pre-decomposition
PAR file not provided, using hg19 default.
If this is not the correct build, please provide a GRange object delineating for corresponding build
PAR read
Checking for existence of files
3 files present
  |=================================================================================================================================================================================================================================
Warning in .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)
Starting decomposition
This is version 2
Finished making the PON or detergent and saving it to the path provided

Loading PON a.k.a detergent from path provided
Let's begin, this is whole exome/genome
Initializing wash cycle
Using the detergent provided to start washing
lambdas calculated
calculating A and B
calculating v and s
Error in m.vec - s : non-conformable arrays

Any idea what is wrong?

asd1289 commented 2 years ago

It was a simple case of wrong dummy file pushed to GitHub. I have rectified this and updated the tutorial plus added some warning suppression. Locally all tests are passing and Travis is currently running. I will keep the issue open for a while, if there are other issues with install and tutorial. Thanks for reporting.

tinyheero commented 2 years ago

Thanks @asd1289! Sorry for the lack of reply. I'll take a look at this again and get back to you if I run into any issues.

Congratulations on the paper https://www.biorxiv.org/content/10.1101/2022.01.17.476508v1. Nice to see the dryclean technique being used for plasma read depth denoising.

tmrnov commented 5 months ago

Hi. I have the same problem. Both with dummy data provided and my data. It seems that m.vec and s variables have different size. Any help? @asd1289