ay-lab / dcHiC

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

Modality cis issues and target folder definition #37

Closed sebastian-gregoricchio closed 2 years ago

sebastian-gregoricchio commented 2 years ago

Dear all, I am trying to implement your tool in a snakemake pipeline (git clone from 2nd Aug 2022).

I just noticed that it would have been nice if there was an option to define in which folder the outputs should be stored (similar to diffdir one) without to have to move by cd in the corresponding folder.

Secondly, I tried to run the tool with the following parameters:

$CONDA_PREFIX/bin/Rscript /home/user/dcHiC/dchicf.r \
--cthread 4 \
--pthread 2 \
--file path/to/dcHiC_input_file_individual_samples_100kb.txt \
--pcatype cis \
--genome hg19

The package starts to run, however I got this error at the first sample:

[... previous output ...]

Writing  chr22 .txt file
Calculating expected counts from chromosome wise background
    dist    Weight
1      0 64258.297
2 100000 32765.346
3 200000 15516.227
4 300000 10023.904
5 400000  7032.697
6 500000  5212.232
       A     B     Weight  chr1    pos1  chr2     pos2    dist  WeightOE
1: 30587 30587 291.567129 chr21 9800000 chr21  9800000       0 2.1870383
2: 30587 30598   2.745532 chr21 9800000 chr21 10900000 1100000 0.8365094
3: 30587 30599   3.772637 chr21 9800000 chr21 11000000 1200000 1.3208504
4: 30587 30644   2.080144 chr21 9800000 chr21 15500000 5700000 5.4256370
5: 30587 30658   1.589394 chr21 9800000 chr21 16900000 7100000 5.3436055
6: 30587 30664   1.550337 chr21 9800000 chr21 17500000 7700000 5.5577334
[1] 25335
[1] 2500000
[1] 25335
Writing  chr21 .txt file
Calculating expected counts from chromosome wise background
Error in aggregate.data.frame(lhs, mf[-1L], FUN = FUN, ...) : 
  no rows to aggregate
Calls: lapply ... aggregate -> aggregate.formula -> aggregate.data.frame
Execution halted

I was wondering whether with remove "non canonical" chromosomes is sufficient to not encounter this error?

Thanks in advance!

ay-lab commented 2 years ago

Hi,

Thanks for implementing the tool. Yes, it is recommended to remove non-canonical chromosomes like chrM and chrY etc. It may create issues like the one you're facing. Thanks for the suggestion, we will add the destination folder in the next release soon.