f0527b030e6164ea3bf58446dfaef6da1d4f62dd chmalee Tue Sep 14 10:41:07 2021 -0700 Fix lrg build to not depend on checked out copy of kent source, copy all scripts locally diff --git src/hg/utils/otto/lrg/buildLrg.sh src/hg/utils/otto/lrg/buildLrg.sh index 37b47f9..c0d97d4 100755 --- src/hg/utils/otto/lrg/buildLrg.sh +++ src/hg/utils/otto/lrg/buildLrg.sh @@ -5,31 +5,31 @@ WORKDIR=$1 mkdir -p ${WORKDIR}/${today} cd ${WORKDIR}/${today} for db in hg38 hg19 do grc="" if [ $db == "hg38" ]; then grc="GRCh38" else grc="GRCh37" fi mkdir -p $db cd $db echo "building LRG for $db" - ~/kent/src/hg/utils/automation/parseLrgXml.pl $grc ../ + ${WORKDIR}/parseLrgXml.pl $grc ../ set +e genePredCheck lrgTranscriptsUnmapped.gp 2>genePred.failed set -e # use -gt 1 because one of the lines will be the "checked: X, failed: Y" line if [ `grep -v "LRG_7t1\|LRG_1298t1" genePred.failed | wc -l` -gt 2 ]; then printf "genePredCheck failed on %s. Check %s for more info\n" "${db}" "${WORKDIR}/${today}/${db}/genePred.failed" exit 255 fi cut -f1,12 lrgTranscriptsUnmapped.gp | sort > transcript.gene.name.txt awk -F$'\t' '{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s %s %s %s\n", $1,$16,$17,$18,$19,$2, $16,$18,$17,$19}' \ lrgTranscriptsUnmapped.gp | sort \ | join -t$'\t' - transcript.gene.name.txt \ | awk -F$'\t' '{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s %s\n", $1,$2,$3,$4,$5,$6,$8,$7,$8}' \ > lrgTransExtraFields.tsv @@ -61,20 +61,26 @@ printf "Creating lrgBigPsl.bb for %s\n" $db bedToBigBed -as=${WORKDIR}/bigPsl+6.as -type=bed12+20 -tab -extraIndex=name \ lrgExtraTranscripts${db}.bigPsl.bed /hive/data/genomes/${db}/chrom.sizes lrgBigPsl.bb # The lrg table already exists as a one line table pointing to /gbdb/$db/bbi/lrg.bb, which # is in turn a symlink into $WORKDIR/release/$db/lrg.bb. Thus validate now before overwriting: oldCount=`bigBedInfo ${WORKDIR}/release/$db/lrg.bb | grep itemCount | cut -d' ' -f2` oldPslCount=`bigBedInfo ${WORKDIR}/release/$db/lrgBigPsl.bb | grep itemCount | cut -d' ' -f2` newCount=`bigBedInfo lrg.bb | grep itemCount | cut -d' ' -f2` newPslCount=`bigBedInfo lrgBigPsl.bb | grep itemCount | cut -d' ' -f2` echo LRG rowcounts: old $oldCount new: $newCount echo $oldCount $newCount | awk '{if (($2-$1)/$1 > 0.1) {printf "validate on LRG BigBed failed: old count: %d, new count: %d\n", $1,$2; exit 1;}}' echo LRG PSL rowcounts: old $oldPslCount new: $newPslCount echo $oldPslCount $newPslCount | awk '{if (($2-$1)/$1 > 0.1) {printf "validate on DECIPHER CNV failed: old count: %d, new count: %d\n", $1,$2; exit 1;}}' + # now archive this new release: + archiveDir="/usr/local/apache/htdocs-hgdownload/goldenPath/archive/${db}/lrg/${today}" + mkdir -p ${archiveDir} + cp lrg.bb ${archiveDir} + cp lrgBigPsl.bb ${archiveDir} + cp lrg.bb ${WORKDIR}/release/${db}/ cp lrgBigPsl.bb ${WORKDIR}/release/${db}/ cd ${WORKDIR}/${today} done