Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cfankep
dbman
Commits
57834f7e
Commit
57834f7e
authored
Aug 08, 2019
by
Rudel Fankep
Browse files
upload without tar
parent
da57157a
Changes
7
Hide whitespace changes
Inline
Side-by-side
download_json.sh
0 → 100755
View file @
57834f7e
#!/bin/bash
REMOTE_FILE
=
$1
LOCAL_DATABASE_DIRECTORY
=
$2
cd
$LOCAL_DATABASE_DIRECTORY
s3cmd get
$REMOTE_FILE
cd
-
\ No newline at end of file
local_databases/dbman_metadata.json
View file @
57834f7e
[]
\ No newline at end of file
[{
"name"
:
"swissprot"
,
"tool"
:
"blast"
,
"version"
:
"2019_06"
,
"created"
:
"2019-07-29"
}]
\ No newline at end of file
local_databases/swissprot_2019_06_blast/uniprot_sprot.fasta.phr
0 → 100644
View file @
57834f7e
File added
local_databases/swissprot_2019_06_blast/uniprot_sprot.fasta.pin
0 → 100644
View file @
57834f7e
File added
local_databases/swissprot_2019_06_blast/uniprot_sprot.fasta.psq
0 → 100644
View file @
57834f7e
File added
main.py
View file @
57834f7e
...
...
@@ -12,7 +12,7 @@ import json
def
myparser
():
parser
=
argparse
.
ArgumentParser
(
description
=
'Download, convert and share
the
data to working computer'
,
prog
=
'
PSOT_d
atabase
_mak
er'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'Download, convert and share data
bases
to working computer'
,
prog
=
'
D
atabase
Manag
er'
)
subparsers
=
parser
.
add_subparsers
(
title
=
'Subcommands'
,
description
=
'Authorized Subcommands'
,
help
=
'Additional help'
)
...
...
@@ -196,7 +196,7 @@ def get_path_local_json(args):
def
get_path_remote_json
(
args
):
return
path_maker
(
get_remote_databases_directory
(
args
),
'dbman_remote_metadata.json
.tar.gz
'
)
return
path_maker
(
get_remote_databases_directory
(
args
),
'dbman_remote_metadata.json'
)
def
get_local_metadata
(
args
):
...
...
@@ -217,7 +217,7 @@ def save_local_metadata(args, metaliste):
def
get_remote_metadata
(
args
):
if
get_path_remote_json
(
args
)
in
get_remote_files
():
subprocess
.
run
([
'./download_
db
.sh'
,
get_path_remote_json
(
args
),
get_local_databases_directory
(
args
)
,
'dbman_remote_metadata.json.tar.gz'
])
subprocess
.
run
([
'./download_
json
.sh'
,
get_path_remote_json
(
args
),
get_local_databases_directory
(
args
)])
with
open
(
path_maker
(
get_local_databases_directory
(
args
),
'dbman_remote_metadata.json'
))
as
f
:
metadata
=
json
.
load
(
f
)
os
.
remove
(
path_maker
(
get_local_databases_directory
(
args
),
'dbman_remote_metadata.json'
))
...
...
@@ -227,10 +227,10 @@ def get_remote_metadata(args):
def
save_remote_metadata
(
args
,
metaliste
):
with
open
(
'dbman_remote_metadata.json'
,
'w'
)
as
f
:
with
open
(
path_maker
(
get_local_databases_directory
(
args
),
'dbman_remote_metadata.json'
)
,
'w'
)
as
f
:
json
.
dump
(
metaliste
,
f
)
subprocess
.
run
([
'./upload_
db
.sh'
,
'./'
,
'dbman_remote_metadata.json.tar.gz'
,
'dbman_remote_metadata.json'
,
get_remote_databases_directory
(
args
)])
os
.
remove
(
'dbman_remote_metadata.json'
)
subprocess
.
run
([
'./upload_
json
.sh'
,
get_local_databases_directory
(
args
)
,
'dbman_remote_metadata.json'
,
get_remote_databases_directory
(
args
)])
os
.
remove
(
path_maker
(
get_local_databases_directory
(
args
),
'dbman_remote_metadata.json'
)
)
def
get_remote_filename
(
args
,
version
):
...
...
upload_json.sh
0 → 100755
View file @
57834f7e
#!/bin/bash
LOCAL_DATABASE_DIRECTORY
=
$1
LOCAL_FILE
=
$2
REMOTE_DATABASE_DIRECTORY
=
$3
cd
$LOCAL_DATABASE_DIRECTORY
s3cmd put
$LOCAL_FILE
$REMOTE_DATABASE_DIRECTORY
cd
-
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment