# HG changeset patch
# User dfornika
# Date 1575327849 0
# Node ID e098e839ff97255b4255faed9741d37c3d8e48b4
# Parent 94aa25f863d640c81646a8614e48f90da1af62ad
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_acc_download commit 1531ae67584525f6eeec71a72d7861f4ad48f96a-dirty"
diff -r 94aa25f863d6 -r e098e839ff97 ncbi_acc_download.xml
--- a/ncbi_acc_download.xml Fri Nov 29 23:31:08 2019 +0000
+++ b/ncbi_acc_download.xml Mon Dec 02 23:04:09 2019 +0000
@@ -8,22 +8,36 @@
accessions &&
+ { grep -v "^[ \t]*$" $query_source.accession_file > accessions ||
+ { echo "No accession numbers in input. Aborting." 1>&2; exit 1; } } &&
#else if $query_source.select == "accession_list":
echo '$query_source.accession_list' | sed -r 's/(\,|__cn__)/\n/g' | grep -v "^[ \t]*$" > accessions &&
#end if
mkdir outdir &&
cd outdir &&
+ ignore_errors=$ignore_failed &&
while read accession; do
- echo "Downloading accession number: " \$accession &&
+ echo "Downloading accession number: " \$accession " ..." >> ../error.log &&
ncbi-acc-download
--molecule '${molecule.select}'
--format '${molecule.format}'
#if $molecule.format != 'featuretable' and $molecule.format != 'gff3':
--extended-validation all
#end if
- \${accession} || echo \$accession >> ../failed.txt && sleep 2;
- done < ../accessions 2> >(tee -a ../error.log >&2)
+ \${accession};
+ failure=\$?;
+ if [ \$failure -ne 0 ]; then
+ echo " failed." >> ../error.log;
+ if [ \$ignore_errors -ne 0 ]; then
+ echo \$accession >> ../failed.txt;
+ else
+ exit 1;
+ fi;
+ else
+ echo " done." >> ../error.log;
+ fi;
+ sleep 2;
+ done < ../accessions 2> >(tee -a ../error.log >&2);
]]>
@@ -35,7 +49,9 @@
-
+
+ value.strip()
+
@@ -57,6 +73,11 @@
+
+
+
+
@@ -65,8 +86,10 @@
-
-
+
+
+ str(ignore_failed)=='1'
+
@@ -186,6 +209,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 94aa25f863d6 -r e098e839ff97 test-data/accessions