changeset 14:9986482cbb48 draft

Uploaded
author bgruening
date Mon, 18 Feb 2013 16:03:48 -0500
parents 7a143c7b3f1b
children eef8425a64d8
files bismark_methylation_extractor.py bismark_wrapper.py tool-data/bowtie2_indices.loc.sample tool-data/bowtie_indices.loc.sample
diffstat 4 files changed, 81 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bismark_methylation_extractor.py	Tue Nov 13 13:32:56 2012 -0500
+++ b/bismark_methylation_extractor.py	Mon Feb 18 16:03:48 2013 -0500
@@ -25,6 +25,8 @@
     parser = argparse.ArgumentParser(description='Wrapper for the bismark methylation caller.')
 
     # input options
+    parser.add_argument( '--bismark_path', dest='bismark_path', help='Path to the bismark perl scripts' )
+
     parser.add_argument( '--infile', help='Input file in SAM format.' )
     parser.add_argument( '--single-end', dest='single_end', action="store_true" )
     parser.add_argument( '--paired-end', dest='paired_end', action="store_true" )
@@ -70,6 +72,9 @@
     # Build methylation extractor command
     output_dir = tempfile.mkdtemp()
     cmd = 'bismark_methylation_extractor --no_header -o %s %s %s'
+    if args.bismark_path:
+        # add the path to the bismark perl scripts, that is needed for galaxy
+        cmd = os.path.join(args.bismark_path, cmd)
 
     additional_opts = ''
     # Set up all options
--- a/bismark_wrapper.py	Tue Nov 13 13:32:56 2012 -0500
+++ b/bismark_wrapper.py	Mon Feb 18 16:03:48 2013 -0500
@@ -120,7 +120,7 @@
             cmd_index = 'bismark_genome_preparation %s ' % ( tmp_index_dir )
         if args.bismark_path:
             # add the path to the bismark perl scripts, that is needed for galaxy
-            cmd_index = '%s/%s' % (args.bismark_path, cmd_index)
+            cmd_index = os.path.join(args.bismark_path, cmd_index)
         try:
             tmp = tempfile.NamedTemporaryFile( dir=tmp_index_dir ).name
             tmp_stderr = open( tmp, 'wb' )
@@ -155,7 +155,7 @@
     cmd = 'bismark %(args)s --temp_dir %(tmp_bismark_dir)s -o %(output_dir)s --quiet %(genome_folder)s %(reads)s'
     if args.bismark_path:
         # add the path to the bismark perl scripts, that is needed for galaxy
-        cmd = '%s/%s' % (args.bismark_path, cmd)
+        cmd = os.path.join(args.bismark_path, cmd)
 
     arguments = {
         'genome_folder': index_dir,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/bowtie2_indices.loc.sample	Mon Feb 18 16:03:48 2013 -0500
@@ -0,0 +1,37 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of Bowtie2 indexed sequences data files. You will
+#need to create these data files and then create a bowtie_indices.loc
+#file similar to this one (store it in this directory) that points to
+#the directories in which those files are stored. The bowtie2_indices.loc
+#file has this format (longer white space characters are TAB characters):
+#
+#<unique_build_id>   <dbkey>   <display_name>   <file_base_path>
+#
+#So, for example, if you had hg18 indexed stored in
+#/depot/data2/galaxy/bowtie2/hg18/,
+#then the bowtie2_indices.loc entry would look like this:
+#
+#hg18	hg18	hg18	/depot/data2/galaxy/bowtie2/hg18/hg18
+#
+#and your /depot/data2/galaxy/bowtie2/hg18/ directory
+#would contain hg18.*.ebwt files:
+#
+#-rw-r--r--  1 james    universe 830134 2005-09-13 10:12 hg18.1.ebwt
+#-rw-r--r--  1 james    universe 527388 2005-09-13 10:12 hg18.2.ebwt
+#-rw-r--r--  1 james    universe 269808 2005-09-13 10:12 hg18.3.ebwt
+#...etc...
+#
+#Your bowtie2_indices.loc file should include an entry per line for each
+#index set you have stored. The "file" in the path does not actually
+#exist, but it is the prefix for the actual index files. For example:
+#
+#hg18canon			hg18	hg18 Canonical	/depot/data2/galaxy/bowtie2/hg18/hg18canon
+#hg18full			hg18	hg18 Full		/depot/data2/galaxy/bowtie2/hg18/hg18full
+#/orig/path/hg19	hg19	hg19			/depot/data2/galaxy/bowtie2/hg19/hg19
+#...etc...
+#
+#Note that for backwards compatibility with workflows, the unique ID of
+#an entry must be the path that was in the original loc file, because that
+#is the value stored in the workflow for that parameter. That is why the
+#hg19 entry above looks odd. New genomes can be better-looking.
+#
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/bowtie_indices.loc.sample	Mon Feb 18 16:03:48 2013 -0500
@@ -0,0 +1,37 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of Bowtie indexed sequences data files. You will
+#need to create these data files and then create a bowtie_indices.loc
+#file similar to this one (store it in this directory) that points to
+#the directories in which those files are stored. The bowtie_indices.loc
+#file has this format (longer white space characters are TAB characters):
+#
+#<unique_build_id>   <dbkey>   <display_name>   <file_base_path>
+#
+#So, for example, if you had hg18 indexed stored in 
+#/depot/data2/galaxy/bowtie/hg18/, 
+#then the bowtie_indices.loc entry would look like this:
+#
+#hg18   hg18   hg18   /depot/data2/galaxy/bowtie/hg18/hg18
+#
+#and your /depot/data2/galaxy/bowtie/hg18/ directory
+#would contain hg18.*.ebwt files:
+#
+#-rw-r--r--  1 james    universe 830134 2005-09-13 10:12 hg18.1.ebwt
+#-rw-r--r--  1 james    universe 527388 2005-09-13 10:12 hg18.2.ebwt
+#-rw-r--r--  1 james    universe 269808 2005-09-13 10:12 hg18.3.ebwt
+#...etc...
+#
+#Your bowtie_indices.loc file should include an entry per line for each
+#index set you have stored. The "file" in the path does not actually
+#exist, but it is the prefix for the actual index files. For example:
+#
+#hg18canon          hg18   hg18 Canonical   /depot/data2/galaxy/bowtie/hg18/hg18canon
+#hg18full           hg18   hg18 Full        /depot/data2/galaxy/bowtie/hg18/hg18full
+#/orig/path/hg19    hg19   hg19             /depot/data2/galaxy/bowtie/hg19/hg19
+#...etc...
+#
+#Note that for backwards compatibility with workflows, the unique ID of
+#an entry must be the path that was in the original loc file, because that
+#is the value stored in the workflow for that parameter. That is why the
+#hg19 entry above looks odd. New genomes can be better-looking.
+#