This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Identifying differential methylation regions

Hello Everyone, I am working with our own data of methyl-seq. I have made a file which has format :

Chr Start_window End_window Difference_bw_methylation_of_two_genptypes

This file is an overlapping file which means 0 to 300bps and 200bps to 500bps (100bps overlapping) Now i want to make regions of about 1kb or 2kb which can be annotated and easily visualized.

Correction in Question I wants to make the overlapping windows to Methylated regions

**Input data**:

 1. 1    540600  540900  -29.1 
 2. 1    540700  541000  -31 
 3. 1    1184500 1184800 -10 
 4. 1    1455900 1456200 -12.9 
 5. 1    1456000 1456300 -12.2 
 6. 1    1456100 1456400 -13

**OutPut format**:

1. 1  540600   541000 -30.5
2. 1  1184500 1184800  -10
3. 1  1445900  1456400  -12.7

Thanks Chandan Kumar

methyl-seq

Please provide representative input and desired output.

Correction in Question I wants to make the overlapping windows to Methylated regions

Input data:

  1. 1 540600 540900 -29.1
  2. 1 540700 541000 -31
  3. 1 1184500 1184800 -10
  4. 1 1455900 1456200 -12.9
  5. 1 1456000 1456300 -12.2
  6. 1 1456100 1456400 -13

OutPut format:

  1. 1 540600 541000 -30.5
  2. 1 1184500 1184800 -10
  3. 1 1445900 1456400 -12.7

1 answer

$ cat test.bed 
1   540600  540900  -29.1
1   540700  541000  -31
1   1184500 1184800 -10
1   1455900 1456200 -12.9
1   1456000 1456300 -12.2
1   1456100 1456400 -13

$ bedtools merge -i test.bed -c 4 -o mean
1   540600  541000  -30.05
1   1184500 1184800 -10
1   1455900 1456400 -12.7

Be sure your file is tab-delimited. https://github.com/arq5x/bedtools2

Log in to answer this question.