[Bio] / FigKernelScripts / run_anno_to_pubseed_flow.sh Repository:
ViewVC logotype

View of /FigKernelScripts/run_anno_to_pubseed_flow.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (download) (as text) (annotate)
Fri Feb 8 16:58:37 2013 UTC (6 years, 9 months ago) by olson
Branch: MAIN
CVS Tags: rast_rel_2014_0912, rast_rel_2014_0729, HEAD
Changes since 1.5: +1 -1 lines
fix missing \

#!/bin/sh

skip_list="--skip 3702.1"

anno_source="anno-3 seed"
anno_user="annotation_transfer"

anno_seed="/home/fig/FIGdisk.anno_v5"
pub_seed="/vol/public-pseed/FIGdisk"

anno_seed_config="$anno_seed/config/fig-user-env.sh"
pub_seed_config="$pub_seed/config/fig-user-env.sh"

if [ ! -f $anno_seed_config ] ; then
    echo "Anno seed config $anno_seed_config not found" 1>&2
    exit 1
fi

if [ ! -f $pub_seed_config ] ; then
    echo "Pub seed config $pub_seed_config not found" 1>&2
    exit 1
fi

now=`date +"%Y-%m-%d-%H-%M-%S"`

transfer_basedir=/vol/public-pseed/SharedData/AnnotationTransfer/anno3-pubseed

if [ ! -d $transfer_basedir ] ; then
    echo "Transfer directory $transfer_basedir not found" 1>&2
    exit 1
fi

transfer_dir="$transfer_basedir/xfer.$now"
mkdir $transfer_dir
if [ $? != 0 ] ; then
    echo "Error creating $transfer_dir" 1>&2
    exit 1
fi

if [ ! -d $transfer_dir ] ; then
    echo "Could not create $transfer_dir" 1>&12
    exit 1
fi

if [ $# -eq 0 ] ; then
    if [ -f $transfer_basedir/last_transfer ] ; then
	seed_date=`cat $transfer_basedir/last_transfer`
    else
	echo "No date provided and no last_transfer file exists" 1>&2
	exit 1
    fi
elif [ $? -eq 1 ] ; then
    seed_date=$1
else
    echo "Usage: $0 [date]" 1>&2
    exit 1
fi

anno_file="$transfer_dir/annos"

#
# Pull annotations updated since the seed-data from anno3 seed.
#
(
    source $anno_seed_config
    find_new_annotations \
	-v --write-date $transfer_basedir/last_transfer "$seed_date" > $anno_file
    if [ $? != 0 ] ; then
	echo "find_new_annotations run failed with error $?" 1>&2
	exit 1
    fi
)

if [ ! -s $anno_file ] ; then
    echo "No new annotations written" 1>&2
    exit 1
fi

(
    source $pub_seed_config
    apply_annotations \
	--action $transfer_dir/action.log \
	--log $transfer_dir/log \
	$skip_list \
	"$anno_source" $anno_user $anno_file > $transfer_dir/summary 2> $transfer_dir/errors
    if [ $? -ne 0 ] ; then
	echo "Error running apply_annotations: $?" 1>&2
	cat $transfer_dir/errors 1>&2
	exit 1
    fi
    cat $transfer_dir/summary
)





MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3