add a recipe for a single repeats track with simplified names
ADD
gemini/annotation_provenance/convert-rmsk.py
+import sys
+
+for line in sys.stdin:
+ toks = line.rstrip().split("\t")
+ toks[3] = toks[3].replace("?", "")
+ if toks[3].startswith("DNA"):
+ toks[3] = "DNAtr"
+ elif toks[3] == "Low_complexity_Low_complexity":
+ toks[3] = "LCR"
+ elif toks[3].startswith("LTR"):
+ toks[3] = "LTR"
+ elif "satellite" in toks[3].lower():
+ toks[3] = "satellite"
+ elif toks[3].startswith("Simple_repeat"):
+ toks[3] = "simple"
+ elif toks[3].split("_")[0] == toks[3].split("_")[1]:
+ toks[3] = toks[3].split("_")[0].lower()
+ elif toks[3].startswith("LINE_") and toks[3] not in ("LINE_L1", "LINE_L2"):
+ toks[3] = "LINE"
+ elif toks[3].startswith("SINE_") and toks[3] != "SINE_Alu":
+ toks[3] = "SINE"
+ if toks[3] == "sine":
+ toks[3] = "SINE"
+ if toks[3] == "other":
+ toks[3] = "unknown"
+ print("\t".join(toks))

ADD
gemini/annotation_provenance/make-repeats.sh
+set -e
+wget -O - -q http://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/rmsk.txt.gz \
+ | zcat \
+ | awk '{FS=OFS="\t"; print $6,$7,$8,$12"_"$13}' \
+ | python convert-rmsk.py \
+ > rmsk.bed
+
+wget -O - -q http://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/simpleRepeat.txt.gz \
+ | zcat \
+ | awk 'BEGIN{FS=OFS="\t"}{ print $2,$3,$4,"simple"}' \
+ > simrep.bed
+
+wget -O - -q http://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/microsat.txt.gz \
+ | zcat \
+ | awk 'BEGIN{FS=OFS="\t"}{ print $2,$3,$4,"microsat"}' \
+ > microsat.bed
+
+wget -O - -q http://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/genomicSuperDups.txt.gz \
+ | zcat \
+ | awk 'BEGIN{FS=OFS="\t"}{ print $2,$3,$4,"segdup\n"$8,$9,$10,"segdup" }' \
+ > segdup.bed
+
+cat rmsk.bed simrep.bed microsat.bed segdup.bed \
+ | perl -pe 's/^chr//' \
+ | sort -u -k1,1 -k2,2n \
+ | bgzip \
+ > repeats.37.bed.gz
+tabix -p bed repeats.37.bed.gz
+
+zcat repeats.37.bed.gz | cut -f 4 | perl -pe 's/,/\n/g' | sort | uniq -c

add a recipe for a single repeats track with simplified names