Mercurial > repos > jjohnson > rsem
changeset 3:59459de65740
mv RSEM datatypes to separate repository, remove samtools dependency
author | Jim Johnson <jj@umn.edu> |
---|---|
date | Mon, 10 Mar 2014 07:19:56 -0500 |
parents | 5949673f9e3e |
children | 30a8343fb0e7 |
files | datatypes_conf.xml repository_dependencies.xml rsem.py rsem_calculate_expression.xml rsem_prepare_reference.xml tool_dependencies.xml |
diffstat | 6 files changed, 7 insertions(+), 97 deletions(-) [+] |
line wrap: on
line diff
--- a/datatypes_conf.xml Fri Feb 07 07:34:29 2014 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -<?xml version="1.0"?> -<datatypes> - <datatype_files> - <datatype_file name="rsem.py"/> - </datatype_files> - <registration> - <datatype extension="rsem_ref" type="galaxy.datatypes.rsem:RsemReference" display_in_upload="True"/> - </registration> -</datatypes> -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/repository_dependencies.xml Mon Mar 10 07:19:56 2014 -0500 @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<repositories description="RSEM datatype definitions."> + <repository changeset_revision="77151afcd323" name="rsem_datatypes" owner="jjohnson" toolshed="http://toolshed.g2.bx.psu.edu/" /> +</repositories>
--- a/rsem.py Fri Feb 07 07:34:29 2014 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -""" -RSEM datatypes -""" -import os,os.path,re,sys -import galaxy.datatypes.data -from galaxy.datatypes.images import Html -from galaxy.datatypes.metadata import MetadataElement - -class RsemReference( Html ): - """Class describing an RSEM reference""" - MetadataElement( name='reference_name', default=None, desc='RSEM Reference Name', readonly=True, visible=True, no_value=None ) - - file_ext = 'rsem_ref' - is_binary = True - composite_type = 'auto_primary_file' - allow_datatype_change = False - - def generate_primary_file( self, dataset = None ): - """ - This is called only at upload to write the html file - cannot rename the datasets here - they come with the default unfortunately - """ - return '<html><head></head><body>AutoGenerated Primary File for RSEM Reference Composite Dataset</body></html>' - - def regenerate_primary_file(self,dataset): - """ - cannot do this until we are setting metadata - """ - refname = dataset.metadata.reference_name - flist = os.listdir(dataset.extra_files_path) - rval = ['<html><head><title>RSEM Reference %s</title></head><p/>Comprises the following files:<p/><ul>' % (refname)] - for i,fname in enumerate(flist): - sfname = os.path.split(fname)[-1] - rval.append( '<li><a href="%s">%s</a>' % ( sfname, sfname ) ) - rval.append( '</ul></html>' ) - f = file(dataset.file_name,'w') - f.write("\n".join( rval )) - f.write('\n') - f.close() - - def set_peek( self, dataset, is_multi_byte=False ): - if not dataset.dataset.purged: - dataset.peek = "RSEM Reference (%s)" % ( dataset.metadata.reference_name ) - dataset.blurb = "RSEM Reference (%s)" % ( dataset.metadata.reference_name ) - else: - dataset.peek = 'RSEM Reference (%s) does not exist' % ( dataset.metadata.reference_name ) - dataset.blurb = 'RSEM Reference (%s) purged from disk' % ( dataset.metadata.reference_name ) - - def display_peek( self, dataset ): - try: - return dataset.peek - except: - return "RSEM Reference" - - def set_meta( self, dataset, overwrite = True, **kwd ): - """ - Expecting files: - extra_files_path/<reference_name>.grp - extra_files_path/<reference_name>.ti - extra_files_path/<reference_name>.seq - extra_files_path/<reference_name>.transcripts.fa - Optionally includes files: - extra_files_path/<reference_name>.chrlist - extra_files_path/<reference_name>.idx.fa - extra_files_path/<reference_name>.4.ebwt - extra_files_path/<reference_name>.3.ebwt - extra_files_path/<reference_name>.2.ebwt - extra_files_path/<reference_name>.1.ebwt - extra_files_path/<reference_name>.rev.2.ebwt - extra_files_path/<reference_name>.rev.1.ebwt - """ - pat = '^(.*)\.grp$' - efp = dataset.extra_files_path - flist = os.listdir(efp) - for i,fname in enumerate(flist): - m = re.match(pat,fname) - if m: - dataset.metadata.reference_name = m.groups()[0] - break - self.regenerate_primary_file(dataset) - -
--- a/rsem_calculate_expression.xml Fri Feb 07 07:34:29 2014 -0600 +++ b/rsem_calculate_expression.xml Mon Mar 10 07:19:56 2014 -0500 @@ -2,7 +2,6 @@ <description>RNA-Seq by Expectation-Maximization</description> <requirements> <requirement type="package" version="1.1.17">rsem</requirement> - <requirement type="package" version="0.1.19">samtools</requirement> <requirement type="package" version="1.0.0">bowtie</requirement> </requirements> <command>
--- a/rsem_prepare_reference.xml Fri Feb 07 07:34:29 2014 -0600 +++ b/rsem_prepare_reference.xml Mon Mar 10 07:19:56 2014 -0500 @@ -5,6 +5,7 @@ <requirement type="package" version="1.0.0">bowtie</requirement> </requirements> <command> + echo $reference_name " " | tee $reference_file && mkdir $reference_file.extra_files_path && cd $reference_file.extra_files_path && rsem-prepare-reference @@ -31,6 +32,7 @@ $reference.reference_fasta_file #end if $reference_name + > ${reference_name}.log </command> <inputs> <conditional name="reference"> @@ -61,7 +63,7 @@ </help> </param> <param name="reference_name" type="text" value="rsem_ref_name" label="reference name"> - <help>A one work name for this RSEM reference containing only letters, digits, and underscore characters</help> + <help>A one word name for this RSEM reference containing only letters, digits, and underscore characters</help> <validator type="regex" message="Use only letters, digits, and underscore characters">^\w+$</validator> </param> <conditional name="polya">
--- a/tool_dependencies.xml Fri Feb 07 07:34:29 2014 -0600 +++ b/tool_dependencies.xml Mon Mar 10 07:19:56 2014 -0500 @@ -3,9 +3,6 @@ <package name="rsem" version="1.1.17"> <repository changeset_revision="cd7f70d4c687" name="package_rsem_1_1_17" owner="jjohnson" toolshed="http://toolshed.g2.bx.psu.edu" /> </package> - <package name="samtools" version="0.1.19"> - <repository changeset_revision="00e17a794a2e" name="package_samtools_0_1_19" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu" /> - </package> <package name="bowtie" version="1.0.0"> <repository changeset_revision="9fcaaedbbfd6" name="package_bowtie_1_0_0" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu" /> </package>