Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleclick here to see the bedtools merge code and output
Code Block
languagebash
titlesolution code
bedtools merge -s -c 4,5,6 -o count_distinct,sum,distinct -i yeast_pairedend_sort.mapped.q1.bed > yeast_pairedend_sort.mapped.q1.merge.bed
more yeast_pairedend_sort.mapped.q1.merge.bed
wc -l yeast_pairedend_sort.mapped.q1.merge.bed

#without strand considered
bedtools merge -c 4,5,6 -o count_distinct,sum,distinct -i yeast_pairedend_sort.mapped.q1.bed > yeast_pairedend_sort.noStrand.mapped.q1.merge.bed
Code Block
languagebash
wc -l yeast_pairedend_sort.mapped.q1.merge.bed
40319 yeast_pairedend_sort.mapped.q1.merge.bed #without the -s option
76601 yeast_pairedend_sort.mapped.q1.merge.bed #with the -s option

more yeast_pairedend_sort.mapped.q1.merge.bed 
chrI    219     344     2+    662     +66
chrI    368     469     1-    291     -29
chrI    684     785     1-    371     -37
chrI    871     955     + 6   6 174    +174
chrI    971     1079    7-    2117     -211
chrI    1216    1322    + 6   6 157    +157
chrI    1347    1437    - 6   6 157    -157
chrI    2892    2993    + 14   40614    +406
chrI    3010    3111    1+    371     +37
chrI    3013    3107    -    14    406

more yeast_pairedend_sort.noStrand.mapped.q1.merge.bed
chrI    219     344     2     66     +
chrI    368     469     1     29     -
chrI    684     785     1     37     -
chrI    871     955     6     174    +
chrI    971     1079    7     211    -
chrI    1216    1322    6     157    +
chrI    1347    1437    6     157    -
chrI    2892    2993    14    406    +
chrI    3010    3111    15    443    +,-

bedtools intersect: identifying where two experiments overlap (or don't overlap)

...