changeset 6:d22f69a2e80e draft

Uploaded
author ieguinoa
date Tue, 23 Jul 2019 09:25:04 -0400
parents 3888ec1918d0
children 954d617c323d
files data_manager/salmon_index_builder.py data_manager/salmon_index_builder.xml data_manager_conf.xml tool-data/all_fasta.loc.sample tool-data/salmon_indexes.loc.sample tool_data_table_conf.xml.sample
diffstat 6 files changed, 42 insertions(+), 17 deletions(-) [+]
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 )
 
 
--- a/data_manager/salmon_index_builder.xml	Thu Jan 03 10:51:18 2019 -0500
+++ b/data_manager/salmon_index_builder.xml	Tue Jul 23 09:25:04 2019 -0400
@@ -1,8 +1,11 @@
 <tool id="salmon_index_builder_data_manager" name="Salmon" tool_type="manage_data" version="0.9.1">
     <description>index builder</description>
     <requirements>
-        <requirement type="package" version="0.9.1">salmon</requirement>
+        <requirement type="package" version="0.11.2">salmon</requirement>
     </requirements>
+   <macros>
+       <token name="@IDX_VERSION@">q5</token>
+   </macros>
     <command detect_errors="exit_code"><![CDATA[
         python '$__tool_directory__/salmon_index_builder.py' --output '${out_file}'
             --fasta_filename '${all_fasta_source.fields.path}'
@@ -10,6 +13,7 @@
             --fasta_description '${all_fasta_source.fields.name}'
             --kmer_size "${kmer_size}"
             --data_table_name salmon_indexes
+            --index_version @IDX_VERSION@
         ]]>
     </command>
     <inputs>
--- a/data_manager_conf.xml	Thu Jan 03 10:51:18 2019 -0500
+++ b/data_manager_conf.xml	Tue Jul 23 09:25:04 2019 -0400
@@ -9,11 +9,12 @@
                 <column name="path" output_ref="out_file" >
                     <move type="directory" relativize_symlinks="True">
                         <!-- <source>${path}</source>--> <!-- out_file.extra_files_path is used as base by default --> <!-- if no source, eg for type=directory, then refers to base -->
-                        <target base="${GALAXY_DATA_MANAGER_DATA_PATH}">${dbkey}/salmon_index/${path}</target>
+                        <target base="${GALAXY_DATA_MANAGER_DATA_PATH}">${dbkey}/salmon_index/${value}</target>
                     </move>
-                    <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/${dbkey}/salmon_index/${path}</value_translation>
+                    <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/${dbkey}/salmon_index/${value}/${path}</value_translation>
                     <value_translation type="function">abspath</value_translation>
                 </column>
+                <column name="version" />
             </output>
         </data_table>
     </data_manager>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/all_fasta.loc.sample	Tue Jul 23 09:25:04 2019 -0400
@@ -0,0 +1,18 @@
+#This file lists the locations and dbkeys of all the fasta files
+#under the "genome" directory (a directory that contains a directory
+#for each build). The script extract_fasta.py will generate the file
+#all_fasta.loc. This file has the format (white space characters are
+#TAB characters):
+#
+#<unique_build_id>	<dbkey>	<display_name>	<file_path>
+#
+#So, all_fasta.loc could look something like this:
+#
+#apiMel3	apiMel3	Honeybee (Apis mellifera): apiMel3	/path/to/genome/apiMel3/apiMel3.fa
+#hg19canon	hg19	Human (Homo sapiens): hg19 Canonical	/path/to/genome/hg19/hg19canon.fa
+#hg19full	hg19	Human (Homo sapiens): hg19 Full	/path/to/genome/hg19/hg19full.fa
+#
+#Your all_fasta.loc file should contain an entry for each individual
+#fasta file. So there will be multiple fasta files for each build,
+#such as with hg19 above.
+#
--- a/tool-data/salmon_indexes.loc.sample	Thu Jan 03 10:51:18 2019 -0500
+++ b/tool-data/salmon_indexes.loc.sample	Tue Jul 23 09:25:04 2019 -0400
@@ -1,28 +1,32 @@
-# salmon_indexes.loc.sample
+# salmon_indexes_versioned.loc.sample
 # This is a *.loc.sample file distributed with Galaxy that enables tools
 # to use a directory of indexed data files. This one is for Salmon.
 # See the wiki: http://wiki.galaxyproject.org/Admin/NGS%20Local%20Setup
 # First create these data files and save them in your own data directory structure.
-# Then, create a kallisto_indexes.loc file to use those indexes with tools.
+# Then, create a salmon_indexes_versioned.loc.sample file to use those indexes with tools.
 # Copy this file, save it with the same name (minus the .sample), 
 # follow the format examples, and store the result in this directory.
 # The file should include an one line entry for each index set.
 # The path points to the "basename" for the set, not a specific file.
 # It has four text columns seperated by TABS.
 #
-# <unique_build_id>	<dbkey>	<display_name>	<file_base_path>
+# <unique_build_id>	<dbkey>	<display_name>	<file_base_path> <version>
 #
+# The <version> column can be retrieved from the header.json file in the index folder. e.g   "IndexVersion": "q5"
+
+
+
 # So, for example, if you had sacCer3 indexes stored in:
 #
 #    /depot/data2/galaxy/sacCer3/salmon_indexes/
 #
 # then the salmon_indexes.loc entry could look like this:
 #
-#sacCer3	sacCer3	S. cerevisiae Apr. 2011 (SacCer_Apr2011/sacCer3) (sacCer3)	/depot/data2/galaxy/sacCer3/salmon_indexes
+#sacCer3	sacCer3	S. cerevisiae Apr. 2011 (SacCer_Apr2011/sacCer3) (sacCer3)	/depot/data2/galaxy/sacCer3/salmon_indexes/version_3/	q6
 #
 #More examples:
 #
-#mm10	mm10	Mouse (mm10)	/depot/data2/galaxy/salmon_indexes/mm10
-#dm3	dm3		D. melanogaster (dm3)	/depot/data2/galaxy/salmon_indexes/dm3
+#mm10	mm10	Mouse (mm10)	/depot/data2/galaxy/salmon_indexes/mm10/version_2	q4
+#dm3	dm3		D. melanogaster (dm3)	/depot/data2/galaxy/salmon_indexes/dm3/version_1	q5
 #
 #
--- a/tool_data_table_conf.xml.sample	Thu Jan 03 10:51:18 2019 -0500
+++ b/tool_data_table_conf.xml.sample	Tue Jul 23 09:25:04 2019 -0400
@@ -1,7 +1,7 @@
 <tables>
     <!-- Locations of indexes in salmon mapper format -->
-    <table name="salmon_indexes" comment_char="#" allow_duplicate_entries="False">
-        <columns>value, dbkey, name, path</columns>
-        <file path="tool-data/salmon_indexes.loc" />
+    <table name="salmon_indexes_versioned" comment_char="#" allow_duplicate_entries="False">
+        <columns>value, dbkey, name, path, version</columns>
+        <file path="tool-data/salmon_indexes_versioned.loc" />
     </table>
 </tables>