CSAW: GAIN and LOSS of enrichment
4
0
Entering edit mode
@sergioespeso-gil-6997
Last seen 4.1 years ago
New York

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

 

csaw • 1.4k views
ADD COMMENT
1
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 4 hours ago
The city by the bay

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.

ADD COMMENT
0
Entering edit mode
@sergioespeso-gil-6997
Last seen 4.1 years ago
New York

Thanks  Aaron, I will try!

 

 

ADD COMMENT
0
Entering edit mode
@sergioespeso-gil-6997
Last seen 4.1 years ago
New York

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

 


 

 

ADD COMMENT
0
Entering edit mode

Looks good to me. I'm glad you find csaw useful; good luck with the rest of your analyses.

ADD REPLY
0
Entering edit mode
JoannaF ▴ 10
@joannaf-9881
Last seen 2.7 years ago
France

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

ADD COMMENT
1
Entering edit mode

Please post your question as a separate post. Also, you'll need to show your design matrix and what code you used to do the QL F-test (or whatever significance test you used).

ADD REPLY
0
Entering edit mode

Thanks a lot for your answer ! The new post with my question and the R code is: "CSAW : at which bam files are corresponding “up” regions".

Kind regards,

Joanna

ADD REPLY

Login before adding your answer.

Traffic: 1034 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6