annotate data_manager/novoalign_index_builder.py @ 6:028bec15ea71 draft

planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit a3874e6906be1af7282d62394e1900856190354e-dirty
author sanbi-uwc
date Fri, 04 Mar 2016 03:41:08 -0500
parents b63a406719c5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
1 #!/usr/bin/env python
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
2 # Z. Mashologu (SANBI-UWC)
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
3 # import dict as dict
3
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
4 from __future__ import print_function
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
5 import os
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
6 import sys
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
7 import urllib2
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
8 import logging
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
9 import argparse
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
10 import shlex
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
11 from subprocess import check_call, CalledProcessError
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
12
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
13 log = logging.getLogger(__name__)
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
14
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
15 from json import loads, dumps
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
16
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
17 def get_dbkey_id_name(params, dbkey_description=None):
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
18 dbkey = params['param_dict']['dbkey']
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
19 # TODO: ensure sequence_id is unique and does not already appear in location file
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
20 sequence_id = params['param_dict']['sequence_id']
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
21 if not sequence_id:
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
22 sequence_id = dbkey # uuid.uuid4() generate and use an uuid instead?
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
23
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
24 sequence_name = params['param_dict']['sequence_name']
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
25 if not sequence_name:
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
26 sequence_name = dbkey_description
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
27 if not sequence_name:
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
28 sequence_name = dbkey
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
29 return dbkey, sequence_id, sequence_name
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
30
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
31
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
32 def _make_novocraft_index(fasta_filename, target_directory):
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
33 if os.path.exists(target_directory) and not os.path.isdir(target_directory):
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
34 print("Output directory path already exists but is not a directory: {}".format(target_directory),
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
35 file=sys.stderr)
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
36 elif not os.path.exists(target_directory):
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
37 os.mkdir(target_directory)
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
38
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
39 if 'GALAXY_SLOTS' in os.environ:
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
40 nslots = os.environ['GALAXY_SLOTS']
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
41 else:
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
42 nslots = 1
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
43
3
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
44 #cmdline_str = 'STAR --runMode genomeGenerate --genomeDir {} --genomeFastaFiles {} --runThreadN {}'.format(
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
45 # target_directory,
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
46 # fasta_filename,
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
47 # nslots)
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
48 #cmdline = shlex.split(cmdline_str)
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
49 cmdline = ('touch', '{}/foo.nix'.format(target_directory))
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
50 try:
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
51 check_call(cmdline)
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
52 except CalledProcessError:
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
53 print("Error building RNA STAR index", file=sys.stderr)
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
54 return (target_directory)
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
55
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
56
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
57 def download_from_url(params, target_directory):
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
58 # TODO: we should automatically do decompression here
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
59 urls = filter(bool, map(lambda x: x.strip(), params['param_dict']['reference_source']['user_url'].split('\n')))
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
60 fasta_reader = [urllib2.urlopen(url) for url in urls]
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
61
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
62 _make_novocraft_index(fasta_reader, target_directory)
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
63
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
64
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
65 def download_from_history( params, target_directory):
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
66 # TODO: allow multiple FASTA input files
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
67 input_filename = params['param_dict']['reference_source']['input_fasta']
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
68
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
69 _make_novocraft_index(input_filename, target_directory)
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
70
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
71 REFERENCE_SOURCE_TO_DOWNLOAD = dict(url=download_from_url, history=download_from_history)
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
72
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
73 def main():
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
74 parser = argparse.ArgumentParser(description="Generate Novo-align genome index and JSON describing this")
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
75 parser.add_argument('output_filename')
3
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
76 parser.add_argument('--dbkey_description')
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
77 parser.add_argument('--data_table_name', default='novocraft_index')
3
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
78 args = parser.parse_args()
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
79
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
80 filename = args.output_filename
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
81
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
82 params = loads(open(filename).read())
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
83 target_directory = params['output_data'][0]['extra_files_path']
3
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
84 os.makedirs(target_directory)
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
85
3
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
86 dbkey, sequence_id, sequence_name = get_dbkey_id_name(params, dbkey_description=args.dbkey_description)
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
87 if dbkey in [None, '', '?']:
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
88 raise Exception('"%s" is not a valid dbkey. You must specify a valid dbkey.' % (dbkey))
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
89
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
90 # Fetch the FASTA
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
91 REFERENCE_SOURCE_TO_DOWNLOAD[params['param_dict']['reference_source']['reference_source_selector']]\
3
b63a406719c5 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 91d41d6ac8f81ef614491ed45e129d08b6471545
sanbi-uwc
parents: 2
diff changeset
92 (params, target_directory)
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
93
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
94 data_table_entry = dict(value=sequence_id, dbkey=dbkey, name=sequence_name, path=target_directory)
0
85fbd52dbb36 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit d51fdc6291de173e829a839e98c6c3ae367d84bf
sanbi-uwc
parents:
diff changeset
95
2
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
96 output_datatable_dict = dict(data_tables={args.data_table_name: [data_table_entry]})
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
97 open(filename, 'wb').write(dumps(output_datatable_dict))
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
98
e51fb8188ed9 planemo upload for repository https://github.com/zipho/data_manager_novoalign_index_builder commit 7c74dfc33ffac5de44aae81def9c374f5f5e2a20
sanbi-uwc
parents: 0
diff changeset
99 if __name__ == "__main__": main()