Hi,
I would like to know which of the DB found by CSAW are going up due the treatment and which are going down. Is it possible to save those results into different bed or tsv files?
Thanks a lot!
Sergio
Hi,
I would like to know which of the DB found by CSAW are going up due the treatment and which are going down. Is it possible to save those results into different bed or tsv files?
Thanks a lot!
Sergio
You have two options for defining the direction of DB in a genomic region (i.e., cluster of windows). The first is to use the output of combineTests
, where you can compare the number of logFC.up
windows to the number in logFC.down
. If there's more up than down, then the region is defined as being up, and vice versa.
The second option is to use the behaviour of the best window as a representative of the entire cluster. This is done by using the output of getBestTest
, and taking the sign of the logFC
field. This should be equivalent to the approach above for simple DB with consistent change throughout the region.
Note that the concept of a single direction of change is less obvious for complex DB where there might be multiple different changes throughout a given genomic region. If you're interested in these types of changes, they can be diagnosed by observing non-negligible numbers of up and down windows from the output of combineTests
.
In any case, you should end up with a logical vector specifying which regions are going up/down. Assuming you've formed some sort of data.frame
of results (see Section 7.2 of the user's guide), you can simply subset this according to the direction of DB and save each subset separately to different files.
Thanks Aaron! In fact Csaw seems to be a really nice tool, congrats! But it needs a lot of reading and testing! (I have suffered a bit..being honest, lacking still a lot of ChIPs to analyse....). The good thing is that it seems to be more accurate compared to peak-caller dependent methods, and thats good. But for some ChIPs.....it can be tough!
I personally liked the documentation update where you put first the filtering steps previous the normalisation, I am agree with that change.
Concerning my question, I finally did it this way:
up<-tab.best$logFC>0
require(rtracklayer)
test_up<-merged$region[up]
test_up$score<-tab.best$logFC[up]
names(test_up)<-paste0("region", 1:sum(up))
export(test_up,"file_up.bed")
down<-tab.best$logFC<0
require(rtracklayer)
test_down<-merged$region[down]
test_down$score<-tab.best$logFC[down]
names(test_down)<-paste0("region", 1:sum(down))
export(test_down,"file_down.bed")
I think is fine, but please correct me if not. The bed files can be used for GO analysis (such as GREAT, or ChIPEnrich). Need a bit of formatting anyway , as follows:
awk -F' ' '{print $1"\t"$2"\t"$3"\t"$4}' file_up.bed > GO_file_up.bed
Hope this can be useful for some other users, with similar proposes!
Thanks again! Kind regards,
Sergio
Hi,
I have one question about gain and loss of enrichment with CSAW. Our bam files are:
bam.files <- c("sample1_rep1.bam", "sample1_rep2.bam", "sample2_rep1.bam")
I would like to know at which files are corresponding “up” regions detected by CSAW : it is sample1 or sample2 in this case ?
Thanks a lot !
Joanna
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Looks good to me. I'm glad you find
csaw
useful; good luck with the rest of your analyses.