Skip to content
Snippets Groups Projects
Commit 60bcccb0 authored by Alexis  CRISCUOLO's avatar Alexis CRISCUOLO :black_circle:
Browse files

v0.3.190613ac

parent 9ff9f769
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,11 @@ ...@@ -33,7 +33,11 @@
# = VERSIONS = # # = VERSIONS = #
# ============ # # ============ #
# # # #
VERSION=0.2.190228ac # VERSION=0.3.190613ac #
# + no test between ftp and http protocols; use directly http #
# + fixed bug when the specified pattern has no match #
# #
# VERSION=0.2.190228ac #
# + option -d for downloading from either genbank or refseq # # + option -d for downloading from either genbank or refseq #
# + option -t to get the type strain name(s) for each selected species # # + option -t to get the type strain name(s) for each selected species #
# # # #
...@@ -210,20 +214,12 @@ ASSEMBLY_REPORT=ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/assembly_summary_$ ...@@ -210,20 +214,12 @@ ASSEMBLY_REPORT=ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/assembly_summary_$
if [ ! -e $OUTDIR ]; then echo "creating output directory: $OUTDIR" ; mkdir $OUTDIR ; fi if [ ! -e $OUTDIR ]; then echo "creating output directory: $OUTDIR" ; mkdir $OUTDIR ; fi
SUMMARY=$OUTDIR/summary.txt; SUMMARY=$OUTDIR/summary.txt;
t=$(( $(date +%s%N) / 1000000 )); PROTOCOL="https:";
while [ 1 ]
do
wget $WGETOPT -O - ftp://$ASSEMBLY_REPORT | sed -n '2p' ;
[ $? == 0 ] && break || sleep 1 ;
done > $SUMMARY
f=$(( $(date +%s%N) / 1000000 - $t ));
while [ 1 ] while [ 1 ]
do do
wget $WGETOPT -O - https://$ASSEMBLY_REPORT | sed -n '2p' ; wget $WGETOPT -O - $PROTOCOL"//"$ASSEMBLY_REPORT > $SUMMARY ;
[ $? == 0 ] && break || sleep 1 ; [ $? == 0 ] && break || sleep 1 ;
done > $SUMMARY done
h=$(( $(date +%s%N) / 1000000 - $f - $t ));
[ $h -lt $f ] && PROTOCOL="https:" || PROTOCOL="ftp:";
############################################################################################################# #############################################################################################################
...@@ -234,12 +230,10 @@ h=$(( $(date +%s%N) / 1000000 - $f - $t )); ...@@ -234,12 +230,10 @@ h=$(( $(date +%s%N) / 1000000 - $f - $t ));
echo "selection criterion: $INCLUDE_PATTERN" ; echo "selection criterion: $INCLUDE_PATTERN" ;
if [ "$EXCLUDE_PATTERN" != "^#" ]; then echo "exclusion criterion: $EXCLUDE_PATTERN" ; fi if [ "$EXCLUDE_PATTERN" != "^#" ]; then echo "exclusion criterion: $EXCLUDE_PATTERN" ; fi
tmp=$(randomfile $SUMMARY); tmp=$(randomfile $SUMMARY);
while [ 1 ] mv $SUMMARY $tmp ;
do sed -n '2p' $tmp > $SUMMARY ;
wget $WGETOPT -O - $PROTOCOL"//"$ASSEMBLY_REPORT | grep -E "$INCLUDE_PATTERN" | grep -v -E "$EXCLUDE_PATTERN" | grep -F "ftp://ftp.ncbi.nlm.nih.gov" > $tmp ; sed '1,2d' $tmp | grep -E "$INCLUDE_PATTERN" | grep -v -E "$EXCLUDE_PATTERN" | grep -F "ftp://ftp.ncbi.nlm.nih.gov" >> $SUMMARY ;
if [ $? == 0 ]; then cat $tmp >> $SUMMARY ; rm -f $tmp ; break; fi rm -f $tmp ;
sleep 1 ;
done
n=$(grep -v -c "^#" $SUMMARY); n=$(grep -v -c "^#" $SUMMARY);
echo "$REPOSITORY: $n WGS nucleotide sequence FASTA files" ; echo "$REPOSITORY: $n WGS nucleotide sequence FASTA files" ;
if [ $n -eq 0 ]; then exit 0 ; fi if [ $n -eq 0 ]; then exit 0 ; fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment