99599c7130790107ff0de9f043930da6aa7fddf1
angie
  Mon Nov 16 16:35:58 2020 -0800
Scripts for automating SARS-CoV-2 Phylogeny tracks (refs #26530): fetching
sequences and metadata from several public sources, mapping GISAID IDs to
public seq IDs, downloading the latest release of the phylogenetic tree from
github.com/roblanf/sarscov2phylo/ , making VCFs from GISAID and public
sequences, and using github.com/yatisht/usher to resolve ambiguous alleles,
make protobuf files for hgPhyloPlace, and add public sequences that have not
been mapped to GISAID sequences to the sarscov2phylo tree for a comprehensive
public tree+VCF.

This is still not fully otto-mated because certain crucial inputs like
GISAID sequences still must be downloaded using a web browser, but the goal
is to automate as much as possible and maybe someday have it fully cron-driven.

There are two main top-level scripts which call other scripts, which may in turn
call scripts, in this hierarchy:

updateIdMapping.sh
getCogUk.sh
getNcbi.sh
searchAllSarsCov2BioSample.sh
bioSampleIdToText.sh
bioSampleTextToTab.pl
gbMetadataAddBioSample.pl
fixNcbiFastaNames.pl

updateSarsCov2Phylo.sh
getRelease.sh
processRelease.sh
cladeLineageColors.pl
mapPublic.sh
extractUnmappedPublic.sh
addUnmappedPublic.sh

many of the above:
util.sh

publicCredits.sh will hopefully be folded into updateSarsCov2Phylo.sh when I
figure out how to automate fetching of author/institution metadata from NCBI
and COG-UK.

diff --git src/hg/utils/otto/sarscov2phylo/updateSarsCov2Phylo.sh src/hg/utils/otto/sarscov2phylo/updateSarsCov2Phylo.sh
new file mode 100755
index 0000000..76ce0cc
--- /dev/null
+++ src/hg/utils/otto/sarscov2phylo/updateSarsCov2Phylo.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+set -beEu -x -o pipefail
+
+#	Do not modify this script, modify the source tree copy:
+#	kent/src/hg/utils/otto/sarscov2phylo/updateSarsCov2Phylo.sh
+
+usage() {
+    echo "usage: $0 releaseLabel metadata_date.tsv.gz sequences_date.fasta.gz epiToPublicAndDate.date"
+}
+
+if [ $# != 4 ]; then
+  usage
+  exit 1
+fi
+
+releaseLabel=$1
+nextmeta=$2
+nextfasta=$3
+epiToPublic=$4
+
+scriptDir=$(dirname "${BASH_SOURCE[0]}")
+ottoDir=/hive/data/outside/otto/sarscov2phylo
+problematicSitesVcf=/hive/data/genomes/wuhCor1/bed/problematicSites/20-08-26/problematic_sites_sarsCov2.vcf
+genbankFa=$ottoDir/ncbi.latest/genbank.fa.xz
+cogUkFa=$ottoDir/cogUk.latest/cog_all.fasta.xz
+cncbFa=$ottoDir/cncb.latest/cncb.nonGenBank.fasta
+
+mkdir -p $ottoDir/$releaseLabel
+cd $ottoDir/$releaseLabel
+
+$scriptDir/getRelease.sh $releaseLabel $nextmeta $nextfasta >& getRelease.log
+
+$scriptDir/processRelease.sh $releaseLabel $problematicSitesVcf >& processRelease.log
+
+$scriptDir/mapPublic.sh $releaseLabel $problematicSitesVcf $epiToPublic >& mapPublic.log
+
+$scriptDir/extractUnmappedPublic.sh $epiToPublic $genbankFa $cogUkFa $cncbFa \
+    >& extractUnmappedPublic.log
+
+$scriptDir/addUnmappedPublic.sh $releaseLabel >& addUnmappedPublic.log