Skip to content

Commit

Permalink
grid_min --> pairs2dissim.grid, object2closest.grid
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrover committed Mar 31, 2021
1 parent 74ee304 commit 401787c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 24 deletions.
6 changes: 3 additions & 3 deletions phylogeny/distTree_inc_add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ PLACEMENT=$3


# Cf. distTree_inc_new.sh
GRID_MIN=`cat $INC/grid_min`
GRID_MIN=`cat $INC/pairs2dissim.grid`
SEARCH_GRID_MIN=`cat $INC/object2closest.grid`
QC="" # -qc
VARIANCE=`cat $INC/variance`

Expand Down Expand Up @@ -64,15 +65,14 @@ if [ $N -gt 0 ]; then
rm -rf $INC/log/
mkdir $INC/log
$THIS/../trav $INC/search "touch $INC/log/%f"
SEARCH_GRID_MIN=$(( $GRID_MIN / 100 )) # PAR
GRID=0
if [ $N -lt $SEARCH_GRID_MIN ]; then
$THIS/../trav -step 1 $INC/search "$THIS/distTree_inc_search_init.sh $INC %f"
else
GRID=1
$THIS/../grid_wait.sh 1
UL1=""
if [ -e $INC/request_closest_sql ]; then
if [ -e $INC/object2closest.sql ]; 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"
Expand Down
9 changes: 5 additions & 4 deletions phylogeny/distTree_inc_complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ INC=$1
OBJS=$2


#set -x


#if false; then
section "QC $INC/"
if [ -s $INC/tree ]; then
echo "$INC/tree must be empty"
exit 1
error "$INC/tree must be empty"
fi

N=`distTree_inc_new_list.sh $INC | wc -l`
if [ $N -gt 0 ]; then
echo "$INC/new/ must be empty"
exit 1
error "$INC/new/ must be empty"
fi

sort -c $OBJS
Expand Down
13 changes: 7 additions & 6 deletions phylogeny/distTree_inc_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ source $THIS/../bash_common.sh
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"
echo "#2: min. number of dissimilarity requests to use GRID (> 0)"
echo "#3: variance: lin|linExp|..."
echo "#4: hybridness_min (> 1); 0 - no hybrids"
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 (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 "#9: object2closest.sql (0/1): 1 - object2closest.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 ''"
Expand Down Expand Up @@ -71,7 +71,8 @@ echo "1" > $INC/version

mkdir $INC/hist

echo $GRID_MIN > $INC/grid_min
echo $GRID_MIN > $INC/object2closest.grid
echo $GRID_MIN > $INC/pairs2dissim.grid
touch $INC/runlog

echo "$VARIANCE" > $INC/variance
Expand All @@ -86,7 +87,7 @@ if [ $LARGE == 1 ]; then
fi

if [ $REQUEST_CLOSEST_SQL == 1 ]; then
touch $INC/request_closest_sql
touch $INC/object2closest.sql
fi


Expand All @@ -102,8 +103,8 @@ create_script objects_in_tree
if [ $SERVER ]; then
create_script outlier2db
fi
create_script request2dissim
create_script request_closest
create_script pairs2dissim
create_script object2closest
create_script qc
create_script qc_object
if false; then # deprecated
Expand Down
8 changes: 5 additions & 3 deletions phylogeny/distTree_inc_new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ $THIS/../check_tmp.sh
SEED=1 # >= 1


GRID_MIN=`cat $INC/grid_min`
GRID_MIN=`cat $INC/pairs2dissim.grid`
SEARCH_GRID_MIN=`cat $INC/object2closest.grid`
# was: $GRID_MIN / 100
QC="" # -qc
RATE=0.015 # PAR
VARIANCE=`cat $INC/variance`
Expand Down Expand Up @@ -87,15 +89,15 @@ if [ $N -gt 0 ]; then
rm -rf $INC/log/
mkdir $INC/log
$THIS/../trav $INC/search "touch $INC/log/%f"
SEARCH_GRID_MIN=$(( $GRID_MIN / 100 )) # PAR
GRID=0
if [ $N -lt $SEARCH_GRID_MIN ]; then
$THIS/../trav -step 1 $INC/search "$THIS/distTree_inc_search_init.sh $INC %f"
else
GRID=1
$THIS/../grid_wait.sh 1
UL1=""
if [ -e $INC/request_closest_sql ]; then
if [ -e $INC/object2closest.sql ]; then
# PAR
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"
Expand Down
4 changes: 2 additions & 2 deletions phylogeny/distTree_inc_place.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ if [ -s $TMP.grep ]; then
fi

section "Finding closest objects"
$INC/request_closest.sh $NAME `dirname $QUERY` | grep -vw "^${NAME}$" | sed 's/$/\t'$NAME'/1' > $TMP.request
$INC/object2closest.sh $NAME `dirname $QUERY` | grep -vw "^${NAME}$" | sed 's/$/\t'$NAME'/1' > $TMP.request

section "Fitting to the tree"
cp /dev/null $TMP.dissim
echo "FAIL" > $TMP.leaf
VARIANCE=`cat $INC/variance`
while [ -s $TMP.request ]; do
printf "."
$INC/request2dissim.sh $TMP.request $QUERY $TMP.dissim-add $TMP.log &> /dev/null
$INC/pairs2dissim.sh $TMP.request $QUERY $TMP.dissim-add $TMP.log &> /dev/null
rm $TMP.request
set +o errexit
grep -vwi "nan$" $TMP.dissim-add > $TMP.dissim-add1
Expand Down
2 changes: 1 addition & 1 deletion phylogeny/distTree_inc_request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DIR=$INC/search/$OBJ
LOG=$INC/log/$OBJ


$INC/request2dissim.sh $DIR/request "" $DIR/dissim.add $LOG &> $LOG.request2dissim
$INC/pairs2dissim.sh $DIR/request "" $DIR/dissim.add $LOG &> $LOG.pairs2dissim
if [ ! -s $DIR/dissim.add ]; then
echo "Empty $DIR/dissim.add" > $LOG
exit 1
Expand Down
6 changes: 3 additions & 3 deletions phylogeny/distTree_inc_request2dissim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ OUT=$3

N=`cat $REQ | wc -l`
echo "$N $REQ"
GRID_MIN=`cat $INC/grid_min`
GRID_MIN=`cat $INC/pairs2dissim.grid`
if [ $N -le $GRID_MIN ]; then
$INC/request2dissim.sh $REQ "" $OUT $OUT.log > /dev/null
$INC/pairs2dissim.sh $REQ "" $OUT $OUT.log > /dev/null
if [ -e $OUT.log ]; then
if [ -s $OUT.log ]; then
head $OUT.log
Expand All @@ -41,7 +41,7 @@ else
wc -l $INC/dr.list
mkdir $INC/dr.log
$THIS/../grid_wait.sh 1
$THIS/../trav -step 1 $INC/dr.list "$QSUB_5 -N j%f %q$INC/request2dissim.sh $INC/dr/%f %Q%Q $INC/dr.out/%f $INC/dr.log/%f%q > /dev/null"
$THIS/../trav -step 1 $INC/dr.list "$QSUB_5 -N j%f %q$INC/pairs2dissim.sh $INC/dr/%f %Q%Q $INC/dr.out/%f $INC/dr.log/%f%q > /dev/null"
$THIS/../qstat_wait.sh 3000 1
ls $INC/dr.log > $INC/dr.bad
ls $INC/dr.out > $INC/dr.good
Expand Down
2 changes: 1 addition & 1 deletion phylogeny/distTree_inc_search_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DIR=$INC/search/$OBJ

while true; do
set +o errexit
$INC/request_closest.sh $OBJ "" > $DIR/request.raw
$INC/object2closest.sh $OBJ "" > $DIR/request.raw
S=$?
set -o errexit
if [ $S == 0 ]; then
Expand Down
6 changes: 5 additions & 1 deletion version.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#define VERSION "1.5.10"
#define VERSION "1.6.1"


// 1.6.1 03/31/2021 inc/: request2dissim.sh -> pairs2dissim.sh
// request_closest.sh -> object2closest.sh
// request_closest_sql -> object2closest.sql
// grid_min -> pairs2dissim.grid and object2closest.grid
// 1.5.10 03/25/2021 inc/request_closest.sh $OBJ may return $OBJ
// 1.5.9 03/24/2021 NewLeaf::saveRequest() prints empty list of requests if location.indiscernible()
// 1.5.8 03/22/2021 makeDistTree: quality calculation uses threads
Expand Down

0 comments on commit 401787c

Please sign in to comment.