71b469a98a76ff8be8ab09ff421471f0e4d71351
chmalee
  Tue Mar 3 14:48:45 2020 -0800
Quick run up of gnomAD structural variants track for hg19, refs #24179

diff --git src/hg/makeDb/doc/hg19.txt src/hg/makeDb/doc/hg19.txt
index 6b7647b..f438497 100644
--- src/hg/makeDb/doc/hg19.txt
+++ src/hg/makeDb/doc/hg19.txt
@@ -34214,15 +34214,47 @@
         remap.hg19.hg38.chain
 #real    5m55.241s
     hgLoadChain hg19 -tIndex chainHg38ReMap remap.hg19.hg38.chain
 #Loading 5315 chains into hg19.chainHg38ReMap
     # Chaining the ReMap alignments makes it a lot easier to see when separate alignments
     # to the same sequence are in the same order and orientation.
     time axtChain -psl -linearGap=medium -verbose=0 remap.hg19.hg38.psl \
       /hive/data/genomes/hg19/hg19.2bit /hive/data/genomes/hg38/hg38.2bit \
       remap.axtChain.hg19.hg38.chain
 #real    1m41.773s
     hgLoadChain hg19 -tIndex chainHg38ReMapAxtChain remap.axtChain.hg19.hg38.chain
 #Loading 2141 chains into hg19.chainHg38ReMapAxtChain
 
 
 ##############################################################################
+# gnomAD Structural Variants v2.1 - ChrisL
+# Redmine #24179
+
+    cd /hive/data/outside/gnomAD.2/
+    mkdir structuralVariants
+
+    gsutil cp gs://gnomad-public/papers/2019-sv/gnomad_v2.1_sv.*.bed* .
+    gsutil cp gs://gnomad-public/papers/2019-sv/gnomad_v2.1_sv.*.vcf* .
+
+    for f in *.bed.gz; do out=${f/.bed.gz/}; zcat $f | tail -n +2 | cut -f1-4,32 | tawk '{$1="chr"$1; print $0}'> $out.bed4Plus; done
+    # variant types:
+    zcat gnomad_v2.1_sv.sites.bed.gz | cut -f32 | sort | uniq -c       
+      52604 BND y
+       4778 CPX x 
+          8 CTX y
+     169635 DEL x 
+      49571 DUP x 
+     109025 INS x 
+        748 INV x 
+       1108 MCNV x
+          1 SVTYPE
+
+    # add colors based on gnomad website and get in to proper bed9+
+    for f in *.bed4Plus; do out=${f/.bed4Plus/}; bedClip -truncate $f $chromSizes stdout | ./gnomadSvToUcsc.awk | sort -k1,1 -k2,2n > $out.bed9Plus; done
+
+    chromSizes=/hive/data/genomes/hg19/chrom.sizes
+    for f in *.bed9Plus; do out=${f/.bed9Plus/}; bedToBigBed -tab -type=bed9+1 -as=gnomadSv.as $f $chromSizes $out.bb; done
+    mkdir -p /gbdb/hg19/gnomAD/structuralVariants/ 
+    cd /gbdb/hg19/gnomAD/structuralVariants/
+    cp -s /hive/data/outside/gnomAD.2/structuralVariants/*.bb .
+
+##############################################################################