47df01a42e26269a5c952013a35cb5633e3c0f45 angie Tue Jun 3 11:10:06 2025 -0700 Check for existence of bedGraph file before running bedGraphToBigWig. diff --git src/hg/utils/otto/nextstrainNcov/doUpdate.sh src/hg/utils/otto/nextstrainNcov/doUpdate.sh index 1afd407ae34..152ee32d2e0 100755 --- src/hg/utils/otto/nextstrainNcov/doUpdate.sh +++ src/hg/utils/otto/nextstrainNcov/doUpdate.sh @@ -75,31 +75,33 @@ nextstrainInformative.bb # bigWig for the tree parsimony scores track for David bedGraphToBigWig nextstrainParsimony.bedGraph $chromSizes nextstrainParsimony.bw # Max's nextstrainSamples*.bedGraph allele count bigWigs: for i in nextstrainSamples*.vcf.gz; do base=`basename $i .vcf.gz` zcat $i \ | grep -v '#' \ | perl -wne '@w=split("\t"); $w[7] =~ m/AC=(\d+)[\d,]*;AN=(\d+)/ || die "Cant find AC and AN in |$w[7]|"; print join("\t", $w[0], $w[1]-1, $w[1], (sprintf "%.06f", $1 / $2)) . "\n";' \ > $base.bedGraph + if [ -s $base.bedGraph ]; then bedGraphToBigWig $base.bedGraph $chromSizes $base.bigWig + fi done # Install public track files mkdir $ottoDir/install cp -pf $runDir/nextstrainGene.bb $runDir/nextstrain*Clade.bb \ $runDir/nextstrain*.vcf.gz{,.tbi} \ $runDir/nextstrain*.nh \ $runDir/nextstrainSamples*.bigWig \ $ottoDir/install/ rm -rf $ottoDir/current.bak mv -f $ottoDir/current $ottoDir/current.bak mv $ottoDir/install $ottoDir/current rm -r $gbdbDir mkdir $gbdbDir ln -sf $ottoDir/current/nextstrainGene.bb $ottoDir/current/nextstrain*Clade.bb \