[Swift-commit] r4225 - provenancedb/apps/oops

lgadelha at ci.uchicago.edu lgadelha at ci.uchicago.edu
Sun Mar 27 18:55:29 CDT 2011


Author: lgadelha
Date: 2011-03-27 18:55:29 -0500 (Sun, 27 Mar 2011)
New Revision: 4225

Modified:
   provenancedb/apps/oops/oops_extractor.sh
Log:
OOPS annotation extractor update to match new schema.


Modified: provenancedb/apps/oops/oops_extractor.sh
===================================================================
--- provenancedb/apps/oops/oops_extractor.sh	2011-03-27 21:54:23 UTC (rev 4224)
+++ provenancedb/apps/oops/oops_extractor.sh	2011-03-27 23:55:29 UTC (rev 4225)
@@ -37,12 +37,12 @@
 		OOPS_RUN_ID=$(echo $i | awk -F . '{print $3}')
 		cd $PROTESTS_HOME/$k/$i
 		LOG_FILENAME=$(ls *-*-*-*.log)
- 		WORKFLOW_ID=$(echo "select id from workflow where log_filename like '%$LOG_FILENAME%'" | $SQLCMD -t | awk '{print $1}')
+ 		WORKFLOW_ID=$(echo "select id from run where log_filename like '%$LOG_FILENAME%'" | $SQLCMD -t | awk '{print $1}')
 		cd $IMPORT_HOME/swift-logs
-		echo "insert into annot_wf_txt (id, name, value) values ('$WORKFLOW_ID','oops_run_id','$OOPS_RUN_ID');" | $SQLCMD
+		echo "insert into annot_run_text (id, name, value) values ('$WORKFLOW_ID','oops_run_id','$OOPS_RUN_ID');" | $SQLCMD
 		
 		#extracts scientific parameters given as input to the workflow in file *.params.
-		echo "select file.id,file.filename from process, ds_usage, ds_containment, file where  process.id=ds_usage.process_id and ds_usage.dataset_id=out_id and file.id=ds_containment.in_id and filename like '%.params' and process.name='PrepLoop' and process.workflow_id='$WORKFLOW_ID' and ds_usage.direction='O';" > query.sql;
+		echo "select file.id,file.filename from process, dataset_production, dataset_containment, file where  process.id=dataset_production.process_id and dataset_usage.dataset_id=out_id and file.id=dataset_containment.in_id and filename like '%.params' and process.name='PrepLoop' and process.run_id='$WORKFLOW_ID';" > query.sql;
 		
 		$SQLCMD -t -A -F " " -f query.sql -o result.txt
 		
@@ -55,23 +55,23 @@
 		    NAME=$(echo $line | awk 'BEGIN { FS = "=" }; {print $1}')
 		    RIGHT=$(echo $line | awk 'BEGIN { FS = "=" }; {print $2}')
 		    if [ "$NAME" = "SAMPLE RANGE" ]; then
-			echo "insert into annot_ds_txt values ('$DATASET_ID', 'sample_range', '$RIGHT');" | $SQLCMD
+			echo "insert into annot_dataset_text values ('$DATASET_ID', 'sample_range', '$RIGHT');" | $SQLCMD
 		    fi 
 		    if [ "$NAME" = "RESTRAIN DISTANCE" ]; then
 			VALUE1=$(echo $RIGHT | awk 'BEGIN { FS = "," }; {print $1}')
 			VALUE2=$(echo $line | awk 'BEGIN { FS = "=" }; {print $2}' | awk 'BEGIN { FS = "," }; {print $2}')
-			echo "insert into annot_ds_num values ('$DATASET_ID', 'restrain_distance_1', $VALUE1);" | $SQLCMD
-			echo "insert into annot_ds_num values ('$DATASET_ID', 'restrain_distance_2', $VALUE2);" | $SQLCMD
+			echo "insert into annot_dataset_numeric values ('$DATASET_ID', 'restrain_distance_1', $VALUE1);" | $SQLCMD
+			echo "insert into annot_dataset_numeric values ('$DATASET_ID', 'restrain_distance_2', $VALUE2);" | $SQLCMD
 		    fi 
 		    if [ "$NAME" = "MAXIMUM NUMBER OF STEPS" ]; then
-			echo "insert into annot_ds_num values ('$DATASET_ID', 'maximum_number_of_steps', $RIGHT);" | $SQLCMD
+			echo "insert into annot_dataset_numeric values ('$DATASET_ID', 'maximum_number_of_steps', $RIGHT);" | $SQLCMD
 		    fi 
 		done < $FILENAME
 
 		#extracts length of the fasta sequence given as input to the workflow in file *.fasta.
 		cd $IMPORT_HOME/swift-logs
 
-		echo "select file.id,file.filename from process, ds_usage, ds_containment, file where  process.id=ds_usage.process_id and ds_usage.dataset_id=out_id and file.id=ds_containment.in_id and filename like '%.fasta' and process.name='PrepLoop' and process.workflow_id='$WORKFLOW_ID' and ds_usage.direction='O';" > query.sql;
+		echo "select file.id,file.filename from process, dataset_production, dataset_containment, file where  process.id=dataset_production.process_id and dataset_production.dataset_id=out_id and file.id=dataset_containment.in_id and filename like '%.fasta' and process.name='PrepLoop' and process.run_id='$WORKFLOW_ID';" > query.sql;
 		
 		$SQLCMD -t -A -F " " -f query.sql -o result.txt
 		
@@ -82,8 +82,9 @@
 		
 		if [ -n "$FILENAME" ]; then
 		    SEQLENGTH=$(awk '{if (NR==2) print $1}' $FILENAME | wc -c)
-		    echo "insert into annot_ds_num values ('$DATASET_ID', 'fasta_sequence_length', $SEQLENGTH);" | $SQLCMD
+		    echo "insert into annot_dataset_numeric values ('$DATASET_ID', 'fasta_sequence_length', $SEQLENGTH);" | $SQLCMD
 		fi
+
 		# extracts scientific parameters given as output by the workflow in *.log.
 		# relevant lines:
 		# zone2            (Initial Energy: -21352.116911)
@@ -98,7 +99,7 @@
 
 		cd $IMPORT_HOME/swift-logs
 	    
-		echo "select file.id,file.filename from process, ds_usage, ds_containment, file where  process.id=ds_usage.process_id and ds_usage.dataset_id=out_id and file.id=ds_containment.in_id and filename like '%.log' and process.name='LoopModel' and process.workflow_id='$WORKFLOW_ID' and ds_usage.direction='O';" > query.sql;
+		echo "select file.id,file.filename from process, dataset_production, dataset_containment, file where  process.id=dataset_production.process_id and dataset_production.dataset_id=out_id and file.id=dataset_containment.in_id and filename like '%.log' and process.name='LoopModel' and process.run_id='$WORKFLOW_ID';" > query.sql;
 
 		$SQLCMD -t -A -F " " -f query.sql -o result.txt
 
@@ -109,28 +110,28 @@
 		    while read token1 token2 token3 token4; do
 			if [ "$token2" = "(Initial Energy:" ]; then
 			    initialenergy=$(echo $token3 | awk 'BEGIN { FS = "\)" }; {print $1}')
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'initial_energy', $initialenergy);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'initial_energy', $initialenergy);" | $SQLCMD
 			fi
 			if [ "$token1" = "Total" ] && [ "$token2" = "Function" ] && [ "$token3" = "Evaluations:" ]; then
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'total_function_evaluations', $token4);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'total_function_evaluations', $token4);" | $SQLCMD
 			fi 
 			if [ "$token1" = "Increasing" ] && [ "$token2" = "transitions:" ]; then
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'accepted_increasing_transitions', $token3);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'accepted_increasing_transitions', $token3);" | $SQLCMD
 			fi 
 			if [ "$token1" = "Decreasing" ] && [ "$token2" = "transitions:" ]; then
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'accepted_decreasing_transitions', $token3);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'accepted_decreasing_transitions', $token3);" | $SQLCMD
 			fi 
 			if [ "$token1" = "Rejected" ] && [ "$token2" = "transitions:" ]; then
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'rejected_transitions', $token3);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'rejected_transitions', $token3);" | $SQLCMD
 			fi 
 			if [ "$token1" = "Final" ] && [ "$token2" = "Energy:" ]; then
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'final_energy', $token3);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'final_energy', $token3);" | $SQLCMD
 			fi 
 			if [ "$token1" = "Final" ] && [ "$token2" = "Temp:" ]; then
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'final_temp', $token3);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'final_temp', $token3);" | $SQLCMD
 			fi 
 			if [ "$token1" = "Total" ] && [ "$token2" = "Running" ] && [ "$token3" = "Time:" ]; then
-			    echo "insert into annot_ds_num (id, name, value) values ('$dataset', 'total_running_time', $token4);" | $SQLCMD
+			    echo "insert into annot_dataset_numeric (id, name, value) values ('$dataset', 'total_running_time', $token4);" | $SQLCMD
 			fi 
 		    done < $FILENAME
 		done < $IMPORT_HOME/swift-logs/result.txt




More information about the Swift-commit mailing list