diff data_manager/salmon_index_builder.py @ 6:d22f69a2e80e draft

Uploaded
author ieguinoa
date Tue, 23 Jul 2019 09:25:04 -0400
parents 3888ec1918d0
children cbe62bd6e149
line wrap: on
line diff
--- a/data_manager/salmon_index_builder.py	Thu Jan 03 10:51:18 2019 -0500
+++ b/data_manager/salmon_index_builder.py	Tue Jul 23 09:25:04 2019 -0400
@@ -8,7 +8,7 @@
 import sys
 from json import dumps, loads
 
-DEFAULT_DATA_TABLE_NAME = "salmon_indexes"
+DEFAULT_DATA_TABLE_NAME = "salmon_indexes_versioned"
 
 
 def get_id_name( params, dbkey, fasta_description=None):
@@ -30,19 +30,17 @@
     target_directory = params[ 'output_data' ][0]['extra_files_path']
     if not os.path.exists( target_directory ):
         os.mkdir( target_directory )
-    path=sequence_id
     args = [ 'salmon', 'index' ]
     if options.kmer_size != '':
         args.append('-k')
         args.append(options.kmer_size)
-        path=path + '_kmer_'+ options.kmer_size   
-    args.extend( [ '-t' , options.fasta_filename, '-i', target_directory ] )
+    args.extend( [ '-t', options.fasta_filename, '-i', target_directory ] )
     proc = subprocess.Popen( args=args, shell=False)
     return_code = proc.wait()
     if return_code:
         print("Error building index.", file=sys.stderr)
         sys.exit( return_code )
-    data_table_entry = dict( value=sequence_id, dbkey=options.fasta_dbkey, name=sequence_name, path=path )
+    data_table_entry = dict( value=sequence_id, dbkey=options.fasta_dbkey, name=sequence_name, path=sequence_id, version=options.index_version )
     _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry )