ay-lab / dcHiC

dcHiC: Differential compartment analysis for Hi-C datasets
MIT License
55 stars 10 forks source link

Error during subcompartment calling #77

Closed TH-L closed 8 months ago

TH-L commented 9 months ago

Hi! I encountered the following error while running the subcomp step :

Error in state_score[[j]]$label[chrom_file[, pos_label]] :
  invalid subscript type 'list'
Calls: subcompartment -> hmmsegment
In addition: Warning messages:
1: In is.na(result) : is.na() applied to non-(list or vector) of type 'S4'
2: In is.na(result) : is.na() applied to non-(list or vector) of type 'S4'
3: In is.na(result) : is.na() applied to non-(list or vector) of type 'S4'
4: In is.na(result) : is.na() applied to non-(list or vector) of type 'S4'
5: In is.na(result) : is.na() applied to non-(list or vector) of type 'S4'
6: In is.na(result) : is.na() applied to non-(list or vector) of type 'S4'

I'm using the default settings with the following command:

Rscript dchicf.r --file input.txt --pcatype subcomp --dirovwt T --diffdir Diets

I'm working with different combination of 6 samples, with 2 replicates each. The resolution of my matrices is 50 kb. I'm working with mouse genome.

The rest of the steps work perfectly fine with my data. I hope you can help me understand the source of the error, and what could be done in order to solve it.

Thank you in advance.

ay-lab commented 9 months ago

Hi,

If you're using the latest version of depmixS4 package then can you downgrade the package to this version https://cran.r-project.org/src/contrib/Archive/depmixS4/depmixS4_1.4-2.tar.gz and try it again? I just want to make sure its not about version issue. Thanks.

TH-L commented 9 months ago

Hi again,

I've just used the depmixS4 version you provided, but it returns the same error. Is there anything else I can try or check in my files?

Thanks in advance

ay-lab commented 9 months ago

Do you mind sharing the "fdr_result/differential.intra_sample_group.pcQnm.bedGraph" file with me (abhijit@lji.org)? You can change the sample names in the column and send it to me. I only need the compartment scores to resolve the issue. The error message "invalid subscript type 'list'" typically indicates an issue with data structure. It is hard to dissect the error without looking at the input data. Sorry for the inconvenience.

TH-L commented 9 months ago

I´ve sent you the file. I´ll be waiting for your comments. Please, let me know if you need anything else to understand what´s happening. Thanks a lot for your help.

ay-lab commented 9 months ago

Hi,

Thanks for sending the file.  Unfortunately, I wasn't able to reproduce the error. I managed to run the subcompartment analysis on my side without any issue (with the latest depmixS4 version).  I am not sure what is causing yours to break down.  For you reference, here is my session info - 

>
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Rocky Linux 8.6 (Green Obsidian)

Matrix products: default
BLAS:   /mnt/hpc-apps/R/4.2.2/lib64/R/lib/libRblas.so
LAPACK: /mnt/hpc-apps/R/4.2.2/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] depmixS4_1.5-0 nlme_3.1-162   Rsolnp_1.16    MASS_7.3-58.3  nnet_7.3-18

loaded via a namespace (and not attached):
[1] compiler_4.2.2  parallel_4.2.2  grid_4.2.2      truncnorm_1.0-9
[5] stats4_4.2.2    lattice_0.21-8

let me know if you notice any difference in session. Probably due to some version the issue is appearing.

TH-L commented 9 months ago

I will check for any difference in session. Thanks a lot for your help