fb895c82bef394408aff9fa5ce3008daa4cee6e3
mspeir
  Wed Jul 31 12:16:46 2019 -0700
Fixed an issue with qaAutoTrack not properly checking date for grcIncidentDb tracks. Bumped up tooOld date for grcIncidentDb tracks to 6 months since updates seem to come infrequently from GRC. Fixed issue with runQaAutoTrack not deleting old log files. Added checks for grcIncidentDb track on danRer10 and galGal5. Removed check for danRer7 as GRC site does not seem to have data for this assembly anymore. no redmine

diff --git src/utils/qa/qaAutoTrack.sh src/utils/qa/qaAutoTrack.sh
index e09fc9b..19ecebf 100755
--- src/utils/qa/qaAutoTrack.sh
+++ src/utils/qa/qaAutoTrack.sh
@@ -211,76 +211,63 @@
 currLogFile="$db.$tableName.$currDate.$currTime.txt"
 
 # set info for prevLog
 prevLogDate=$(ls -Lt $logDir | sed -n /$db.$tableName/p | head -1 | awk -F . '{print $3}')
 prevLogTime=$(ls -Lt $logDir | sed -n /$db.$tableName/p | head -1 | awk -F . '{print $4}')
 
 #initialize output string
 output="\n$db\n"
 
 if [ -e $logDir/$db.$tableName.$prevLogDate.$prevLogTime.txt ]
 then
 	prevLogFile="$logDir/$db.$tableName.$prevLogDate.$prevLogTime.txt"
 fi
 
 # Set tooOld for different tables
-if  [[ "$tableName" == "clinvar" ]] || [[ "$tableName" == "grcIndcidentDb" ]]
+if  [[ "$tableName" == "clinvar" ]]
 then
 	tooOld=$(date -d "$currDate - 2 months" +%F)
+elif [[ "$tableName" == "grcIndcidentDb" ]]
+then
+	tooOld=$(date -d "$currDate - 6 months" +%F)
 else
 	tooOld=$(date -d "$currDate - 1 month" +%F)
 fi
 
 # Run tests for different tracks 
 if [[ $bigBedMode == "on" ]]
 then
 	# ClinVar has muliple tables
 	if [[ $tableName == "clinvar" ]]
 	then
 		for tbl in clinvarMain clinvarCnv
 		do
 			# Get file name from beta
 			fileName=$(hgsql -Ne "SELECT * FROM $tbl LIMIT 1" $db)
 			# Get table update time from beta
 			tblDate=$(ssh qateam@hgwbeta "date -d '$(stat -Lc '%y' $fileName)' +%F' '%T")
 			MYTEMPFILE=$(mktemp --tmpdir tmp.XXXXXXXXXX.bed)
 			# featureBits doesn't work with bigBeds, need to turn into bed first
 			ssh qateam@hgwbeta "/usr/local/apache/cgi-bin/utils/bigBedToBed $fileName stdout" > $MYTEMPFILE
 			tblCov=$(featureBits -countGaps $db $MYTEMPFILE 2>&1)
 
 			outputCovDiff "$prevLogFile" "$tblCov" "$tbl" "$tblDate"
 			# Check for issues with table
 			checkForIssues "$tblDate" "$tooOld" "$tbl" "$percentDiff"
 
 			rm -f $MYTEMPFILE
 		done
-	# GRC Incident track relies on remote file so curl must be used instead of stat
-	elif [[ $tableName == "grcIncidentDb" ]]
-	then
-		fileName=$(hgsql -Ne "SELECT * FROM $tableName LIMIT 1" $db)
-		# Use curl to get update time on file
-		tblDate=$(date -d "$(curl -s -v -I $fileName 2>&1 | grep '^< Last-Modified:'| cut -d ' ' -f3- )" '+%F %T')
-		MYTEMPFILE=$(mktemp --tmpdir tmp.XXXXXXXXXX.bed)
-		# featureBits doesn't work with bigBeds, need to turn into bed first
-		bigBedToBed $fileName $MYTEMPFILE
-		tblCov=$(featureBits -countGaps $db $MYTEMPFILE 2>&1)
-
-		outputCovDiff "$prevLogFile" "$tblCov" "$tableName" "$tblDate"
-		# Check for issues with table
-		checkForIssues "$tblDate" "$tooOld" "$tableName" "$percentDiff"
-			
-		rm -f $MYTEMPFILE
 	# Tests for all other bigBed based autopushed tracks (assuming they don't use remote bigBed files)
 	else
 		fileName=$(hgsql -Ne "SELECT * FROM $tableName LIMIT 1" $db)
 		# Get table update time from beta
 		tblDate=$(ssh qateam@hgwbeta "date -d '$(stat -Lc '%y' $fileName)' +%F' '%T")
 		MYTEMPFILE=$(mktemp --tmpdir tmp.XXXXXXXXXX.bed)
 		# featureBits doesn't work with bigBeds, need to turn into bed first
 		ssh qateam@hgwbeta "/usr/local/apache/cgi-bin/utils/bigBedToBed $fileName stdout" > $MYTEMPFILE
 		tblCov=$(featureBits -countGaps $db $MYTEMPFILE 2>&1)
 
 		outputCovDiff "$prevLogFile" "$tblCov" "$tableName" "$tblDate"
 	
 		# Check for issues with table
 		checkForIssues "$tblDate" "$tooOld" "$tableName" "$percentDiff"