ay-lab / dcHiC

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

"Fithic requires a bias file." in "--pcatype fithic" step #39

Closed YiweiNiu closed 1 year ago

YiweiNiu commented 1 year ago

Hi,

Thanks for developing this useful tool.

When running the step of fithic, I got the following error.

Started calculating Marginalized Contact Count
   chr  start    end index extraField mappable    mid correct_index marginalizedContactCount
1 chr1      0 100000     1          0        1  50000             1                        0
2 chr1 100000 200000     2          0        1 150000             2                        0
3 chr1 200000 300000     3          0        1 250000             3                        0
4 chr1 300000 400000     4          0        1 350000             4                        0
5 chr1 400000 500000     5          0        1 450000             5                        0
6 chr1 500000 600000     6          0        1 550000             6                        0
Fithic requires a bias file. Please check the link for more details
https://github.com/ay-lab/fithic
Please generate the bias files for each sample provided in the input.txt file
Create an additional folder 'biases' under current path and dump all the *.biases.gz files inside it
Rerun the step again
Error in FUN(X[[i]], ...) : Exit!
Calls: fithicformat -> lapply -> FUN
Execution halted

I wonder how to specify the bias files for fithic.

Bests, Yiwei

ay-lab commented 1 year ago

Hi Yiwei,

The bias file is the output of a normalization method for HI-C data that contains the bias factors for each bin. See "FitHiC2 bias file format" here for more: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7451401/

Fit-Hi-C has an implementation of the K-R algorithm for normalization out of the box; you can use this to generate the bias files: https://github.com/ay-lab/fithic/blob/master/fithic/utils/HiCKRy.py

YiweiNiu commented 1 year ago

Thanks for your quick reply.

I still have one question, how do I supply the bias files to dcHiC?

I mean, I do not find an command line option to specify the bias file in the fithic step of dchicf.r.

ay-lab commented 1 year ago

See the error output -- you should run these biases and put them in a director 'biases' in the directory that you are running dcHiC

Please generate the bias files for each sample provided in the input.txt file
Create an additional folder 'biases' under current path and dump all the *.biases.gz files inside it

You should create these with the same prefixes specified in input.txt, as the fithic step inside dcHiC looks for bias files using those prefixes: bias<- normalizePath(paste0("biases/",prefix,".biases.gz"))

Let me know if this helps / if any other issues arise!

YiweiNiu commented 1 year ago

Thanks for your reply. Maybe you could modify the readme.md to add this.