Commit 57002a0c authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Add ghostx db creation

parent be780604
......@@ -142,6 +142,7 @@ def _rename_directory_after_metadata(path):
metadata['location'] = str(newpath.absolute())
return metadata
return None
def run_in_tempdir(func=None, success=None, fail=None):
dbtmpdir = os.path.join(_databases_dir(), "tmp")
......@@ -166,10 +167,12 @@ def _recipes(args):
'card': {'download': {'script': _pkgres('recipes/')},
'blast': {'script': _pkgres('recipes/')},
'diamond': {'script': _pkgres('recipes/')},
'ghostx': {'script': _pkgres('recipes/')},
'swissprot': {'download': {'script': _pkgres('recipes/'), 'params': ['--database', 'swissprot', '--type', 'fasta']},
'blast': {'script': _pkgres('recipes/')},
'diamond': {'script': _pkgres('recipes/')},
'ghostx': {'script': _pkgres('recipes/')},
return recipes
#!/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 =, shell=True)
if (cp.returncode != 0):
files = [ for f in os.scandir('.') if and not'.fasta')]
tags = ['ghostx_db']
new_parts.append({'files': files, 'tags': tags})
h.create_metadata(metadata['name'], 'ghostx', metadata['description'], metadata['version'], other={'parts': new_parts})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment