ay-lab / dcHiC

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

In function `geneEnrichment`, the "pcQnm" bedgraph is loaded when `pcgrp `= "pcOri" — is this correct? #86

Closed kalavattam closed 8 months ago

kalavattam commented 8 months ago

Hi all,

Thanks again for making and maintaining this great tool. I have a question about the code associated with the function geneEnrichment in dchicf.r.

At lines 2384–2387, we see the following, in which variable pcgrp defaults to "pcOri" (non-quantile-normalized score values) when variable exclA is set to FALSE:

if (exclA == FALSE & pcgrp == "pcQnm") {
    pcgrp <- "pcOri"
    cat ("exclA is set to False, changing pcgroup from pcQnm to pcOri\n")
}

In lines 2444–2471, we see the "pcQnm" (quantile-normalized score values) bedgraph file is loaded rather than the "pcOri" bedgraph, despite pcgrp being set to "pcOri":

if (exclA == FALSE & pcgrp == "pcOri") {
    compartment_score_pcQnm <- read.table(paste0("DifferentialResult/",diffdir,"/fdr_result/differential.",interaction,"_sample_group.pcQnm.bedGraph"), h=T, as.is=T)
    diff_compartments_pcQnm <- read.table(paste0("DifferentialResult/",diffdir,"/fdr_result/differential.",interaction,"_sample_group.Filtered.pcQnm.bedGraph"), h=T, as.is=T)
    rownames(compartment_score_pcQnm) <- paste0(compartment_score_pcQnm$chr,"_",compartment_score_pcQnm$start)
    rownames(diff_compartments_pcQnm) <- paste0(diff_compartments_pcQnm$chr,"_",diff_compartments_pcQnm$start)
...

I just want to double check if this is intentional. Thank you.

ay-lab commented 8 months ago

Hi,

Thanks for catching the issue. I have fixed and updated the code with the proper files. You can download the code and rerun it. Although, this shouldn't cause any difference in the result. As the exclA option was set to false, dcHiC is only checking if the pc-score of a sample is higher than rest of the samples. This should be true regardless of the file used given it is compared within the same category. Thanks again for catching this.

kalavattam commented 8 months ago

Makes sense. Thanks again!

On Wed, Jan 10, 2024 at 6:53 PM ay-lab @.***> wrote:

Hi,

Thanks for catching the issue. I have fixed and updated the code with the proper files. You can download the code and rerun it. Although, this shouldn't cause any difference in the result. As the exclA option was set to false, dcHiC is only checking if the pc-score of a sample is higher than rest of the samples. This should be true regardless of the file used given it is compared within the same category. Thanks again for catching this.

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