Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Added sample code for paired end BAM to fragment bedgraph conversion
  • Loading branch information
mpmeers authored Aug 10, 2019
1 parent 84f7aa6 commit 85d4f18
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ Field 5: Output prefix

Bedgraph files should reflect density across *read pairs* rather than individual reads. If starting from BAM files, we recommend converting to paired end BED files using bedtools bamtobed with the -bedpe flag, then selecting the 5' and 3' coordinates of the read pair to generate a new BED3 file, and finally converting that file to a bedgraph using bedtools genomecov.

Here is some example code for converting from a paired-end BAM to a fragment bedgraph file as described above:

bedtools bamtobed -bedpe -i $sample.bam > $sample.bed
cut -f 1,2,6 $sample.bed > $fragments.bed
bedtools genomecov -i $fragments.bed -g my.genome > $fragments.bedgraph

## Output file:

<output prefix>.stringent.bed OR <output prefix>.relaxed.bed (BED file of enriched regions)
Expand Down

0 comments on commit 85d4f18

Please sign in to comment.