diff --git a/phylogeny/distTree_inc/qc_object.sh b/phylogeny/distTree_inc/qc_object.sh new file mode 100755 index 00000000..3e8cc4fd --- /dev/null +++ b/phylogeny/distTree_inc/qc_object.sh @@ -0,0 +1,12 @@ +#!/bin/bash +THIS=`dirname $0` +source /home/brovervv/code/cpp/bash_common.sh +if [ $# -ne 1 ]; then + echo "QC an object" + echo "#1: file or directory with object data" + exit 1 +fi +FD=$1 + + +exit 0 diff --git a/phylogeny/distTree_inc_init.sh b/phylogeny/distTree_inc_init.sh index 43d54ac4..6f5915a9 100755 --- a/phylogeny/distTree_inc_init.sh +++ b/phylogeny/distTree_inc_init.sh @@ -105,6 +105,7 @@ fi create_script request2dissim create_script request_closest create_script qc +create_script qc_object if false; then # deprecated if [ $HYBRIDNESS_MIN != 0 ]; then create_script db2unhybrid diff --git a/phylogeny/distTree_inc_place_seq.sh b/phylogeny/distTree_inc_place.sh similarity index 60% rename from phylogeny/distTree_inc_place_seq.sh rename to phylogeny/distTree_inc_place.sh index 05c05f8a..71c7ad61 100755 --- a/phylogeny/distTree_inc_place_seq.sh +++ b/phylogeny/distTree_inc_place.sh @@ -5,43 +5,46 @@ if [ $# -ne 2 ]; then echo "Find the place of a sequence in a sequence incremental tree" echo "Print: " echo "#1: incremental tree directory" - echo "#2: sequence file" + echo "#2: new object file or directory" exit 1 fi INC=$1 QUERY=$2 -NAME=`basename $QUERY` -ID=`head -1 $QUERY | sed 's/^>//1' | cut -f 1 -d ' '` -if [ "$NAME" != "$ID" ]; then - error "File name '$NAME' must be the same as FASTA header identifier '$ID'" -fi +$INC/qc_object.sh $QUERY TMP=`mktemp` #echo $TMP +#set -x +NAME=`basename $QUERY` -$THIS/../genetics/dna_closest.sh $QUERY $INC/seq.fa | grep -vw "$NAME" | sed 's/$/ '$NAME'/1' > $TMP.request +section "Finding closest objects ..." +$INC/request_closest.sh $NAME `dirname $QUERY` | grep -vw "$NAME" | sed 's/$/ '$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 - $INC/request2dissim.sh $TMP.request $QUERY $TMP.dissim-add $TMP.log &> /dev/null + printf "." + $INC/request2dissim.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 set -o errexit if [ ! -s $TMP.dissim-add1 ]; then wc -l $TMP.dissim-add - echo -e "${YELLOW}Incomparable sequences${NOCOLOR}" + echo -e "${YELLOW}Incomparable objects${NOCOLOR}" break fi cat $TMP.dissim-add1 >> $TMP.dissim - $THIS/../phylogeny/distTree_new $INC/tree.released -variance $VARIANCE -name $NAME -dissim $TMP.dissim -request $TMP.request -leaf $TMP.leaf + $THIS/../phylogeny/distTree_new $INC/tree -variance $VARIANCE -name $NAME -dissim $TMP.dissim -request $TMP.request -leaf $TMP.leaf done +echo "" +echo "" cat $TMP.leaf | cut -f 1,2,3,4 diff --git a/version.inc b/version.inc index 6d177ebd..9ccc2f07 100644 --- a/version.inc +++ b/version.inc @@ -1,6 +1,7 @@ -#define VERSION "1.4.2" +#define VERSION "1.5.1" +// 1.5.1 01/31/2021 inc/request_closest.sh has 2 parameters; inc/qc_object.sh // 1.4.2 01/28/2021 distTree_inc_new_log.sh // 1.4.1 01/24/2021 inc/{large,request_closest_sql} /dev/null or absent // 1.3.2 01/10/2021 GeneMark2CDS prints incomplete and ambiguous proteins as well