details: http://www.bx.psu.edu/hg/galaxy/rev/91a3bbb52d7a changeset: 2960:91a3bbb52d7a user: Dan Blankenberg <dan@bx.psu.edu> date: Wed Nov 04 12:15:53 2009 -0500 description: Fix maf_utilities.src_split. Should resolve tickets #200, #215 and #220. Note: Do not use bx.align.src_split in Galaxy. diffstat: lib/galaxy/datatypes/converters/maf_to_interval_converter.py | 2 +- lib/galaxy/datatypes/converters/maf_to_interval_converter.xml | 2 +- lib/galaxy/tools/util/maf_utilities.py | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diffs (49 lines): diff -r 4bca8f8ed94d -r 91a3bbb52d7a lib/galaxy/datatypes/converters/maf_to_interval_converter.py --- a/lib/galaxy/datatypes/converters/maf_to_interval_converter.py Wed Nov 04 11:35:50 2009 -0500 +++ b/lib/galaxy/datatypes/converters/maf_to_interval_converter.py Wed Nov 04 12:15:53 2009 -0500 @@ -21,7 +21,7 @@ for block in bx.align.maf.Reader( open( input_name, 'r' ) ): for c in maf_utilities.iter_components_by_src_start( block, species ): if c is not None: - out.write( "%s\t%i\t%i\t%s\n" % ( bx.align.src_split( c.src )[-1], c.get_forward_strand_start(), c.get_forward_strand_end(), c.strand ) ) + out.write( "%s\t%i\t%i\t%s\n" % ( maf_utilities.src_split( c.src )[-1], c.get_forward_strand_start(), c.get_forward_strand_end(), c.strand ) ) count += 1 except Exception, e: print >> sys.stderr, "There was a problem processing your input: %s" % e diff -r 4bca8f8ed94d -r 91a3bbb52d7a lib/galaxy/datatypes/converters/maf_to_interval_converter.xml --- a/lib/galaxy/datatypes/converters/maf_to_interval_converter.xml Wed Nov 04 11:35:50 2009 -0500 +++ b/lib/galaxy/datatypes/converters/maf_to_interval_converter.xml Wed Nov 04 12:15:53 2009 -0500 @@ -1,4 +1,4 @@ -<tool id="CONVERTER_maf_to_interval_0" name="Convert MAF to Genomic Intervals" version="1.0.1"> +<tool id="CONVERTER_maf_to_interval_0" name="Convert MAF to Genomic Intervals" version="1.0.2"> <!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> --> <command interpreter="python">maf_to_interval_converter.py $output1 $input1 ${input1.metadata.dbkey}</command> <inputs> diff -r 4bca8f8ed94d -r 91a3bbb52d7a lib/galaxy/tools/util/maf_utilities.py --- a/lib/galaxy/tools/util/maf_utilities.py Wed Nov 04 11:35:50 2009 -0500 +++ b/lib/galaxy/tools/util/maf_utilities.py Wed Nov 04 12:15:53 2009 -0500 @@ -20,9 +20,12 @@ SRC_SPLIT_CHAR = '.' def src_split( src ): - spec, chrom = bx.align.maf.src_split( src ) - if None in [ spec, chrom ]: - spec = chrom = src + fields = src.split( SRC_SPLIT_CHAR, 1 ) + spec = fields.pop( 0 ) + if fields: + chrom = fields + else: + chrom = spec return spec, chrom def src_merge( spec, chrom, contig = None ): @@ -530,7 +533,7 @@ if suffix: header = "%s%s" % ( header, suffix ) else: - header = "%s%s" % ( header, bx.align.src_split( component.src )[ 0 ] ) + header = "%s%s" % ( header, src_split( component.src )[ 0 ] ) return header def get_attributes_from_fasta_header( header ):