From 4186a549deba1e41181fd1ed22169478c23e362c Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Thu, 10 Sep 2009 17:31:05 -0400 Subject: [PATCH 1/2] POSIXize/Bournize updateucsc.sh.sample --- cron/updateucsc.sh.sample | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/cron/updateucsc.sh.sample b/cron/updateucsc.sh.sample index 6e7e2fc0f7f..4ebaf825821 100644 --- a/cron/updateucsc.sh.sample +++ b/cron/updateucsc.sh.sample @@ -6,7 +6,8 @@ # Edit this line to refer to galaxy's path: GALAXY=/galaxy/path -export PYTHONPATH=${GALAXY}/lib +PYTHONPATH=${GALAXY}/lib +export PYTHONPATH # setup directories echo "Creating required directories." @@ -32,7 +33,11 @@ echo "Updating builds.txt" python ${GALAXY}/cron/parse_builds.py > ${GALAXY}/tool-data/shared/ucsc/new/builds.txt if [ $? -eq 0 ] then - cp -uf ${GALAXY}/tool-data/shared/ucsc/new/builds.txt ${GALAXY}/tool-data/shared/ucsc/builds.txt + diff ${GALAXY}/tool-data/shared/ucsc/new/builds.txt ${GALAXY}/tool-data/shared/ucsc/builds.txt > /dev/null 2>&1 + if [ $? -ne 0 ] + then + cp -f ${GALAXY}/tool-data/shared/ucsc/new/builds.txt ${GALAXY}/tool-data/shared/ucsc/builds.txt + fi else echo "Failed to update builds.txt" >&2 fi @@ -42,7 +47,11 @@ echo "Updating ucsc_build_sites.txt" python ${GALAXY}/cron/parse_builds_3_sites.py > ${GALAXY}/tool-data/shared/ucsc/new/ucsc_build_sites.txt if [ $? -eq 0 ] then - cp -uf ${GALAXY}/tool-data/shared/ucsc/new/ucsc_build_sites.txt ${GALAXY}/tool-data/shared/ucsc/ucsc_build_sites.txt + diff ${GALAXY}/tool-data/shared/ucsc/new/ucsc_build_sites.txt ${GALAXY}/tool-data/shared/ucsc/ucsc_build_sites.txt > /dev/null 2>&1 + if [ $? -ne 0 ] + then + cp -f ${GALAXY}/tool-data/shared/ucsc/new/ucsc_build_sites.txt ${GALAXY}/tool-data/shared/ucsc/ucsc_build_sites.txt + fi else echo "Failed to update builds.txt" >&2 fi @@ -52,7 +61,16 @@ echo "Building chromInfo tables." python ${GALAXY}/cron/build_chrom_db.py ${GALAXY}/tool-data/shared/ucsc/chrom/new/ ${GALAXY}/tool-data/shared/ucsc/builds.txt if [ $? -eq 0 ] then - cp -uf ${GALAXY}/tool-data/shared/ucsc/chrom/new/*.len ${GALAXY}/tool-data/shared/ucsc/chrom/ + for src in ${GALAXY}/tool-data/shared/ucsc/chrom/new/*.len + do + dst=${GALAXY}/tool-data/shared/ucsc/chrom/`basename $src` + diff $src $dst > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "cp -f $src $dst" + cp -f $src $dst + fi + done else echo "Failed to update chromInfo tables." >&2 fi From 140b458dbb6b2565c32177425d54ef5566d7edd2 Mon Sep 17 00:00:00 2001 From: Guruprasad Anada Date: Thu, 10 Sep 2009 17:35:21 -0400 Subject: [PATCH 2/2] Bug fix for 'Fetch closest feature' tool. --- tools/new_operations/flanking_features.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/new_operations/flanking_features.py b/tools/new_operations/flanking_features.py index 37d577465a0..2ef0d77f59f 100644 --- a/tools/new_operations/flanking_features.py +++ b/tools/new_operations/flanking_features.py @@ -129,7 +129,7 @@ def proximal_region_finder(readers, region, comments=True): map(outfields.append, result_down[-1].other) #The last element of result_down will be the closest element to the given interval elif result_up: map(outfields.append, result_up[res_ind].other) - else: + elif result_down: map(outfields.append, result_down[-1].other) #The last element of result_down will be the closest element to the given interval yield outfields