-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_Jaccard_heatmap.sh
More file actions
41 lines (30 loc) · 1.25 KB
/
03_Jaccard_heatmap.sh
File metadata and controls
41 lines (30 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#***********************************#
# ATAC-Seq pipeline - PAIR-END #
# script: 11_ccard_heatmap.sh #
# script: 11_jaccard_heatmap.R #
#***********************************#
# 9. Quality Control of Consensus Peaks - Measuring dataset similarity
# Similarity between cell types
#Input directory BAM files
In_Dir="project/consensus/bed"
#Output directory
Out_Dir="project/consensus/bed"
# Measuring dataset similarity (Jaccard)
# https://github.com/arq5x/bedtools-protocols/blob/master/bedtools.md#bp6--measuring-dataset-similarity
file_labels=`ls $In_Dir | grep .bed`
echo name" "$file_labels > $Out_Dir/pairwise_jaccard.txt
for file1 in `ls $In_Dir | grep .bed`
do
echo -n $file1 >> $Out_Dir/pairwise_jaccard.txt
for file2 in `ls $In_Dir | grep .bed`;
do
echo $file2
# compute the jaccard stat for these two files.
jaccard=`/opt/homebrew/bin/bedtools jaccard -a $In_Dir/$file1 -b $In_Dir/$file2`
echo -n $jaccard
# report the jaccard stat for these two files
value_jaccard=$(echo $jaccard | cut -d " " -f 7)
echo -n " "$value_jaccard >> $Out_Dir/pairwise_jaccard.txt
done
echo "\n" >> $Out_Dir/pairwise_jaccard.txt
done