Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dbman
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
SOaAS
dbman
Commits
57002a0c
Commit
57002a0c
authored
4 years ago
by
Lukas Jelonek
Browse files
Options
Downloads
Patches
Plain Diff
Add ghostx db creation
parent
be780604
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dbman/main.py
+4
-1
4 additions, 1 deletion
dbman/main.py
dbman/recipes/create_ghostx_dbs.py
+30
-0
30 additions, 0 deletions
dbman/recipes/create_ghostx_dbs.py
with
34 additions
and
1 deletion
dbman/main.py
+
4
−
1
View file @
57002a0c
...
@@ -141,7 +141,8 @@ def _rename_directory_after_metadata(path):
...
@@ -141,7 +141,8 @@ def _rename_directory_after_metadata(path):
logging
.
debug
(
"
Renaming
'
%s
'
to
'
%s
'"
,
oldpath
,
newpath
)
logging
.
debug
(
"
Renaming
'
%s
'
to
'
%s
'"
,
oldpath
,
newpath
)
oldpath
.
rename
(
newpath
)
oldpath
.
rename
(
newpath
)
metadata
[
'
location
'
]
=
str
(
newpath
.
absolute
())
metadata
[
'
location
'
]
=
str
(
newpath
.
absolute
())
return
metadata
return
metadata
return
None
def
run_in_tempdir
(
func
=
None
,
success
=
None
,
fail
=
None
):
def
run_in_tempdir
(
func
=
None
,
success
=
None
,
fail
=
None
):
dbtmpdir
=
os
.
path
.
join
(
_databases_dir
(),
"
tmp
"
)
dbtmpdir
=
os
.
path
.
join
(
_databases_dir
(),
"
tmp
"
)
...
@@ -166,10 +167,12 @@ def _recipes(args):
...
@@ -166,10 +167,12 @@ def _recipes(args):
'
card
'
:
{
'
download
'
:
{
'
script
'
:
_pkgres
(
'
recipes/download_card.py
'
)},
'
card
'
:
{
'
download
'
:
{
'
script
'
:
_pkgres
(
'
recipes/download_card.py
'
)},
'
blast
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_blast_dbs.py
'
)},
'
blast
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_blast_dbs.py
'
)},
'
diamond
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_diamond_dbs.py
'
)},
'
diamond
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_diamond_dbs.py
'
)},
'
ghostx
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_ghostx_dbs.py
'
)},
},
},
'
swissprot
'
:
{
'
download
'
:
{
'
script
'
:
_pkgres
(
'
recipes/download_uniprotkb.py
'
),
'
params
'
:
[
'
--database
'
,
'
swissprot
'
,
'
--type
'
,
'
fasta
'
]},
'
swissprot
'
:
{
'
download
'
:
{
'
script
'
:
_pkgres
(
'
recipes/download_uniprotkb.py
'
),
'
params
'
:
[
'
--database
'
,
'
swissprot
'
,
'
--type
'
,
'
fasta
'
]},
'
blast
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_blast_dbs.py
'
)},
'
blast
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_blast_dbs.py
'
)},
'
diamond
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_diamond_dbs.py
'
)},
'
diamond
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_diamond_dbs.py
'
)},
'
ghostx
'
:
{
'
script
'
:
_pkgres
(
'
recipes/create_ghostx_dbs.py
'
)},
}
}
}
}
return
recipes
return
recipes
...
...
This diff is collapsed.
Click to expand it.
dbman/recipes/create_ghostx_dbs.py
0 → 100755
+
30
−
0
View file @
57002a0c
#!/usr/bin/env python
import
dbman.helper
as
h
import
subprocess
import
sys
import
os
import
json
from
pathlib
import
Path
metadata
=
h
.
load_metadata
(
'
./.source_metadata.json
'
)
fasta_parts
=
[
p
for
p
in
metadata
[
'
parts
'
]
if
'
fasta
'
in
p
[
'
tags
'
]]
new_parts
=
[]
for
part
in
fasta_parts
:
type
=
None
for
file
in
part
[
'
files
'
]:
name
=
Path
(
file
).
stem
command
=
'
ghostx db -o {} -i {}
'
.
format
(
name
,
file
)
cp
=
subprocess
.
run
(
command
,
shell
=
True
)
if
(
cp
.
returncode
!=
0
):
sys
.
exit
(
cp
)
files
=
[
f
.
name
for
f
in
os
.
scandir
(
'
.
'
)
if
f
.
name
.
startswith
(
name
)
and
not
f
.
name
.
endswith
(
'
.fasta
'
)]
tags
=
[
'
ghostx_db
'
]
tags
.
extend
(
part
[
'
tags
'
])
tags
.
remove
(
'
fasta
'
)
new_parts
.
append
({
'
files
'
:
files
,
'
tags
'
:
tags
})
h
.
create_metadata
(
metadata
[
'
name
'
],
'
ghostx
'
,
metadata
[
'
description
'
],
metadata
[
'
version
'
],
other
=
{
'
parts
'
:
new_parts
})
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