broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
566 stars 166 forks source link

HMM run argument must be explicitly given or infercnv::run gives an error #459

Closed alexanderlewis99 closed 2 years ago

alexanderlewis99 commented 2 years ago

Hi! When I call infercnv::run as shown below, I encounter an error:

infercnv_obj_final <- infercnv::run(
    infercnv_obj_initial,
    cutoff = cutoff,
    # cutoff=1 works well for Smart-seq2
    # cutoff=0.1 works well for 10x Genomics
    out_dir = out_dir,
    cluster_by_groups = TRUE,
    no_plot = TRUE,
    denoise = TRUE,
    diagnostics = TRUE,
    png_res = 500,
    cluster_references = FALSE
  )

The error is shown as follows:

INFO [2022-09-15 16:59:19] ::process_data:Start
Error in if (run_arguments$HMM) { : argument is of length zero

I found that the way to resolve the error is by including HMM = FALSE (or HMM = TRUE) in the run function as shown below.

infercnv_obj_final <- infercnv::run(
    infercnv_obj_initial,
    cutoff = cutoff,
    # cutoff=1 works well for Smart-seq2
    # cutoff=0.1 works well for 10x Genomics
    out_dir = out_dir,
    cluster_by_groups = TRUE,
    no_plot = TRUE,
    denoise = TRUE,
    diagnostics = TRUE,
    png_res = 500,
    cluster_references = FALSE,
    HMM = FALSE
  )

If I do not explicitly give the HMM parameter to the run function, which I had thought should simply default to FALSE due to the R Documentation, I receive the error. This seems like a bug of some sort to me, so I thought I should report it here. I should also mention that this did not happen when I was using a previous version of InferCNV (InferCNV 1.6 with R 4.0.1), but only occurred when I updated R and InferCNV today (InferCNV 1.12 with R 4.2.1).

GeorgescuC commented 2 years ago

Hi @alexanderlewis99 ,

The issue should actually be fixed in the very next commit after the release of v1.12 . The new version that includes it among other things should be released soon.

Regards, Christophe.

alexanderlewis99 commented 2 years ago

That is good to hear! Thanks for addressing this. Have a great day!