Skip to content

Commit

Permalink
inc/request_closest_sql
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrover committed Jan 3, 2021
1 parent cbe0a17 commit 06d3308
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
39 changes: 21 additions & 18 deletions phylogeny/distTree_inc_init.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
THIS=`dirname $0`
source $THIS/../bash_common.sh
if [ $# -ne 12 ]; then
if [ $# -ne 13 ]; then
echo "Initialize an incremental distance tree directory"
echo "#1: output directory"
echo "#2: grid_min (> 0): min. number of dissimilarity requests to use GRID"
Expand All @@ -10,11 +10,12 @@ if [ $# -ne 12 ]; then
echo "#5: dissim_boundary (> 0 or NAN)"
echo "#6: genogroup_barrier (> 0 or NAN)"
echo "#7: complete path to a 'phenotype' directory or ''"
echo "#8: large directories (0/1): 1 - files in #1/new/ and #7/ are grouped into subdirectories named file2hash(<file name>)"
echo "#9: SQL server name or ''"
echo "#10: database name on the SQL server or ''"
echo "#11: complete path to a directory for bulk insert into the database or ''"
echo "#12: path in Universal Naming Convention to the bulk directory #11 or ''"
echo "#8: large (0/1): 1 - files in #1/new/ and #7/ are grouped into subdirectories named file2hash(<file name>)"
echo "#9: request_closest_sql (0/1): 1 - request_closest.sh queries an SQL database and the number of concurrent connections is restricted to 30"
echo "#10: SQL server name or ''"
echo "#11: database name on the SQL server or ''"
echo "#12: complete path to a directory for bulk insert into the database or ''"
echo "#13: path in Universal Naming Convention to the bulk directory #11 or ''"
exit 1
fi
INC=$1
Expand All @@ -23,12 +24,13 @@ VARIANCE="$3"
HYBRIDNESS_MIN=$4
DISSIM_BOUNDARY=$5
GENOGROUP_BARRIER=$6
PHEN=$7
PHEN="$7"
LARGE=$8
SERVER=$9
DATABASE=${10}
BULK_LOCAL=${11}
BULK_REMOTE=${12}
REQUEST_CLOSEST_SQL=$9
SERVER=${10}
DATABASE=${11}
BULK_LOCAL=${12}
BULK_REMOTE=${13}


if [ $GRID_MIN -le 0 ]; then
Expand Down Expand Up @@ -72,12 +74,14 @@ mkdir $INC/hist
echo $GRID_MIN > $INC/grid_min
touch $INC/runlog

echo "$VARIANCE" > $INC/variance
echo $DISSIM_BOUNDARY > $INC/dissim_boundary
echo $GENOGROUP_BARRIER > $INC/genogroup_barrier
echo $HYBRIDNESS_MIN > $INC/hybridness_min
echo $SERVER > $INC/server
echo $DATABASE > $INC/database
echo "$VARIANCE" > $INC/variance
echo $DISSIM_BOUNDARY > $INC/dissim_boundary
echo $GENOGROUP_BARRIER > $INC/genogroup_barrier
echo $HYBRIDNESS_MIN > $INC/hybridness_min
echo $LARGE > $INC/large
echo $REQUEST_CLOSEST_SQL > $INC/request_closest_sql
echo $SERVER > $INC/server
echo $DATABASE > $INC/database


function create_script
Expand Down Expand Up @@ -114,7 +118,6 @@ if [ "$PHEN" ]; then
ln -s $PHEN $INC/phen
fi

echo $LARGE > $INC/large
if [ $LARGE == 1 ]; then
$THIS/../trav 1000 -zero -start 0 "mkdir $INC/new/%n"
fi
Expand Down
3 changes: 2 additions & 1 deletion phylogeny/distTree_inc_init_stnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ fi
( sqsh-ms -S $SERVER -D $DATABASE -m bcp -C "select @@version" > /dev/null ) || error "Database is not available"


$THIS/distTree_inc_init.sh $INC 1 "" 0 NAN NAN "" 0 $SERVER $DATABASE $BULK_LOCAL $BULK_REMOTE
$THIS/distTree_inc_init.sh $INC 1 "" 0 NAN NAN "" 0 0 $SERVER $DATABASE $BULK_LOCAL $BULK_REMOTE
# 1 2 3 4 5 6 7 8 9 10 11 12 13
cp $FROM/* $INC/


Expand Down
7 changes: 6 additions & 1 deletion phylogeny/distTree_inc_new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GRID_MIN=`cat $INC/grid_min`
QC="" # -qc
RATE=0.015 # PAR
VARIANCE=`cat $INC/variance`
REQUEST_CLOSEST_SQL=`cat $INC/request_closest_sql`
OBJS=`$THIS/tree2obj.sh $INC/tree | wc -l`
ADD=`echo "$OBJS * $RATE" | bc -l | sed 's/\..*$//1'` # PAR
if [ $ADD == 0 ]; then
Expand Down Expand Up @@ -88,7 +89,11 @@ if [ $N -gt 0 ]; then
$THIS/../trav -step 1 $INC/search "$THIS/distTree_inc_search_init.sh $INC %f"
else
$THIS/../grid_wait.sh 1
$THIS/../trav -step 1 $INC/search "$QSUB_5,ul1=30 -N j%n %Q$THIS/distTree_inc_search_init.sh $INC %f%Q > /dev/null"
UL1=""
if [ $REQUEST_CLOSEST_SQL == 1 ]; then
UL1=",ul1=30"
fi
$THIS/../trav -step 1 $INC/search "$QSUB_5$UL1 -N j%n %Q$THIS/distTree_inc_search_init.sh $INC %f%Q > /dev/null"
$THIS/../qstat_wait.sh 2000 1
ls $INC/search/*/request | cut -f 3 -d '/' > $INC/sought.list
# Will break if "No such file or directory"
Expand Down
1 change: 1 addition & 0 deletions version.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define VERSION "1.2.3"


// 1.3.1 12/18/2020 inc/phen_large --> inc/large; inc/request_closest_sql
// 1.2.3 10/03/2020 makeDistTree does not stop on criterion increase of dissimilarity types > 1
// 1.2.2 08/28/2020 distTree_new.cpp accepts a tree file as input
// 1.2.1 08/20/2020 request2dissim.sh: 4 parameters
Expand Down

0 comments on commit 06d3308

Please sign in to comment.