Example 1. Matching peaks within the promoter (2.5 Kbp upstream of TSS) and the body of mouse genes.
> # Full output: peaks and genes
> bin/matchpeaksgenes -v -u 2500 H3K4me3_peaks.bed refGene.txt > H3K4me3_RefSeq_output.txt
> # List of target genes
> bin/matchpeaksgenes -v -u 2500 H3K4me3_peaks.bed refGene.txt | gawk '{print $5}' | sort | uniq > H3K4me3_RefSeq_target-genes.txt
> # Custom tracks for UCSC genome browser
> gawk 'BEGIN{OFS="\t"; print "track name=overlap_peaks color=200,100,0";}{print $1,$2,$3,$4}' H3K4me3_RefSeq_output.txt > H3K4me3_RefSeq_PEAKS.txt
> gawk 'BEGIN{OFS="\t"; print "track name=overlap_genes color=0,100,0";}{print $7,$9,$10,$5"-"$6}' H3K4me3_RefSeq_output.txt > H3K4me3_RefSeq_GENES.txt
UCSC genome browser screenshot:
Example 2. Matching peaks within the promoter (excluding the body of target genes).
bin/matchpeaksgenes -v -U 2500 H3K4me3_peaks.bed refGene.txt > H3K4me3_RefSeq_2_output.txt
UCSC genome browser screenshot:
Example 3. Matching peaks within +/- 500 bps around the TSS.
bin/matchpeaksgenes -v -s 500 H3K4me3_peaks.bed refGene.txt > H3K4me3_RefSeq_3_output.txt
UCSC genome browser screenshot: