Skip to content

Commit

Permalink
inc/qc_object.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrover committed Feb 6, 2021
1 parent ca41261 commit de39e04
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
12 changes: 12 additions & 0 deletions phylogeny/distTree_inc/qc_object.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions phylogeny/distTree_inc_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,46 @@ if [ $# -ne 2 ]; then
echo "Find the place of a sequence in a sequence incremental tree"
echo "Print: <new sequence name> <tree node> <new leaf arc length> <tree node arc length>"
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

Expand Down
3 changes: 2 additions & 1 deletion version.inc
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit de39e04

Please sign in to comment.