From 082d6c590be552c9ddf1bc50e490994c1c0720ba Mon Sep 17 00:00:00 2001
From: Giulio <gformenti@rockefeller.edu>
Date: Sat, 20 Mar 2021 23:29:12 -0400
Subject: [PATCH] Create Kstar_correlation.sh

---
 scripts/Kstar_correlation.sh | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 scripts/Kstar_correlation.sh

diff --git a/scripts/Kstar_correlation.sh b/scripts/Kstar_correlation.sh
new file mode 100644
index 0000000..34e6476
--- /dev/null
+++ b/scripts/Kstar_correlation.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+#cut -f3-5 ${2} | paste ${1} - | awk '{if($3==0){a="NA"}else{a=$5};if($6==0){b="NA"}else{b=$8}; print a"\t"b}' | sort -nk1 -nk2 | uniq -c | sed "s/^[ ]*//" | tr -s " " | tr [:blank:] \\t
+
+cut -f3-5 ${2} | paste ${1} - | awk '{if($3==0){a="NA"}else{a=$5};if($6==0){b="NA"}else{b=$8}; dups[a"\t"b]++} END{for (num in dups) {printf dups[num]"\t"num"\n"}}' | sort -nrk1 -nk2