Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wgetGenBankWGS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GIPhy
wgetGenBankWGS
Commits
60bcccb0
Commit
60bcccb0
authored
5 years ago
by
Alexis CRISCUOLO
⚫
Browse files
Options
Downloads
Patches
Plain Diff
v0.3.190613ac
parent
9ff9f769
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wgetGenBankWGS.sh
+12
-18
12 additions, 18 deletions
wgetGenBankWGS.sh
with
12 additions
and
18 deletions
wgetGenBankWGS.sh
+
12
−
18
View file @
60bcccb0
...
...
@@ -33,7 +33,11 @@
# = 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 -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_$
if
[
!
-e
$OUTDIR
]
;
then
echo
"creating output directory:
$OUTDIR
"
;
mkdir
$OUTDIR
;
fi
SUMMARY
=
$OUTDIR
/summary.txt
;
t
=
$((
$(
date
+%s%N
)
/
1000000
))
;
while
[
1
]
do
wget
$WGETOPT
-O
- ftp://
$ASSEMBLY_REPORT
|
sed
-n
'2p'
;
[
$?
==
0
]
&&
break
||
sleep
1
;
done
>
$SUMMARY
f
=
$((
$(
date
+%s%N
)
/
1000000
-
$t
))
;
PROTOCOL
=
"https:"
;
while
[
1
]
do
wget
$WGETOPT
-O
-
https:
//
$ASSEMBLY_REPORT
|
sed
-n
'2p'
;
wget
$WGETOPT
-O
-
$PROTOCOL
"
//
"
$ASSEMBLY_REPORT
>
$SUMMARY
;
[
$?
==
0
]
&&
break
||
sleep
1
;
done
>
$SUMMARY
h
=
$((
$(
date
+%s%N
)
/
1000000
-
$f
-
$t
))
;
[
$h
-lt
$f
]
&&
PROTOCOL
=
"https:"
||
PROTOCOL
=
"ftp:"
;
done
#############################################################################################################
...
...
@@ -234,12 +230,10 @@ h=$(( $(date +%s%N) / 1000000 - $f - $t ));
echo
"selection criterion:
$INCLUDE_PATTERN
"
;
if
[
"
$EXCLUDE_PATTERN
"
!=
"^#"
]
;
then
echo
"exclusion criterion:
$EXCLUDE_PATTERN
"
;
fi
tmp
=
$(
randomfile
$SUMMARY
)
;
while
[
1
]
do
wget
$WGETOPT
-O
-
$PROTOCOL
"//"
$ASSEMBLY_REPORT
|
grep
-E
"
$INCLUDE_PATTERN
"
|
grep
-v
-E
"
$EXCLUDE_PATTERN
"
|
grep
-F
"ftp://ftp.ncbi.nlm.nih.gov"
>
$tmp
;
if
[
$?
==
0
]
;
then
cat
$tmp
>>
$SUMMARY
;
rm
-f
$tmp
;
break
;
fi
sleep
1
;
done
mv
$SUMMARY
$tmp
;
sed
-n
'2p'
$tmp
>
$SUMMARY
;
sed
'1,2d'
$tmp
|
grep
-E
"
$INCLUDE_PATTERN
"
|
grep
-v
-E
"
$EXCLUDE_PATTERN
"
|
grep
-F
"ftp://ftp.ncbi.nlm.nih.gov"
>>
$SUMMARY
;
rm
-f
$tmp
;
n
=
$(
grep
-v
-c
"^#"
$SUMMARY
)
;
echo
"
$REPOSITORY
:
$n
WGS nucleotide sequence FASTA files"
;
if
[
$n
-eq
0
]
;
then
exit
0
;
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment