ay-lab / dcHiC

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

Error in aggregate.data.frame(lhs, mf[-1L], FUN = FUN, ...) : #103

Closed jiangshan529 closed 2 months ago

jiangshan529 commented 2 months ago

Hi, from the first step, I met the error: 1 0 37359634 2 100000 5515083 3 200000 2203511 4 300000 1377382 5 400000 932473 6 500000 653007 A B Weight chr1 pos1 chr2 pos2 dist WeightOE 1: 27377 27377 13206 chr9 0 chr9 0 0 0.4892206 2: 27377 27378 1760 chr9 0 chr9 100000 100000 0.4413497 3: 27377 27379 618 chr9 0 chr9 200000 200000 0.3875978 4: 27377 27380 259 chr9 0 chr9 300000 300000 0.2596803 5: 27377 27381 156 chr9 0 chr9 400000 400000 0.2308700 6: 27377 27382 150 chr9 0 chr9 500000 500000 0.3167654 [1] 512890 [1] 133100000 [1] 512890 Writing chr9 .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.

this is how the current folder looks like: (dchic) root@ray-mergehic-bc17-head-82e601a4-compute:/home/gcpuser/sky_workdir/dchic/compartment# ls -lh total 6.4G drwxr-xr-x 3 root root 4.0K Sep 21 00:28 Hct_wt_1.5b_100K_pca -rw-r--r-- 1 root root 191 Sep 21 00:27 compare.txt -rw-r--r-- 1 root root 3.2G Sep 21 00:26 hct_ko_1.5b_100000.matrix -rw-r--r-- 1 root root 890K Sep 21 00:25 hct_ko_1.5b_100000_abs.bed -rw-r--r-- 1 root root 3.2G Sep 21 00:26 hct_wt_1.5b_100000.matrix -rw-r--r-- 1 root root 890K Sep 21 00:25 hct_wt_1.5b_100000_abs.bed drwxr-xr-x 2 root root 4.0K Sep 21 00:32 hg38_100000_goldenpathData -rw------- 1 root root 21K Sep 21 00:32 nohup.out -rw-r--r-- 1 root root 384 Sep 21 00:29 work.sh

compare.txt is like this: hct_wt_1.5b_100000.matrix hct_wt_1.5b_100000_abs.bed Hct_wt_1.5b_100K hct_wt_1 hct_ko_1.5b_100000.matrix hct_ko_1.5b_100000_abs.bed HCT_ko_1.5b_100K hct_koJ_1

Hope we can solve this soon!

ay-lab commented 2 months ago

It looks like there is a chromosome with no contact information in the matrix file but has coordinates in the bed file. If the bed file sorted, then chrX should come after chr9 (assuming it is human). Can you double check that?

jiangshan529 commented 2 months ago

image yes, in the bed file, chrX is after chr9

ay-lab commented 2 months ago

Ah!! Please remove chrM (chrY too if it's there). It will resolve the issue!

jiangshan529 commented 2 months ago

Ah!! Please remove chrM (chrY too if it's there). It will resolve the issue!

Hi, thanks. so now the first command works. Rscript ../dcHiC/dchicf.r --file compare.txt --pcatype cis --dirovwt T --cthread 1 --pthread 1

But the second command failed:

Rscript ../dcHiC/dchicf.r --file compare.txt --pcatype select --dirovwt T --genome hg38 Running intra chr1 in Hct_wt_1.5b_100K sample Running intra chr10 in Hct_wt_1.5b_100K sample Running intra chr11 in Hct_wt_1.5b_100K sample Running intra chr12 in Hct_wt_1.5b_100K sample Running intra chr13 in Hct_wt_1.5b_100K sample Running intra chr14 in Hct_wt_1.5b_100K sample Running intra chr15 in Hct_wt_1.5b_100K sample Running intra chr16 in Hct_wt_1.5b_100K sample Running intra chr17 in Hct_wt_1.5b_100K sample Running intra chr18 in Hct_wt_1.5b_100K sample Running intra chr19 in Hct_wt_1.5b_100K sample Running intra chr2 in Hct_wt_1.5b_100K sample Running intra chr20 in Hct_wt_1.5b_100K sample Running intra chr21 in Hct_wt_1.5b_100K sample Running intra chr22 in Hct_wt_1.5b_100K sample Running intra chr3 in Hct_wt_1.5b_100K sample Running intra chr4 in Hct_wt_1.5b_100K sample Running intra chr5 in Hct_wt_1.5b_100K sample Running intra chr6 in Hct_wt_1.5b_100K sample Running intra chr7 in Hct_wt_1.5b_100K sample Running intra chr8 in Hct_wt_1.5b_100K sample Running intra chr9 in Hct_wt_1.5b_100K sample Running intra chrX in Hct_wt_1.5b_100K sample Running cp Hct_wt_1_pca/intra_pca/Hct_wt_1_mat/chr1.5b_100K.bedGraph Hct_wt_1_pca/intra_pca/Hct_wt_1_mat/chr1.pc.bedGraph cp: cannot stat 'Hct_wt_1_pca/intra_pca/Hct_wt_1_mat/chr1.5b_100K.bedGraph': No such file or directory

ay-lab commented 2 months ago

I suggest deleting all the previous files, and folders and rerunning it. Sometimes, dcHiC detects old files and tries to reuse them instead of creating them again. Will be helpful for debugging.

jiangshan529 commented 2 months ago

Fantastic! Thank you!

On Thu, Sep 26, 2024 at 1:30 PM ay-lab @.***> wrote:

I suggest deleting all the previous files, and folders and rerunning it. Sometimes, dcHiC detects old files and tries to reuse them instead of creating them again. Will be helpful for debugging.

— Reply to this email directly, view it on GitHub https://github.com/ay-lab/dcHiC/issues/103#issuecomment-2377542369, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR5WZOXD74NUGGBISTE4SCLZYRAEVAVCNFSM6AAAAABOTC25UKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZXGU2DEMZWHE . You are receiving this because you authored the thread.Message ID: @.***>