galaxy-commits
  Threads by month 
                
            - ----- 2025 -----
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2024 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2023 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2022 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2021 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2020 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2019 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2018 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2017 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2016 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2015 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2014 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2013 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2012 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2011 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2010 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 
February 2011
- 1 participants
 - 166 discussions
 
                        
                            
                                
                            
                            commit/galaxy-central: jgoecks: Fix searching functionality and labels in published item grids.
                        
                        
by Bitbucket 11 Feb '11
                    by Bitbucket 11 Feb '11
11 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/a8bfcfeca73b/
changeset:   r5045:a8bfcfeca73b
user:        jgoecks
date:        2011-02-11 14:42:05
summary:     Fix searching functionality and labels in published item grids.
affected #:  4 files (174 bytes)
--- a/lib/galaxy/web/controllers/history.py	Fri Feb 11 00:53:49 2011 -0500
+++ b/lib/galaxy/web/controllers/history.py	Fri Feb 11 08:42:05 2011 -0500
@@ -135,15 +135,15 @@
     columns = [
         NameURLColumn( "Name", key="name", filterable="advanced" ),
         grids.OwnerAnnotationColumn( "Annotation", key="annotation", model_annotation_association_class=model.HistoryAnnotationAssociation, filterable="advanced" ),
-        grids.OwnerColumn( "Owner", key="owner", model_class=model.User, filterable="advanced" ), 
+        grids.OwnerColumn( "Owner", key="username", model_class=model.User, filterable="advanced" ), 
         grids.CommunityRatingColumn( "Community Rating", key="rating" ),
         grids.CommunityTagsColumn( "Community Tags", key="tags", model_tag_association_class=model.HistoryTagAssociation, filterable="advanced", grid_name="PublicHistoryListGrid" ),
         grids.ReverseSortColumn( "Last Updated", key="update_time", format=time_ago )
     ]
     columns.append( 
         grids.MulticolFilterColumn(  
-        "Search", 
-        cols_to_filter=[ columns[0], columns[1], columns[2] ], 
+        "Search name, annotation, owner, and tags", 
+        cols_to_filter=[ columns[0], columns[1], columns[2], columns[4] ], 
         key="free-text-search", visible=False, filterable="standard" )
                 )
     operations = []
--- a/lib/galaxy/web/controllers/page.py	Fri Feb 11 00:53:49 2011 -0500
+++ b/lib/galaxy/web/controllers/page.py	Fri Feb 11 08:42:05 2011 -0500
@@ -63,15 +63,15 @@
     columns = [
         grids.PublicURLColumn( "Title", key="title", filterable="advanced" ),
         grids.OwnerAnnotationColumn( "Annotation", key="annotation", model_annotation_association_class=model.PageAnnotationAssociation, filterable="advanced" ),
-        grids.OwnerColumn( "Owner", key="owner", model_class=model.User, filterable="advanced" ),
+        grids.OwnerColumn( "Owner", key="username", model_class=model.User, filterable="advanced" ),
         grids.CommunityRatingColumn( "Community Rating", key="rating" ), 
         grids.CommunityTagsColumn( "Community Tags", key="tags", model_tag_association_class=model.PageTagAssociation, filterable="advanced", grid_name="PageAllPublishedGrid" ),
         grids.ReverseSortColumn( "Last Updated", key="update_time", format=time_ago )
     ]
     columns.append( 
         grids.MulticolFilterColumn(  
-        "Search", 
-        cols_to_filter=[ columns[0], columns[1], columns[2], columns[3] ], 
+        "Search title, annotation, owner, and tags", 
+        cols_to_filter=[ columns[0], columns[1], columns[2], columns[4] ], 
         key="free-text-search", visible=False, filterable="standard" )
                 )
     def build_initial_query( self, trans, **kwargs ):
--- a/lib/galaxy/web/controllers/visualization.py	Fri Feb 11 00:53:49 2011 -0500
+++ b/lib/galaxy/web/controllers/visualization.py	Fri Feb 11 08:42:05 2011 -0500
@@ -50,15 +50,15 @@
     columns = [
         grids.PublicURLColumn( "Title", key="title", filterable="advanced" ),
         grids.OwnerAnnotationColumn( "Annotation", key="annotation", model_annotation_association_class=model.VisualizationAnnotationAssociation, filterable="advanced" ),
-        grids.OwnerColumn( "Owner", key="owner", model_class=model.User, filterable="advanced" ),
+        grids.OwnerColumn( "Owner", key="username", model_class=model.User, filterable="advanced" ),
         grids.CommunityRatingColumn( "Community Rating", key="rating" ), 
         grids.CommunityTagsColumn( "Community Tags", key="tags", model_tag_association_class=model.VisualizationTagAssociation, filterable="advanced", grid_name="VisualizationAllPublishedGrid" ),
         grids.ReverseSortColumn( "Last Updated", key="update_time", format=time_ago )
     ]
     columns.append( 
         grids.MulticolFilterColumn(  
-        "Search", 
-        cols_to_filter=[ columns[0], columns[1], columns[2], columns[3] ], 
+        "Search title, annotation, owner, and tags", 
+        cols_to_filter=[ columns[0], columns[1], columns[2], columns[4] ], 
         key="free-text-search", visible=False, filterable="standard" )
                 )
     def build_initial_query( self, trans, **kwargs ):
--- a/lib/galaxy/web/controllers/workflow.py	Fri Feb 11 00:53:49 2011 -0500
+++ b/lib/galaxy/web/controllers/workflow.py	Fri Feb 11 08:42:05 2011 -0500
@@ -66,15 +66,15 @@
     columns = [
         grids.PublicURLColumn( "Name", key="name", filterable="advanced" ),
         grids.OwnerAnnotationColumn( "Annotation", key="annotation", model_annotation_association_class=model.StoredWorkflowAnnotationAssociation, filterable="advanced" ),
-        grids.OwnerColumn( "Owner", key="owner", model_class=model.User, filterable="advanced" ),
+        grids.OwnerColumn( "Owner", key="username", model_class=model.User, filterable="advanced" ),
         grids.CommunityRatingColumn( "Community Rating", key="rating" ), 
         grids.CommunityTagsColumn( "Community Tags", key="tags", model_tag_association_class=model.StoredWorkflowTagAssociation, filterable="advanced", grid_name="PublicWorkflowListGrid" ),
         grids.ReverseSortColumn( "Last Updated", key="update_time", format=time_ago )
     ]
     columns.append( 
         grids.MulticolFilterColumn(  
-        "Search", 
-        cols_to_filter=[ columns[0], columns[1], columns[2] ], 
+        "Search name, annotation, owner, and tags", 
+        cols_to_filter=[ columns[0], columns[1], columns[2], columns[4] ], 
         key="free-text-search", visible=False, filterable="standard" )
                 )
     operations = []
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            commit/galaxy-central: kanwei: trackster: Properly return NO_DATA for LineTrack datasets, fix error when no data is available
                        
                        
by Bitbucket 11 Feb '11
                    by Bitbucket 11 Feb '11
11 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/384f3b803e64/
changeset:   r5044:384f3b803e64
user:        kanwei
date:        2011-02-11 06:53:49
summary:     trackster: Properly return NO_DATA for LineTrack datasets, fix error when no data is available
affected #:  3 files (329 bytes)
--- a/lib/galaxy/datatypes/interval.py	Thu Feb 10 17:43:39 2011 -0500
+++ b/lib/galaxy/datatypes/interval.py	Fri Feb 11 00:53:49 2011 -0500
@@ -1161,7 +1161,7 @@
         resolution = max( resolution, 1 )
         return resolution
     def get_track_type( self ):
-        return "LineTrack", {"data": "bigwig"}
+        return "LineTrack", {"data": "bigwig", "index": "bigwig"}
 
 class CustomTrack ( Tabular ):
     """UCSC CustomTrack"""
--- a/lib/galaxy/visualization/tracks/data_providers.py	Thu Feb 10 17:43:39 2011 -0500
+++ b/lib/galaxy/visualization/tracks/data_providers.py	Fri Feb 11 00:53:49 2011 -0500
@@ -48,13 +48,13 @@
         # Override.
         pass
     
-    def has_data( self, chrom, start, end ):
+    def has_data( self, chrom, start, end, **kwargs ):
         """
         Returns true if dataset has data in the specified genome window, false
         otherwise.
         """
         # Override.
-        return False
+        pass
         
     def get_data( self, chrom, start, end, **kwargs ):
         """ Returns data in region defined by chrom, start, and end. """
@@ -140,10 +140,9 @@
         else:
             return results, stats[level]["max"], stats[level]["avg"], stats[level]["delta"]
             
-    def has_data( self, chrom, start, end ):
+    def has_data( self, chrom ):
         """
-        Returns true if dataset has data in the specified genome window, false
-        otherwise.
+        Returns true if dataset has data for this chrom
         """
         
         # Get summary tree.
@@ -154,8 +153,7 @@
             self.CACHE[filename] = st
             
         # Check for data.
-        level = ceil( log( 100000, st.block_size ) ) - 1
-        return ( st.query( chrom, int(start), int(end), level ) is not None )
+        return st.chrom_blocks.get(chrom, None) is not None
 
 class VcfDataProvider( TracksDataProvider ):
     """
@@ -405,14 +403,24 @@
     """
     BigWig data provider for the Galaxy track browser. 
     """
-                 
-    def get_data( self, chrom, start, end, **kwargs ):
-        # Bigwig has the possibility of it being a standalone bigwig file, in which case we use
-        # original_dataset, or coming from wig->bigwig conversion in which we use converted_dataset
+    def _get_dataset( self ):
         if self.converted_dataset is not None:
             f = open( self.converted_dataset.file_name )
         else:
             f = open( self.original_dataset.file_name )
+        return f
+        
+    def has_data( self, chrom ):
+        f = self._get_dataset()
+        bw = BigWigFile(file=f)
+        all_dat = bw.query(chrom, 0, 2147483647, 1)
+        f.close()
+        return all_dat is not None
+        
+    def get_data( self, chrom, start, end, **kwargs ):
+        # Bigwig has the possibility of it being a standalone bigwig file, in which case we use
+        # original_dataset, or coming from wig->bigwig conversion in which we use converted_dataset
+        f = self._get_dataset()
         bw = BigWigFile(file=f)
         
         if 'stats' in kwargs:
@@ -426,7 +434,6 @@
                      'min': float( all_dat['min'] ), \
                      'total_frequency': float( all_dat['coverage'] ) }
                      
-        
         start = int(start)
         end = int(end)
         num_points = 2000
@@ -439,9 +446,10 @@
         pos = start
         step_size = (end - start) / num_points
         result = []
-        for dat_dict in data:
-            result.append( (pos, float_nan(dat_dict['mean']) ) )
-            pos += step_size
+        if data:
+            for dat_dict in data:
+                result.append( (pos, float_nan(dat_dict['mean']) ) )
+                pos += step_size
             
         return result
 
--- a/lib/galaxy/web/controllers/tracks.py	Thu Feb 10 17:43:39 2011 -0500
+++ b/lib/galaxy/web/controllers/tracks.py	Fri Feb 11 00:53:49 2011 -0500
@@ -458,13 +458,17 @@
             return msg
             
         # Check for data in the genome window.
-        # TODO: Not all tracks have an index data source, so need to try alternative data sources to check for data.
-        if chrom and low and high and data_sources.get( 'index' ):
+        if data_sources.get( 'index' ):
             tracks_dataset_type = data_sources['index']['name']
             indexer = get_data_provider( tracks_dataset_type )( dataset.get_converted_dataset( trans, tracks_dataset_type ), dataset )
-            if not indexer.has_data( chrom, low, high ):
+            if not indexer.has_data( chrom ):
                 return messages.NO_DATA
-
+        else:
+            # Standalone data provider
+            standalone_provider = get_data_provider(data_sources['data_standalone']['name'])( dataset )
+            kwargs = {"stats": True}
+            if not standalone_provider.has_data( chrom ):
+                return messages.NO_DATA
         return messages.DATA
         
     @web.json
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            commit/galaxy-central: kanwei: trackster: Remove content-div margin and border-top
                        
                        
by Bitbucket 10 Feb '11
                    by Bitbucket 10 Feb '11
10 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/7234805d1f92/
changeset:   r5043:7234805d1f92
user:        kanwei
date:        2011-02-10 23:43:39
summary:     trackster: Remove content-div margin and border-top
affected #:  2 files (63 bytes)
--- a/static/june_2007_style/blue/trackster.css	Thu Feb 10 17:19:40 2011 -0500
+++ b/static/june_2007_style/blue/trackster.css	Thu Feb 10 17:43:39 2011 -0500
@@ -22,7 +22,7 @@
 .track{background:white;}
 .track-header{text-align:left;padding:4px 0px;color:#666;}
 .track-header .menubutton{margin-left:0px;}
-.track-content{overflow:hidden;text-align:center;margin-bottom:2px;border-top:1px solid #eee;border-bottom:#eee solid 1px;background:#eee url('/static/images/tracks/diag_bg.gif');min-height:16px;}
+.track-content{overflow:hidden;text-align:center;border-bottom:1px solid #eee;background:#eee url('/static/images/tracks/diag_bg.gif');min-height:16px;}
 .label-track .track-content{background:white;}
 .track-tile{background:white;}
 .track-tile canvas{position:relative;z-index:100;}
--- a/static/june_2007_style/trackster.css.tmpl	Thu Feb 10 17:19:40 2011 -0500
+++ b/static/june_2007_style/trackster.css.tmpl	Thu Feb 10 17:43:39 2011 -0500
@@ -146,9 +146,8 @@
 .track-content {
     overflow: hidden;
     text-align: center;
-    margin-bottom: 2px;
-    border-top: 1px solid #eee;
-    border-bottom: #eee solid 1px;
+/*    border-top: 1px solid #eee; */
+    border-bottom: 1px solid #eee;
     background: #eee url('/static/images/tracks/diag_bg.gif');
     min-height: 16px;
 }
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/c2d187cf4428/
changeset:   r5042:c2d187cf4428
user:        jgoecks
date:        2011-02-10 23:19:40
summary:     Extend extract_genomic_dna tool to support GFF/GTF features and custom genomes. For GFF/GTF files, tool provides option to return sequence data for each feature's intervals, which are split across lines in GFF/GTF files. Tool also now accepts sequence data from a history item, enabling the extraction of data from custom genomes. New functional tests added to cover new functionality.
affected #:  5 files (5.5 KB)
--- a/lib/galaxy/datatypes/util/gff_util.py	Thu Feb 10 15:53:06 2011 -0500
+++ b/lib/galaxy/datatypes/util/gff_util.py	Thu Feb 10 17:19:40 2011 -0500
@@ -257,4 +257,18 @@
         # Could not split attributes string, so entire string must be 
         # 'group' attribute. This is the case for strictly GFF files.
         attributes['group'] = attr_str
-    return attributes
\ No newline at end of file
+    return attributes
+    
+def gff_attributes_to_str( attrs, gff_format ):
+    """
+    Convert GFF attributes to string. Supported formats are GFF3, GTF. 
+    """
+    if gff_format == 'GTF':
+        format_string = '%s "%s"'
+    elif gff_format == 'GFF3':
+        format_string = '%s=%s'
+    attrs_strs = []
+    for name, value in attrs.items():
+        attrs_strs.append( format_string % ( name, value ) )
+    return " ; ".join( attrs_strs )
+    
\ No newline at end of file
--- a/tools/extract/extract_genomic_dna.py	Thu Feb 10 15:53:06 2011 -0500
+++ b/tools/extract/extract_genomic_dna.py	Thu Feb 10 17:19:40 2011 -0500
@@ -5,17 +5,19 @@
     -d, --dbkey=N: Genome build of input file
     -o, --output_format=N: the data type of the output file
     -g, --GALAXY_DATA_INDEX_DIR=N: the directory containing alignseq.loc
+    -I, --interpret_features: if true, complete features are interpreted when input is GFF 
+    -F, --fasta=<genomic_sequences>: genomic sequences to use for extraction
     -G, --gff: input and output file, when it is interval, coordinates are treated as GFF format (1-based, half-open) rather than 'traditional' 0-based, closed format.
 """
 from galaxy import eggs
 import pkg_resources
 pkg_resources.require( "bx-python" )
-import sys, string, os, re
+import sys, string, os, re, tempfile, subprocess
 from bx.cookbook import doc_optparse
 import bx.seq.nib
 import bx.seq.twobit
 from galaxy.tools.util.galaxyops import *
-from galaxy.datatypes.util.gff_util import *
+from galaxy.datatypes.util import gff_util
 
 assert sys.version_info[:2] >= ( 2, 4 )
     
@@ -44,16 +46,20 @@
                 seq_path = fields[2].strip()
                 break
     return seq_path
-
         
 def __main__():
+    #
+    # Parse options, args.
+    #
     options, args = doc_optparse.parse( __doc__ )
     try:
         chrom_col, start_col, end_col, strand_col = parse_cols_arg( options.cols )
         dbkey = options.dbkey
         output_format = options.output_format
         gff_format = options.gff
+        interpret_features = options.interpret_features
         GALAXY_DATA_INDEX_DIR = options.GALAXY_DATA_INDEX_DIR
+        fasta_file = options.fasta
         input_filename, output_filename = args
     except:
         doc_optparse.exception()
@@ -62,11 +68,49 @@
     strand = None
     nibs = {}
     twobits = {}
-    seq_path = check_seq_file( dbkey, GALAXY_DATA_INDEX_DIR )
-    if not os.path.exists( seq_path ):
-        # If this occurs, we need to fix the metadata validator.
-        stop_err( "No sequences are available for '%s', request them by reporting this error." % dbkey )
+        
+    #
+    # Set path to sequence data.
+    #
+    if fasta_file:
+        # Need to create 2bit file from fasta file.
+        try:
+            seq_path = tempfile.NamedTemporaryFile( dir="." ).name
+            cmd = "faToTwoBit %s %s" % ( fasta_file, seq_path )
+        
+            tmp_name = tempfile.NamedTemporaryFile( dir="." ).name
+            tmp_stderr = open( tmp_name, 'wb' )
+            proc = subprocess.Popen( args=cmd, shell=True, stderr=tmp_stderr.fileno() )
+            returncode = proc.wait()
+            tmp_stderr.close()
 
+            # Get stderr, allowing for case where it's very large.
+            tmp_stderr = open( tmp_name, 'rb' )
+            stderr = ''
+            buffsize = 1048576
+            try:
+                while True:
+                    stderr += tmp_stderr.read( buffsize )
+                    if not stderr or len( stderr ) % buffsize != 0:
+                        break
+            except OverflowError:
+                pass
+            tmp_stderr.close()
+
+            # Error checking.
+            if returncode != 0:
+                raise Exception, stderr
+        except Exception, e:
+            stop_err( 'Error running faToTwoBit. ' + str( e ) )
+    else:
+        seq_path = check_seq_file( dbkey, GALAXY_DATA_INDEX_DIR )
+        if not os.path.exists( seq_path ):
+            # If this occurs, we need to fix the metadata validator.
+            stop_err( "No sequences are available for '%s', request them by reporting this error." % dbkey )
+    
+    #
+    # Fetch sequences.
+    #
     skipped_lines = 0
     first_invalid_line = 0
     invalid_line = ''
@@ -74,106 +118,134 @@
     warnings = []
     warning = ''
     twobitfile = None
-     
-    for i, line in enumerate( open( input_filename ) ):
-        line = line.rstrip( '\r\n' )
-        if line and not line.startswith( "#" ):
-            fields = line.split( '\t' )
+    file_iterator = open( input_filename )
+    if gff_format and interpret_features:
+        file_iterator = gff_util.GFFReaderWrapper( file_iterator, fix_strand=True )
+    for i, feature in enumerate( file_iterator ):
+        if gff_format and interpret_features:
+            # Processing features.
+            gff_util.convert_gff_coords_to_bed( feature )
+            chrom = feature.chrom
+            start = feature.start
+            end = feature.end
+            strand = feature.strand
+        else:
+            # Processing lines, either interval or GFF format.
+            line = feature.rstrip( '\r\n' )
+            if line and not line.startswith( "#" ):
+                fields = line.split( '\t' )
+                try:
+                    chrom = fields[chrom_col]
+                    start = int( fields[start_col] )
+                    end = int( fields[end_col] )
+                    if gff_format:
+                        start, end = gff_util.convert_gff_coords_to_bed( [start, end] )
+                    if includes_strand_col:
+                        strand = fields[strand_col]
+                except:
+                    warning = "Invalid chrom, start or end column values. "
+                    warnings.append( warning )
+                    skipped_lines += 1
+                    if not invalid_line:
+                        first_invalid_line = i + 1
+                        invalid_line = line
+                    continue
+                if start > end:
+                    warning = "Invalid interval, start '%d' > end '%d'.  " % ( start, end )
+                    warnings.append( warning )
+                    skipped_lines += 1
+                    if not invalid_line:
+                        first_invalid_line = i + 1
+                        invalid_line = line
+                    continue
+
+                if strand not in ['+', '-']:
+                    strand = '+'
+                sequence = ''
+
+        # Open sequence file and get sequence for feature/interval. 
+        if seq_path and os.path.exists( "%s/%s.nib" % ( seq_path, chrom ) ):
+            # TODO: improve support for GFF-nib interaction.
+            if chrom in nibs:
+                nib = nibs[chrom]
+            else:
+                nibs[chrom] = nib = bx.seq.nib.NibFile( file( "%s/%s.nib" % ( seq_path, chrom ) ) )
             try:
-                chrom = fields[chrom_col]
-                start = int( fields[start_col] )
-                end = int( fields[end_col] )
-                if gff_format:
-                    start, end = convert_gff_coords_to_bed( [start, end] )
-                if includes_strand_col:
-                    strand = fields[strand_col]
+                sequence = nib.get( start, end-start )
             except:
-                warning = "Invalid chrom, start or end column values. "
+                warning = "Unable to fetch the sequence from '%d' to '%d' for build '%s'. " %( start, end-start, dbkey )
                 warnings.append( warning )
                 skipped_lines += 1
                 if not invalid_line:
                     first_invalid_line = i + 1
                     invalid_line = line
                 continue
-            if start > end:
-                warning = "Invalid interval, start '%d' > end '%d'.  " % ( start, end )
+        elif seq_path and os.path.isfile( seq_path ):
+            if not(twobitfile):
+                twobitfile = bx.seq.twobit.TwoBitFile( file( seq_path ) )
+            try:
+                if options.gff and interpret_features:
+                    # Create sequence from intervals within a feature.
+                    sequence = ''
+                    for interval in feature.intervals:
+                        sequence += twobitfile[interval.chrom][interval.start:interval.end]
+                else:
+                    sequence = twobitfile[chrom][start:end]
+            except:
+                warning = "Unable to fetch the sequence from '%d' to '%d' for build '%s'. " %( start, end-start, dbkey )
                 warnings.append( warning )
                 skipped_lines += 1
                 if not invalid_line:
                     first_invalid_line = i + 1
                     invalid_line = line
                 continue
+        else:
+            warning = "Chromosome by name '%s' was not found for build '%s'. " % ( chrom, dbkey )
+            warnings.append( warning )
+            skipped_lines += 1
+            if not invalid_line:
+                first_invalid_line = i + 1
+                invalid_line = line
+            continue
+        if sequence == '':
+            warning = "Chrom: '%s', start: '%s', end: '%s' is either invalid or not present in build '%s'. " \
+                        % ( chrom, start, end, dbkey )
+            warnings.append( warning )
+            skipped_lines += 1
+            if not invalid_line:
+                first_invalid_line = i + 1
+                invalid_line = line
+            continue
+        if includes_strand_col and strand == "-":
+            sequence = reverse_complement( sequence )
 
-            if strand not in ['+', '-']:
-                strand = '+'
-            sequence = ''
-
-            if seq_path and os.path.exists( "%s/%s.nib" % ( seq_path, chrom ) ):
-                if chrom in nibs:
-                    nib = nibs[chrom]
-                else:
-                    nibs[chrom] = nib = bx.seq.nib.NibFile( file( "%s/%s.nib" % ( seq_path, chrom ) ) )
-                try:
-                    sequence = nib.get( start, end-start )
-                except:
-                    warning = "Unable to fetch the sequence from '%d' to '%d' for build '%s'. " %( start, end-start, dbkey )
-                    warnings.append( warning )
-                    skipped_lines += 1
-                    if not invalid_line:
-                        first_invalid_line = i + 1
-                        invalid_line = line
-                    continue
-            elif seq_path and os.path.isfile( seq_path ):
-                if not(twobitfile):
-                    twobitfile = bx.seq.twobit.TwoBitFile( file( seq_path ) )
-                try:
-                    sequence = twobitfile[chrom][start:end]
-                except:
-                    warning = "Unable to fetch the sequence from '%d' to '%d' for build '%s'. " %( start, end-start, dbkey )
-                    warnings.append( warning )
-                    skipped_lines += 1
-                    if not invalid_line:
-                        first_invalid_line = i + 1
-                        invalid_line = line
-                    continue
+        if output_format == "fasta" :
+            l = len( sequence )        
+            c = 0
+            if gff_format:
+                start, end = gff_util.convert_bed_coords_to_gff( [ start, end ] )
+            fields = [dbkey, str( chrom ), str( start ), str( end ), strand]
+            meta_data = "_".join( fields )
+            fout.write( ">%s\n" % meta_data )
+            while c < l:
+                b = min( c + 50, l )
+                fout.write( "%s\n" % str( sequence[c:b] ) )
+                c = b
+        else: # output_format == "interval"
+            if interpret_features:
+                # TODO: need better GFF Reader to capture all information needed
+                # to produce this line.
+                meta_data = "\t".join( 
+                                [feature.chrom, "galaxy_extract_genomic_dna", "interval", \
+                                 str( feature.start ), str( feature.end ), feature.score, feature.strand,
+                                 ".", gff_util.gff_attributes_to_str( feature.attributes, "GTF" ) ] )
             else:
-                warning = "Chromosome by name '%s' was not found for build '%s'. " % ( chrom, dbkey )
-                warnings.append( warning )
-                skipped_lines += 1
-                if not invalid_line:
-                    first_invalid_line = i + 1
-                    invalid_line = line
-                continue
-            if sequence == '':
-                warning = "Chrom: '%s', start: '%s', end: '%s' is either invalid or not present in build '%s'. " %( chrom, start, end, dbkey )
-                warnings.append( warning )
-                skipped_lines += 1
-                if not invalid_line:
-                    first_invalid_line = i + 1
-                    invalid_line = line
-                continue
-            if includes_strand_col and strand == "-":
-                sequence = reverse_complement( sequence )
-
-            if output_format == "fasta" :
-                l = len( sequence )        
-                c = 0
-                if gff_format:
-                    start, end = convert_bed_coords_to_gff( [ start, end ] )
-                fields = [dbkey, str( chrom ), str( start ), str( end ), strand]
-                meta_data = "_".join( fields )
-                fout.write( ">%s\n" % meta_data )
-                while c < l:
-                    b = min( c + 50, l )
-                    fout.write( "%s\n" % str( sequence[c:b] ) )
-                    c = b
-            else: # output_format == "interval"
                 meta_data = "\t".join( fields )
-                if gff_format:
-                    format_str = "%s seq \"%s\";\n"
-                else:
-                    format_str = "%s\t%s\n"
-                fout.write( format_str % ( meta_data, str( sequence ) ) )
+            if gff_format:
+                format_str = "%s seq \"%s\";\n"
+            else:
+                format_str = "%s\t%s\n"
+            fout.write( format_str % ( meta_data, str( sequence ) ) )
 
     fout.close()
 
--- a/tools/extract/extract_genomic_dna.xml	Thu Feb 10 15:53:06 2011 -0500
+++ b/tools/extract/extract_genomic_dna.xml	Thu Feb 10 17:19:40 2011 -0500
@@ -1,57 +1,112 @@
 <tool id="Extract genomic DNA 1" name="Extract Genomic DNA" version="2.2.1"><description>using coordinates from assembled/unassembled genomes</description><command interpreter="python">
-      extract_genomic_dna.py $input $out_file1 -d $dbkey -o $out_format -g ${GALAXY_DATA_INDEX_DIR}
+      extract_genomic_dna.py $input $out_file1 -o $out_format -d $dbkey 
+      
+      #if str( $interpret_features ) == "yes":
+        -I
+      #end if
+      
+      ## Columns to use in input file.
       #if isinstance( $input.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
         -1 1,4,5,7 --gff
       #else:
         -1 ${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol}
       #end if
+            
+      #if $seq_source.index_source == "cached":
+        ## Genomic data from cache.
+        -g ${GALAXY_DATA_INDEX_DIR}
+      #else:
+        ## Genomic data from history.
+        -F $seq_source.ref_file
+      #end if
   </command><inputs>
-    <param format="interval,gff" name="input" type="data" label="Fetch sequences corresponding to Query">
-        <validator type="unspecified_build" />
-        <validator type="dataset_metadata_in_file" filename="alignseq.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="seq" />
-    </param>
-	<param name="out_format" type="select" label="Output data type">
-    	<option value="fasta">FASTA</option>
-    	<option value="interval">Interval</option>
-	</param>
+      <param format="interval,gff" name="input" type="data" label="Fetch sequences for intervals in">
+          <validator type="unspecified_build" />
+      </param>
+      <param name="interpret_features" type="select" label="Interpret features when possible" help="Only meaningful for GFF, GTF datasets.">
+          <option value="yes">Yes</option>
+          <option value="no">No</option>
+      </param>
+      <conditional name="seq_source">
+          <param name="index_source" type="select" label="Source for Genomic Data">
+              <option value="cached">Locally cached</option>
+              <option value="history">History</option>
+          </param>
+          <when value="cached">
+          </when>
+          <when value="history">
+              <param name="ref_file" type="data" format="fasta" label="Using reference file" />
+          </when>
+      </conditional>
+	  <param name="out_format" type="select" label="Output data type">
+    	  <option value="fasta">FASTA</option>
+    	  <option value="interval">Interval</option>
+	  </param></inputs><outputs>
-    <data format="input" name="out_file1" metadata_source="input">
-      <change_format>
-        <when input="out_format" value="fasta" format="fasta" />
-      </change_format>
-    </data>
+      <data format="input" name="out_file1" metadata_source="input">
+          <change_format>
+              <when input="out_format" value="fasta" format="fasta" />
+          </change_format>
+      </data></outputs><tests><test><param name="input" value="1.bed" dbkey="hg17" ftype="bed" />
+      <param name="interpret_features" value="yes"/>
+      <param name="index_source" value="cached"/><param name="out_format" value="fasta"/><output name="out_file1" file="extract_genomic_dna_out1.fasta" /></test><test><param name="input" value="droPer1.bed" dbkey="droPer1" ftype="bed" />
+      <param name="interpret_features" value="yes"/>
+      <param name="index_source" value="cached"/><param name="out_format" value="fasta"/><output name="out_file1" file="extract_genomic_dna_out2.fasta" /></test><test><param name="input" value="1.bed" dbkey="hg17" ftype="bed" />
+      <param name="interpret_features" value="no"/>
+      <param name="index_source" value="cached"/><param name="out_format" value="interval"/><output name="out_file1" file="extract_genomic_dna_out3.interval" /></test><!-- Test GFF file support. --><test><param name="input" value="gff_filter_by_attribute_out1.gff" dbkey="mm9" ftype="gff" />
+      <param name="interpret_features" value="no"/>
+      <param name="index_source" value="cached"/><param name="out_format" value="interval"/><output name="out_file1" file="extract_genomic_dna_out4.gff" /></test><test><param name="input" value="gff_filter_by_attribute_out1.gff" dbkey="mm9" ftype="gff" />
+      <param name="interpret_features" value="no"/><param name="out_format" value="fasta"/>
+      <param name="index_source" value="cached"/><output name="out_file1" file="extract_genomic_dna_out5.fasta" /></test>
+    <!-- Test custom sequences support and GFF feature interpretation. -->
+    <test>
+      <param name="input" value="cufflinks_out1.gtf" dbkey="mm9" ftype="gff" />
+      <param name="interpret_features" value="no"/>
+      <param name="index_source" value="history"/>
+      <param name="ref_file" value="tophat_in1.fasta"/>
+      <param name="out_format" value="fasta"/>
+      <output name="out_file1" file="extract_genomic_dna_out6.fasta" />
+    </test>
+    <test>
+      <param name="input" value="cufflinks_out1.gtf" dbkey="mm9" ftype="gff" />
+      <param name="interpret_features" value="yes"/>
+      <param name="index_source" value="history"/>
+      <param name="ref_file" value="tophat_in1.fasta"/>
+      <param name="out_format" value="fasta"/>
+      <output name="out_file1" file="extract_genomic_dna_out7.fasta" />
+    </test></tests><help>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            commit/galaxy-central: natefoo: Another bugfix for egg conflicts, don't add items to the pkg_resources working set unless the item's not already in there.
                        
                        
by Bitbucket 10 Feb '11
                    by Bitbucket 10 Feb '11
10 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/6d5331f3b468/
changeset:   r5041:6d5331f3b468
user:        natefoo
date:        2011-02-10 21:53:06
summary:     Another bugfix for egg conflicts, don't add items to the pkg_resources working set unless the item's not already in there.
affected #:  1 file (79 bytes)
--- a/lib/galaxy/eggs/__init__.py	Thu Feb 10 15:29:08 2011 -0500
+++ b/lib/galaxy/eggs/__init__.py	Thu Feb 10 15:53:06 2011 -0500
@@ -212,7 +212,8 @@
         try:
             dists = self.resolve()
             for dist in dists:
-                pkg_resources.working_set.add( dist )
+                if dist.location not in pkg_resources.working_set.entries:
+                    pkg_resources.working_set.add( dist )
             return dists
         except:
             raise
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            commit/galaxy-central: greg: Migration script to add a subindex column to the run table.
                        
                        
by Bitbucket 10 Feb '11
                    by Bitbucket 10 Feb '11
10 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/b8442c5e90c9/
changeset:   r5040:b8442c5e90c9
user:        greg
date:        2011-02-10 21:29:08
summary:     Migration script to add a subindex column to the run table.
affected #:  3 files (108 bytes)
--- a/lib/galaxy/model/__init__.py	Thu Feb 10 13:58:48 2011 -0500
+++ b/lib/galaxy/model/__init__.py	Thu Feb 10 15:29:08 2011 -0500
@@ -2050,9 +2050,10 @@
         self.external_service = external_service
 
 class Run( object ):
-    def __init__( self, form_definition, form_values ):
+    def __init__( self, form_definition, form_values, subindex=None ):
         self.template = form_definition
         self.info = form_values
+        self.subindex = subindex
 
 class RequestTypeRunAssociation( object ):
     def __init__( self, request_type, run ):
--- a/lib/galaxy/model/mapping.py	Thu Feb 10 13:58:48 2011 -0500
+++ b/lib/galaxy/model/mapping.py	Thu Feb 10 15:29:08 2011 -0500
@@ -705,7 +705,8 @@
     Column( "update_time", DateTime, default=now, onupdate=now ),
     Column( "form_definition_id", Integer, ForeignKey( "form_definition.id" ), index=True ),
     Column( "form_values_id", Integer, ForeignKey( "form_values.id" ), index=True ),
-    Column( "deleted", Boolean, index=True, default=False ) )
+    Column( "deleted", Boolean, index=True, default=False ),
+    Column( "subindex", TrimmedString( 255 ), index=True ) )
 
 RequestTypeRunAssociation.table = Table( "request_type_run_association", metadata,
     Column( "id", Integer, primary_key=True ),
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    10 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/9b43e6baee92/
changeset:   r5039:9b43e6baee92
user:        dannon
date:        2011-02-10 19:58:48
summary:     workflows: jquery1.5 fix, quotations.
affected #:  2 files (4 bytes)
--- a/static/scripts/galaxy.workflow_editor.canvas.js	Thu Feb 10 12:13:55 2011 -0500
+++ b/static/scripts/galaxy.workflow_editor.canvas.js	Thu Feb 10 13:58:48 2011 -0500
@@ -409,7 +409,7 @@
             var t = $("<div class='terminal input-terminal'></div>");
             node.enable_input_terminal( t, input.name, input.extensions );
             // If already connected save old connection
-            old_body.find( "div[name=" + input.name + "]" ).each( function() {
+            old_body.find( "div[name='" + input.name + "']" ).each( function() {
                 $(this).find( ".input-terminal" ).each( function() {
                     var c = this.terminal.connectors[0];
                     if ( c ) {
--- a/static/scripts/packed/galaxy.workflow_editor.canvas.js	Thu Feb 10 12:13:55 2011 -0500
+++ b/static/scripts/packed/galaxy.workflow_editor.canvas.js	Thu Feb 10 13:58:48 2011 -0500
@@ -1,1 +1,1 @@
-function Terminal(a){this.element=a;this.connectors=[]}$.extend(Terminal.prototype,{connect:function(a){this.connectors.push(a);if(this.node){this.node.changed()}},disconnect:function(a){this.connectors.splice($.inArray(a,this.connectors),1);if(this.node){this.node.changed()}},redraw:function(){$.each(this.connectors,function(a,b){b.redraw()})},destroy:function(){$.each(this.connectors.slice(),function(a,b){b.destroy()})}});function OutputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}OutputTerminal.prototype=new Terminal();function InputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}InputTerminal.prototype=new Terminal();$.extend(InputTerminal.prototype,{can_accept:function(a){if(this.connectors.length<1){for(var c in this.datatypes){var f=new Array();f=f.concat(a.datatypes);if(a.node.post_job_actions){for(var d in a.node.post_job_actions){var g=a.node.post_job_actions[d];if(g.action_type=="ChangeDatatypeAction"&&(g.output_name==""||g.output_name==a.name)&&g.action_arguments){f.push(g.action_arguments.newtype)}}}for(var b in f){if(f[b]=="input"||issubtype(f[b],this.datatypes[c])){return true}}}}return false}});function Connector(b,a){this.canvas=null;this.dragging=false;this.inner_color="#FFFFFF";this.outer_color="#D8B365";if(b&&a){this.connect(b,a)}}$.extend(Connector.prototype,{connect:function(b,a){this.handle1=b;this.handle1.connect(this);this.handle2=a;this.handle2.connect(this)},destroy:function(){if(this.handle1){this.handle1.disconnect(this)}if(this.handle2){this.handle2.disconnect(this)}$(this.canvas).remove()},redraw:function(){var d=$("#canvas-container");if(!this.canvas){this.canvas=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(this.canvas)}d.append($(this.canvas));if(this.dragging){this.canvas.style.zIndex="300"}}var n=function(c){return $(c).offset().left-d.offset().left};var i=function(c){return $(c).offset().top-d.offset().top};var h=n(this.handle1.element)+5;var g=i(this.handle1.element)+5;var p=n(this.handle2.element)+5;var m=i(this.handle2.element)+5;var f=100;var k=Math.min(h,p);var a=Math.max(h,p);var j=Math.min(g,m);var t=Math.max(g,m);var b=Math.min(Math.max(Math.abs(t-j)/2,100),300);var o=k-f;var s=j-f;var q=a-k+2*f;var l=t-j+2*f;this.canvas.style.left=o+"px";this.canvas.style.top=s+"px";this.canvas.setAttribute("width",q);this.canvas.setAttribute("height",l);h-=o;g-=s;p-=o;m-=s;var r=this.canvas.getContext("2d");r.lineCap="round";r.strokeStyle=this.outer_color;r.lineWidth=7;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke();r.strokeStyle=this.inner_color;r.lineWidth=5;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke()}});function Node(a){this.element=a;this.input_terminals={};this.output_terminals={};this.tool_errors={}}$.extend(Node.prototype,{enable_input_terminal:function(d,a,b){var c=this;$(d).each(function(){var f=this.terminal=new InputTerminal(this,b);f.node=c;f.name=a;$(this).bind("dropinit",function(g,h){return $(h.drag).hasClass("output-terminal")&&f.can_accept(h.drag.terminal)}).bind("dropstart",function(g,h){h.proxy.terminal.connectors[0].inner_color="#BBFFBB"}).bind("dropend",function(g,h){h.proxy.terminal.connectors[0].inner_color="#FFFFFF"}).bind("drop",function(g,h){(new Connector(h.drag.terminal,f)).redraw()}).bind("hover",function(){if(f.connectors.length>0){var g=$("<div class='callout'></div>").css({display:"none"}).appendTo("body").append($("<div class='buttons'></div>").append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(){$.each(f.connectors,function(i,h){h.destroy()});g.remove()}))).bind("mouseleave",function(){$(this).remove()});g.css({top:$(this).offset().top-2,left:$(this).offset().left-g.width(),"padding-right":$(this).width()}).show()}});c.input_terminals[a]=f})},enable_output_terminal:function(d,a,b){var c=this;$(d).each(function(){var g=this;var f=this.terminal=new OutputTerminal(this,b);f.node=c;f.name=a;$(this).bind("dragstart",function(j,k){$(k.available).addClass("input-terminal-active");workflow.check_changes_in_active_form();var i=$('<div class="drag-terminal" style="position: absolute;"></div>').appendTo("#canvas-container").get(0);i.terminal=new OutputTerminal(i);var l=new Connector();l.dragging=true;l.connect(this.terminal,i.terminal);return i}).bind("drag",function(i,j){var h=function(){var l=$(j.proxy).offsetParent().offset(),k=j.offsetX-l.left,m=j.offsetY-l.top;$(j.proxy).css({left:k,top:m});j.proxy.terminal.redraw();canvas_manager.update_viewport_overlay()};h();$("#canvas-container").get(0).scroll_panel.test(i,h)}).bind("dragend",function(h,i){i.proxy.terminal.connectors[0].destroy();$(i.proxy).remove();$(i.available).removeClass("input-terminal-active");$("#canvas-container").get(0).scroll_panel.stop()});c.output_terminals[a]=f})},redraw:function(){$.each(this.input_terminals,function(a,b){b.redraw()});$.each(this.output_terminals,function(a,b){b.redraw()})},destroy:function(){$.each(this.input_terminals,function(a,b){b.destroy()});$.each(this.output_terminals,function(a,b){b.destroy()});workflow.remove_node(this);$(this.element).remove()},make_active:function(){$(this.element).addClass("toolForm-active")},make_inactive:function(){var a=this.element.get(0);(function(b){b.removeChild(a);b.appendChild(a)})(a.parentNode);$(a).removeClass("toolForm-active")},init_field_data:function(h){var g=this.element;if(h.type){this.type=h.type}this.name=h.name;this.form_html=h.form_html;this.tool_state=h.tool_state;this.tool_errors=h.tool_errors;this.tooltip=h.tooltip?h.tooltip:"";this.annotation=h.annotation;this.post_job_actions=h.post_job_actions?h.post_job_actions:{};this.workflow_outputs=h.workflow_outputs?h.workflow_outputs:[];if(this.tool_errors){g.addClass("tool-node-error")}else{g.removeClass("tool-node-error")}var d=this;var c=Math.max(150,g.width());var a=g.find(".toolFormBody");a.find("div").remove();var i=$("<div class='inputs'></div>").appendTo(a);$.each(h.data_inputs,function(k,f){var j=$("<div class='terminal input-terminal'></div>");d.enable_input_terminal(j,f.name,f.extensions);var b=$("<div class='form-row dataRow input-data-row' name='"+f.name+"'>"+f.label+"</div>");b.css({position:"absolute",left:-1000,top:-1000,display:"none"});$("body").append(b);c=Math.max(c,b.outerWidth());b.css({position:"",left:"",top:"",display:""});b.remove();i.append(b.prepend(j))});if((h.data_inputs.length>0)&&(h.data_outputs.length>0)){a.append($("<div class='rule'></div>"))}$.each(h.data_outputs,function(k,b){var j=$("<div class='terminal output-terminal'></div>");d.enable_output_terminal(j,b.name,b.extensions);var f=b.name;if(b.extensions.indexOf("input")<0){f=f+" ("+b.extensions.join(", ")+")"}var m=$("<div class='form-row dataRow'>"+f+"</div>");if(d.type=="tool"){var l=$("<div class='callout'></div>").css({display:"none"}).append($("<div class='buttons'></div>").append($("<img/>").attr("src",image_path+"/fugue/asterisk-small-outline.png").click(function(){if($.inArray(b.name,d.workflow_outputs)!=-1){d.workflow_outputs.splice($.inArray(b.name,d.workflow_outputs),1);l.find("img").attr("src",image_path+"/fugue/asterisk-small-outline.png")}else{d.workflow_outputs.push(b.name);l.find("img").attr("src",image_path+"/fugue/asterisk-small.png")}workflow.has_changes=true;canvas_manager.draw_overview()}))).tipsy({delayIn:500,fallback:"Flag this as a workflow output.  All non-flagged outputs will be hidden."});l.css({top:"50%",margin:"-8px 0px 0px 0px",right:8});l.show();m.append(l);if($.inArray(b.name,d.workflow_outputs)===-1){l.find("img").attr("src",image_path+"/fugue/asterisk-small-outline.png")}else{l.find("img").attr("src",image_path+"/fugue/asterisk-small.png")}m.hover(function(){l.find("img").attr("src",image_path+"/fugue/asterisk-small-yellow.png")},function(){if($.inArray(b.name,d.workflow_outputs)===-1){l.find("img").attr("src",image_path+"/fugue/asterisk-small-outline.png")}else{l.find("img").attr("src",image_path+"/fugue/asterisk-small.png")}})}m.css({position:"absolute",left:-1000,top:-1000,display:"none"});$("body").append(m);c=Math.max(c,m.outerWidth()+17);m.css({position:"",left:"",top:"",display:""});m.detach();a.append(m.append(j))});g.css("width",Math.min(250,Math.max(g.width(),c)));workflow.node_changed(this)},update_field_data:function(f){var c=$(this.element),d=this;this.tool_state=f.tool_state;this.form_html=f.form_html;this.tool_errors=f.tool_errors;this.annotation=f.annotation;var g=$.parseJSON(f.post_job_actions);this.post_job_actions=g?g:{};if(this.tool_errors){c.addClass("tool-node-error")}else{c.removeClass("tool-node-error")}var h=c.find("div.inputs");var b=$("<div class='inputs'></div>");var a=h.find("div.input-data-row");$.each(f.data_inputs,function(l,j){var k=$("<div class='terminal input-terminal'></div>");d.enable_input_terminal(k,j.name,j.extensions);h.find("div[name="+j.name+"]").each(function(){$(this).find(".input-terminal").each(function(){var i=this.terminal.connectors[0];if(i){k[0].terminal.connectors[0]=i;i.handle2=k[0].terminal}});$(this).remove()});b.append($("<div class='form-row dataRow input-data-row' name='"+j.name+"'>"+j.label+"</div>").prepend(k))});h.replaceWith(b);h.find("div.input-data-row > .terminal").each(function(){this.terminal.destroy()});this.changed();this.redraw()},error:function(d){var a=$(this.element).find(".toolFormBody");a.find("div").remove();var c="<div style='color: red; text-style: italic;'>"+d+"</div>";this.form_html=c;a.html(c);workflow.node_changed(this)},changed:function(){workflow.node_changed(this)}});function Workflow(a){this.canvas_container=a;this.id_counter=0;this.nodes={};this.name=null;this.has_changes=false;this.active_form_has_changes=false}$.extend(Workflow.prototype,{add_node:function(a){a.id=this.id_counter;a.element.attr("id","wf-node-step-"+a.id);this.id_counter++;this.nodes[a.id]=a;this.has_changes=true;a.workflow=this},remove_node:function(a){if(this.active_node==a){this.clear_active_node()}delete this.nodes[a.id];this.has_changes=true},remove_all:function(){wf=this;$.each(this.nodes,function(b,a){a.destroy();wf.remove_node(a)})},rectify_workflow_outputs:function(){var a=false;$.each(this.nodes,function(b,c){if(c.workflow_outputs&&c.workflow_outputs.length>0){a=true}});if(a==false){return true}wf=this;$.each(this.nodes,function(b,f){if(f.type=="tool"){var d=false;if(f.post_job_actions==null){f.post_job_actions={}}var c=[];$.each(f.post_job_actions,function(h,g){if(g.action_type=="HideDatasetAction"){c.push(h)}});if(c.length>0&&f==workflow.active_node){$.each(c,function(g,h){d=true;delete f.post_job_actions[h]})}$.each(f.output_terminals,function(h,i){var g=true;$.each(f.workflow_outputs,function(k,l){if(i.name==l){g=false}});if(g==true){d=true;var j={action_type:"HideDatasetAction",output_name:i.name,action_arguments:{}};f.post_job_actions["HideDatasetAction"+i.name]=null;f.post_job_actions["HideDatasetAction"+i.name]=j}});if(wf.active_node==f&&d==true){wf.reload_active_node()}}})},to_simple:function(){var a={};$.each(this.nodes,function(c,f){var g={};$.each(f.input_terminals,function(h,i){g[i.name]=null;$.each(i.connectors,function(j,k){g[i.name]={id:k.handle1.node.id,output_name:k.handle1.name}})});var b={};if(f.post_job_actions){$.each(f.post_job_actions,function(j,h){var k={action_type:h.action_type,output_name:h.output_name,action_arguments:h.action_arguments};b[h.action_type+h.output_name]=null;b[h.action_type+h.output_name]=k})}if(!f.workflow_outputs){f.workflow_outputs=[]}var d={id:f.id,type:f.type,tool_id:f.tool_id,tool_state:f.tool_state,tool_errors:f.tool_errors,input_connections:g,position:$(f.element).position(),annotation:f.annotation,post_job_actions:f.post_job_actions,workflow_outputs:f.workflow_outputs};a[f.id]=d});return{steps:a}},from_simple:function(a){wf=this;var b=0;wf.name=a.name;$.each(a.steps,function(f,d){var c=prebuild_node("tool",d.name,d.tool_id);c.init_field_data(d);if(d.position){c.element.css({top:d.position.top,left:d.position.left})}c.id=d.id;wf.nodes[c.id]=c;b=Math.max(b,parseInt(f))});wf.id_counter=b+1;$.each(a.steps,function(f,d){var c=wf.nodes[f];$.each(d.input_connections,function(h,g){if(g){var i=wf.nodes[g.id];var j=new Connector();j.connect(i.output_terminals[g.output_name],c.input_terminals[h]);j.redraw()}})})},check_changes_in_active_form:function(){if(this.active_form_has_changes){this.has_changes=true;$("#right-content").find("form").submit();this.active_form_has_changes=false}},reload_active_node:function(){if(this.active_node){var a=this.active_node;this.clear_active_node();this.activate_node(a)}},clear_active_node:function(){if(this.active_node){this.active_node.make_inactive();this.active_node=null}parent.show_form_for_tool("<div>No node selected</div>")},activate_node:function(a){if(this.active_node!=a){this.check_changes_in_active_form();this.clear_active_node();parent.show_form_for_tool(a.form_html+a.tooltip,a);a.make_active();this.active_node=a}},node_changed:function(a){this.has_changes=true;if(this.active_node==a){this.check_changes_in_active_form();parent.show_form_for_tool(a.form_html+a.tooltip,a)}},layout:function(){this.check_changes_in_active_form();this.has_changes=true;var i={};var b={};$.each(this.nodes,function(l,k){if(i[l]===undefined){i[l]=0}if(b[l]===undefined){b[l]=[]}});$.each(this.nodes,function(l,k){$.each(k.input_terminals,function(m,n){$.each(n.connectors,function(p,q){var o=q.handle1.node;i[k.id]+=1;b[o.id].push(k.id)})})});node_ids_by_level=[];while(true){level_parents=[];for(var a in i){if(i[a]==0){level_parents.push(a)}}if(level_parents.length==0){break}node_ids_by_level.push(level_parents);for(var f in level_parents){var j=level_parents[f];delete i[j];for(var g in b[j]){i[b[j][g]]-=1}}}if(i.length){return}var d=this.nodes;var h=80;v_pad=30;var c=h;$.each(node_ids_by_level,function(k,l){l.sort(function(p,o){return $(d[p].element).position().top-$(d[o].element).position().top});var m=0;var n=v_pad;$.each(l,function(o,r){var q=d[r];var p=$(q.element);$(p).css({top:n,left:c});m=Math.max(m,$(p).width());n+=$(p).height()+v_pad});c+=m+h});$.each(d,function(k,l){l.redraw()})},bounds_for_all_nodes:function(){var d=Infinity,b=-Infinity,c=Infinity,a=-Infinity,f;$.each(this.nodes,function(h,g){e=$(g.element);f=e.position();d=Math.min(d,f.left);b=Math.max(b,f.left+e.width());c=Math.min(c,f.top);a=Math.max(a,f.top+e.width())});return{xmin:d,xmax:b,ymin:c,ymax:a}},fit_canvas_to_nodes:function(){var a=this.bounds_for_all_nodes();var f=this.canvas_container.position();var i=this.canvas_container.parent();var d=fix_delta(a.xmin,100);var h=fix_delta(a.ymin,100);d=Math.max(d,f.left);h=Math.max(h,f.top);var c=f.left-d;var g=f.top-h;var b=round_up(a.xmax+100,100)+d;var j=round_up(a.ymax+100,100)+h;b=Math.max(b,-c+i.width());j=Math.max(j,-g+i.height());this.canvas_container.css({left:c,top:g,width:b,height:j});this.canvas_container.children().each(function(){var k=$(this).position();$(this).css("left",k.left+d);$(this).css("top",k.top+h)})}});function fix_delta(a,b){if(a<b||a>3*b){new_pos=(Math.ceil(((a%b))/b)+1)*b;return(-(a-new_pos))}return 0}function round_up(a,b){return Math.ceil(a/b)*b}function prebuild_node(l,j,r){var i=$("<div class='toolForm toolFormInCanvas'></div>");var g=new Node(i);g.type=l;if(l=="tool"){g.tool_id=r}var n=$("<div class='toolFormTitle unselectable'>"+j+"</div>");i.append(n);i.css("left",$(window).scrollLeft()+20);i.css("top",$(window).scrollTop()+20);var m=$("<div class='toolFormBody'></div>");var h="<div><img height='16' align='middle' src='"+image_path+"/loading_small_white_bg.gif'/> loading tool info...</div>";m.append(h);g.form_html=h;i.append(m);var k=$("<div class='buttons' style='float: right;'></div>");k.append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(b){g.destroy()}).hover(function(){$(this).attr("src",image_path+"/delete_icon_dark.png")},function(){$(this).attr("src",image_path+"/delete_icon.png")}));i.appendTo("#canvas-container");var d=$("#canvas-container").position();var c=$("#canvas-container").parent();var a=i.width();var q=i.height();i.css({left:(-d.left)+(c.width()/2)-(a/2),top:(-d.top)+(c.height()/2)-(q/2)});k.prependTo(n);a+=(k.width()+10);i.css("width",a);$(i).bind("dragstart",function(){workflow.activate_node(g)}).bind("dragend",function(){workflow.node_changed(this);workflow.fit_canvas_to_nodes();canvas_manager.draw_overview()}).bind("dragclickonly",function(){workflow.activate_node(g)}).bind("drag",function(o,p){var f=$(this).offsetParent().offset(),b=p.offsetX-f.left,s=p.offsetY-f.top;$(this).css({left:b,top:s});$(this).find(".terminal").each(function(){this.terminal.redraw()})});return g}var ext_to_type=null;var type_to_type=null;function issubtype(b,a){b=ext_to_type[b];a=ext_to_type[a];return(type_to_type[b])&&(a in type_to_type[b])}function populate_datatype_info(a){ext_to_type=a.ext_to_class_name;type_to_type=a.class_to_classes}function ScrollPanel(a){this.panel=a}$.extend(ScrollPanel.prototype,{test:function(v,d){clearTimeout(this.timeout);var k=v.pageX,j=v.pageY,l=$(this.panel),c=l.position(),b=l.width(),i=l.height(),w=l.parent(),s=w.width(),a=w.height(),r=w.offset(),p=r.left,m=r.top,A=p+w.width(),u=m+w.height(),B=-(b-(s/2)),z=-(i-(a/2)),g=(s/2),f=(a/2),h=false,q=5,o=23;if(k-q<p){if(c.left<g){var n=Math.min(o,g-c.left);l.css("left",c.left+n);h=true}}else{if(k+q>A){if(c.left>B){var n=Math.min(o,c.left-B);l.css("left",c.left-n);h=true}}else{if(j-q<m){if(c.top<f){var n=Math.min(o,f-c.top);l.css("top",c.top+n);h=true}}else{if(j+q>u){if(c.top>z){var n=Math.min(o,c.top-B);l.css("top",(c.top-n)+"px");h=true}}}}}if(h){d();var l=this;this.timeout=setTimeout(function(){l.test(v,d)},50)}},stop:function(b,a){clearTimeout(this.timeout)}});function CanvasManager(b,a){this.cv=b;this.cc=this.cv.find("#canvas-container");this.oc=a.find("#overview-canvas");this.ov=a.find("#overview-viewport");this.init_drag()}$.extend(CanvasManager.prototype,{init_drag:function(){var b=this;var a=function(f,g){f=Math.min(f,b.cv.width()/2);f=Math.max(f,-b.cc.width()+b.cv.width()/2);g=Math.min(g,b.cv.height()/2);g=Math.max(g,-b.cc.height()+b.cv.height()/2);b.cc.css({left:f,top:g});b.update_viewport_overlay()};this.cc.each(function(){this.scroll_panel=new ScrollPanel(this)});var d,c;this.cv.bind("dragstart",function(){var g=$(this).offset();var f=b.cc.position();c=f.top-g.top;d=f.left-g.left}).bind("drag",function(f,g){a(g.offsetX+d,g.offsetY+c)}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});this.ov.bind("drag",function(k,l){var h=b.cc.width(),n=b.cc.height(),m=b.oc.width(),j=b.oc.height(),f=$(this).offsetParent().offset(),i=l.offsetX-f.left,g=l.offsetY-f.top;a(-(i/m*h),-(g/j*n))}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});$("#overview-border").bind("drag",function(g,i){var j=$(this).offsetParent();var h=j.offset();var f=Math.max(j.width()-(i.offsetX-h.left),j.height()-(i.offsetY-h.top));$(this).css({width:f,height:f});b.draw_overview()});$("#overview-border div").bind("drag",function(){})},update_viewport_overlay:function(){var b=this.cc,f=this.cv,a=this.oc,c=this.ov,d=b.width(),j=b.height(),i=a.width(),g=a.height(),h=b.position();c.css({left:-(h.left/d*i),top:-(h.top/j*g),width:(f.width()/d*i)-2,height:(f.height()/j*g)-2})},draw_overview:function(){var j=$("#overview-canvas"),m=j.parent().parent().width(),i=j.get(0).getContext("2d"),d=$("#canvas-container").width(),l=$("#canvas-container").height();var g,a,k,f;var h=this.cv.width();var b=this.cv.height();if(d<h&&l<b){k=d/h*m;f=(m-k)/2;g=l/b*m;a=(m-g)/2}else{if(d<l){a=0;g=m;k=Math.ceil(g*d/l);f=(m-k)/2}else{k=m;f=0;g=Math.ceil(k*l/d);a=(m-g)/2}}j.parent().css({left:f,top:a,width:k,height:g});j.attr("width",k);j.attr("height",g);$.each(workflow.nodes,function(t,q){i.fillStyle="#D2C099";i.strokeStyle="#D8B365";i.lineWidth=1;var s=$(q.element),n=s.position(),c=n.left/d*k,r=n.top/l*g,o=s.width()/d*k,p=s.height()/l*g;if(q.tool_errors){i.fillStyle="#FFCCCC";i.strokeStyle="#AA6666"}else{if(q.workflow_outputs!=undefined&&q.workflow_outputs.length>0){i.fillStyle="#E8A92D";i.strokeStyle="#E8A92D"}}i.fillRect(c,r,o,p);i.strokeRect(c,r,o,p)});this.update_viewport_overlay()}});
\ No newline at end of file
+function Terminal(a){this.element=a;this.connectors=[]}$.extend(Terminal.prototype,{connect:function(a){this.connectors.push(a);if(this.node){this.node.changed()}},disconnect:function(a){this.connectors.splice($.inArray(a,this.connectors),1);if(this.node){this.node.changed()}},redraw:function(){$.each(this.connectors,function(a,b){b.redraw()})},destroy:function(){$.each(this.connectors.slice(),function(a,b){b.destroy()})}});function OutputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}OutputTerminal.prototype=new Terminal();function InputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}InputTerminal.prototype=new Terminal();$.extend(InputTerminal.prototype,{can_accept:function(a){if(this.connectors.length<1){for(var c in this.datatypes){var f=new Array();f=f.concat(a.datatypes);if(a.node.post_job_actions){for(var d in a.node.post_job_actions){var g=a.node.post_job_actions[d];if(g.action_type=="ChangeDatatypeAction"&&(g.output_name==""||g.output_name==a.name)&&g.action_arguments){f.push(g.action_arguments.newtype)}}}for(var b in f){if(f[b]=="input"||issubtype(f[b],this.datatypes[c])){return true}}}}return false}});function Connector(b,a){this.canvas=null;this.dragging=false;this.inner_color="#FFFFFF";this.outer_color="#D8B365";if(b&&a){this.connect(b,a)}}$.extend(Connector.prototype,{connect:function(b,a){this.handle1=b;this.handle1.connect(this);this.handle2=a;this.handle2.connect(this)},destroy:function(){if(this.handle1){this.handle1.disconnect(this)}if(this.handle2){this.handle2.disconnect(this)}$(this.canvas).remove()},redraw:function(){var d=$("#canvas-container");if(!this.canvas){this.canvas=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(this.canvas)}d.append($(this.canvas));if(this.dragging){this.canvas.style.zIndex="300"}}var n=function(c){return $(c).offset().left-d.offset().left};var i=function(c){return $(c).offset().top-d.offset().top};var h=n(this.handle1.element)+5;var g=i(this.handle1.element)+5;var p=n(this.handle2.element)+5;var m=i(this.handle2.element)+5;var f=100;var k=Math.min(h,p);var a=Math.max(h,p);var j=Math.min(g,m);var t=Math.max(g,m);var b=Math.min(Math.max(Math.abs(t-j)/2,100),300);var o=k-f;var s=j-f;var q=a-k+2*f;var l=t-j+2*f;this.canvas.style.left=o+"px";this.canvas.style.top=s+"px";this.canvas.setAttribute("width",q);this.canvas.setAttribute("height",l);h-=o;g-=s;p-=o;m-=s;var r=this.canvas.getContext("2d");r.lineCap="round";r.strokeStyle=this.outer_color;r.lineWidth=7;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke();r.strokeStyle=this.inner_color;r.lineWidth=5;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke()}});function Node(a){this.element=a;this.input_terminals={};this.output_terminals={};this.tool_errors={}}$.extend(Node.prototype,{enable_input_terminal:function(d,a,b){var c=this;$(d).each(function(){var f=this.terminal=new InputTerminal(this,b);f.node=c;f.name=a;$(this).bind("dropinit",function(g,h){return $(h.drag).hasClass("output-terminal")&&f.can_accept(h.drag.terminal)}).bind("dropstart",function(g,h){h.proxy.terminal.connectors[0].inner_color="#BBFFBB"}).bind("dropend",function(g,h){h.proxy.terminal.connectors[0].inner_color="#FFFFFF"}).bind("drop",function(g,h){(new Connector(h.drag.terminal,f)).redraw()}).bind("hover",function(){if(f.connectors.length>0){var g=$("<div class='callout'></div>").css({display:"none"}).appendTo("body").append($("<div class='buttons'></div>").append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(){$.each(f.connectors,function(i,h){h.destroy()});g.remove()}))).bind("mouseleave",function(){$(this).remove()});g.css({top:$(this).offset().top-2,left:$(this).offset().left-g.width(),"padding-right":$(this).width()}).show()}});c.input_terminals[a]=f})},enable_output_terminal:function(d,a,b){var c=this;$(d).each(function(){var g=this;var f=this.terminal=new OutputTerminal(this,b);f.node=c;f.name=a;$(this).bind("dragstart",function(j,k){$(k.available).addClass("input-terminal-active");workflow.check_changes_in_active_form();var i=$('<div class="drag-terminal" style="position: absolute;"></div>').appendTo("#canvas-container").get(0);i.terminal=new OutputTerminal(i);var l=new Connector();l.dragging=true;l.connect(this.terminal,i.terminal);return i}).bind("drag",function(i,j){var h=function(){var l=$(j.proxy).offsetParent().offset(),k=j.offsetX-l.left,m=j.offsetY-l.top;$(j.proxy).css({left:k,top:m});j.proxy.terminal.redraw();canvas_manager.update_viewport_overlay()};h();$("#canvas-container").get(0).scroll_panel.test(i,h)}).bind("dragend",function(h,i){i.proxy.terminal.connectors[0].destroy();$(i.proxy).remove();$(i.available).removeClass("input-terminal-active");$("#canvas-container").get(0).scroll_panel.stop()});c.output_terminals[a]=f})},redraw:function(){$.each(this.input_terminals,function(a,b){b.redraw()});$.each(this.output_terminals,function(a,b){b.redraw()})},destroy:function(){$.each(this.input_terminals,function(a,b){b.destroy()});$.each(this.output_terminals,function(a,b){b.destroy()});workflow.remove_node(this);$(this.element).remove()},make_active:function(){$(this.element).addClass("toolForm-active")},make_inactive:function(){var a=this.element.get(0);(function(b){b.removeChild(a);b.appendChild(a)})(a.parentNode);$(a).removeClass("toolForm-active")},init_field_data:function(h){var g=this.element;if(h.type){this.type=h.type}this.name=h.name;this.form_html=h.form_html;this.tool_state=h.tool_state;this.tool_errors=h.tool_errors;this.tooltip=h.tooltip?h.tooltip:"";this.annotation=h.annotation;this.post_job_actions=h.post_job_actions?h.post_job_actions:{};this.workflow_outputs=h.workflow_outputs?h.workflow_outputs:[];if(this.tool_errors){g.addClass("tool-node-error")}else{g.removeClass("tool-node-error")}var d=this;var c=Math.max(150,g.width());var a=g.find(".toolFormBody");a.find("div").remove();var i=$("<div class='inputs'></div>").appendTo(a);$.each(h.data_inputs,function(k,f){var j=$("<div class='terminal input-terminal'></div>");d.enable_input_terminal(j,f.name,f.extensions);var b=$("<div class='form-row dataRow input-data-row' name='"+f.name+"'>"+f.label+"</div>");b.css({position:"absolute",left:-1000,top:-1000,display:"none"});$("body").append(b);c=Math.max(c,b.outerWidth());b.css({position:"",left:"",top:"",display:""});b.remove();i.append(b.prepend(j))});if((h.data_inputs.length>0)&&(h.data_outputs.length>0)){a.append($("<div class='rule'></div>"))}$.each(h.data_outputs,function(k,b){var j=$("<div class='terminal output-terminal'></div>");d.enable_output_terminal(j,b.name,b.extensions);var f=b.name;if(b.extensions.indexOf("input")<0){f=f+" ("+b.extensions.join(", ")+")"}var m=$("<div class='form-row dataRow'>"+f+"</div>");if(d.type=="tool"){var l=$("<div class='callout'></div>").css({display:"none"}).append($("<div class='buttons'></div>").append($("<img/>").attr("src",image_path+"/fugue/asterisk-small-outline.png").click(function(){if($.inArray(b.name,d.workflow_outputs)!=-1){d.workflow_outputs.splice($.inArray(b.name,d.workflow_outputs),1);l.find("img").attr("src",image_path+"/fugue/asterisk-small-outline.png")}else{d.workflow_outputs.push(b.name);l.find("img").attr("src",image_path+"/fugue/asterisk-small.png")}workflow.has_changes=true;canvas_manager.draw_overview()}))).tipsy({delayIn:500,fallback:"Flag this as a workflow output.  All non-flagged outputs will be hidden."});l.css({top:"50%",margin:"-8px 0px 0px 0px",right:8});l.show();m.append(l);if($.inArray(b.name,d.workflow_outputs)===-1){l.find("img").attr("src",image_path+"/fugue/asterisk-small-outline.png")}else{l.find("img").attr("src",image_path+"/fugue/asterisk-small.png")}m.hover(function(){l.find("img").attr("src",image_path+"/fugue/asterisk-small-yellow.png")},function(){if($.inArray(b.name,d.workflow_outputs)===-1){l.find("img").attr("src",image_path+"/fugue/asterisk-small-outline.png")}else{l.find("img").attr("src",image_path+"/fugue/asterisk-small.png")}})}m.css({position:"absolute",left:-1000,top:-1000,display:"none"});$("body").append(m);c=Math.max(c,m.outerWidth()+17);m.css({position:"",left:"",top:"",display:""});m.detach();a.append(m.append(j))});g.css("width",Math.min(250,Math.max(g.width(),c)));workflow.node_changed(this)},update_field_data:function(f){var c=$(this.element),d=this;this.tool_state=f.tool_state;this.form_html=f.form_html;this.tool_errors=f.tool_errors;this.annotation=f.annotation;var g=$.parseJSON(f.post_job_actions);this.post_job_actions=g?g:{};if(this.tool_errors){c.addClass("tool-node-error")}else{c.removeClass("tool-node-error")}var h=c.find("div.inputs");var b=$("<div class='inputs'></div>");var a=h.find("div.input-data-row");$.each(f.data_inputs,function(l,j){var k=$("<div class='terminal input-terminal'></div>");d.enable_input_terminal(k,j.name,j.extensions);h.find("div[name='"+j.name+"']").each(function(){$(this).find(".input-terminal").each(function(){var i=this.terminal.connectors[0];if(i){k[0].terminal.connectors[0]=i;i.handle2=k[0].terminal}});$(this).remove()});b.append($("<div class='form-row dataRow input-data-row' name='"+j.name+"'>"+j.label+"</div>").prepend(k))});h.replaceWith(b);h.find("div.input-data-row > .terminal").each(function(){this.terminal.destroy()});this.changed();this.redraw()},error:function(d){var a=$(this.element).find(".toolFormBody");a.find("div").remove();var c="<div style='color: red; text-style: italic;'>"+d+"</div>";this.form_html=c;a.html(c);workflow.node_changed(this)},changed:function(){workflow.node_changed(this)}});function Workflow(a){this.canvas_container=a;this.id_counter=0;this.nodes={};this.name=null;this.has_changes=false;this.active_form_has_changes=false}$.extend(Workflow.prototype,{add_node:function(a){a.id=this.id_counter;a.element.attr("id","wf-node-step-"+a.id);this.id_counter++;this.nodes[a.id]=a;this.has_changes=true;a.workflow=this},remove_node:function(a){if(this.active_node==a){this.clear_active_node()}delete this.nodes[a.id];this.has_changes=true},remove_all:function(){wf=this;$.each(this.nodes,function(b,a){a.destroy();wf.remove_node(a)})},rectify_workflow_outputs:function(){var a=false;$.each(this.nodes,function(b,c){if(c.workflow_outputs&&c.workflow_outputs.length>0){a=true}});if(a==false){return true}wf=this;$.each(this.nodes,function(b,f){if(f.type=="tool"){var d=false;if(f.post_job_actions==null){f.post_job_actions={}}var c=[];$.each(f.post_job_actions,function(h,g){if(g.action_type=="HideDatasetAction"){c.push(h)}});if(c.length>0&&f==workflow.active_node){$.each(c,function(g,h){d=true;delete f.post_job_actions[h]})}$.each(f.output_terminals,function(h,i){var g=true;$.each(f.workflow_outputs,function(k,l){if(i.name==l){g=false}});if(g==true){d=true;var j={action_type:"HideDatasetAction",output_name:i.name,action_arguments:{}};f.post_job_actions["HideDatasetAction"+i.name]=null;f.post_job_actions["HideDatasetAction"+i.name]=j}});if(wf.active_node==f&&d==true){wf.reload_active_node()}}})},to_simple:function(){var a={};$.each(this.nodes,function(c,f){var g={};$.each(f.input_terminals,function(h,i){g[i.name]=null;$.each(i.connectors,function(j,k){g[i.name]={id:k.handle1.node.id,output_name:k.handle1.name}})});var b={};if(f.post_job_actions){$.each(f.post_job_actions,function(j,h){var k={action_type:h.action_type,output_name:h.output_name,action_arguments:h.action_arguments};b[h.action_type+h.output_name]=null;b[h.action_type+h.output_name]=k})}if(!f.workflow_outputs){f.workflow_outputs=[]}var d={id:f.id,type:f.type,tool_id:f.tool_id,tool_state:f.tool_state,tool_errors:f.tool_errors,input_connections:g,position:$(f.element).position(),annotation:f.annotation,post_job_actions:f.post_job_actions,workflow_outputs:f.workflow_outputs};a[f.id]=d});return{steps:a}},from_simple:function(a){wf=this;var b=0;wf.name=a.name;$.each(a.steps,function(f,d){var c=prebuild_node("tool",d.name,d.tool_id);c.init_field_data(d);if(d.position){c.element.css({top:d.position.top,left:d.position.left})}c.id=d.id;wf.nodes[c.id]=c;b=Math.max(b,parseInt(f))});wf.id_counter=b+1;$.each(a.steps,function(f,d){var c=wf.nodes[f];$.each(d.input_connections,function(h,g){if(g){var i=wf.nodes[g.id];var j=new Connector();j.connect(i.output_terminals[g.output_name],c.input_terminals[h]);j.redraw()}})})},check_changes_in_active_form:function(){if(this.active_form_has_changes){this.has_changes=true;$("#right-content").find("form").submit();this.active_form_has_changes=false}},reload_active_node:function(){if(this.active_node){var a=this.active_node;this.clear_active_node();this.activate_node(a)}},clear_active_node:function(){if(this.active_node){this.active_node.make_inactive();this.active_node=null}parent.show_form_for_tool("<div>No node selected</div>")},activate_node:function(a){if(this.active_node!=a){this.check_changes_in_active_form();this.clear_active_node();parent.show_form_for_tool(a.form_html+a.tooltip,a);a.make_active();this.active_node=a}},node_changed:function(a){this.has_changes=true;if(this.active_node==a){this.check_changes_in_active_form();parent.show_form_for_tool(a.form_html+a.tooltip,a)}},layout:function(){this.check_changes_in_active_form();this.has_changes=true;var i={};var b={};$.each(this.nodes,function(l,k){if(i[l]===undefined){i[l]=0}if(b[l]===undefined){b[l]=[]}});$.each(this.nodes,function(l,k){$.each(k.input_terminals,function(m,n){$.each(n.connectors,function(p,q){var o=q.handle1.node;i[k.id]+=1;b[o.id].push(k.id)})})});node_ids_by_level=[];while(true){level_parents=[];for(var a in i){if(i[a]==0){level_parents.push(a)}}if(level_parents.length==0){break}node_ids_by_level.push(level_parents);for(var f in level_parents){var j=level_parents[f];delete i[j];for(var g in b[j]){i[b[j][g]]-=1}}}if(i.length){return}var d=this.nodes;var h=80;v_pad=30;var c=h;$.each(node_ids_by_level,function(k,l){l.sort(function(p,o){return $(d[p].element).position().top-$(d[o].element).position().top});var m=0;var n=v_pad;$.each(l,function(o,r){var q=d[r];var p=$(q.element);$(p).css({top:n,left:c});m=Math.max(m,$(p).width());n+=$(p).height()+v_pad});c+=m+h});$.each(d,function(k,l){l.redraw()})},bounds_for_all_nodes:function(){var d=Infinity,b=-Infinity,c=Infinity,a=-Infinity,f;$.each(this.nodes,function(h,g){e=$(g.element);f=e.position();d=Math.min(d,f.left);b=Math.max(b,f.left+e.width());c=Math.min(c,f.top);a=Math.max(a,f.top+e.width())});return{xmin:d,xmax:b,ymin:c,ymax:a}},fit_canvas_to_nodes:function(){var a=this.bounds_for_all_nodes();var f=this.canvas_container.position();var i=this.canvas_container.parent();var d=fix_delta(a.xmin,100);var h=fix_delta(a.ymin,100);d=Math.max(d,f.left);h=Math.max(h,f.top);var c=f.left-d;var g=f.top-h;var b=round_up(a.xmax+100,100)+d;var j=round_up(a.ymax+100,100)+h;b=Math.max(b,-c+i.width());j=Math.max(j,-g+i.height());this.canvas_container.css({left:c,top:g,width:b,height:j});this.canvas_container.children().each(function(){var k=$(this).position();$(this).css("left",k.left+d);$(this).css("top",k.top+h)})}});function fix_delta(a,b){if(a<b||a>3*b){new_pos=(Math.ceil(((a%b))/b)+1)*b;return(-(a-new_pos))}return 0}function round_up(a,b){return Math.ceil(a/b)*b}function prebuild_node(l,j,r){var i=$("<div class='toolForm toolFormInCanvas'></div>");var g=new Node(i);g.type=l;if(l=="tool"){g.tool_id=r}var n=$("<div class='toolFormTitle unselectable'>"+j+"</div>");i.append(n);i.css("left",$(window).scrollLeft()+20);i.css("top",$(window).scrollTop()+20);var m=$("<div class='toolFormBody'></div>");var h="<div><img height='16' align='middle' src='"+image_path+"/loading_small_white_bg.gif'/> loading tool info...</div>";m.append(h);g.form_html=h;i.append(m);var k=$("<div class='buttons' style='float: right;'></div>");k.append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(b){g.destroy()}).hover(function(){$(this).attr("src",image_path+"/delete_icon_dark.png")},function(){$(this).attr("src",image_path+"/delete_icon.png")}));i.appendTo("#canvas-container");var d=$("#canvas-container").position();var c=$("#canvas-container").parent();var a=i.width();var q=i.height();i.css({left:(-d.left)+(c.width()/2)-(a/2),top:(-d.top)+(c.height()/2)-(q/2)});k.prependTo(n);a+=(k.width()+10);i.css("width",a);$(i).bind("dragstart",function(){workflow.activate_node(g)}).bind("dragend",function(){workflow.node_changed(this);workflow.fit_canvas_to_nodes();canvas_manager.draw_overview()}).bind("dragclickonly",function(){workflow.activate_node(g)}).bind("drag",function(o,p){var f=$(this).offsetParent().offset(),b=p.offsetX-f.left,s=p.offsetY-f.top;$(this).css({left:b,top:s});$(this).find(".terminal").each(function(){this.terminal.redraw()})});return g}var ext_to_type=null;var type_to_type=null;function issubtype(b,a){b=ext_to_type[b];a=ext_to_type[a];return(type_to_type[b])&&(a in type_to_type[b])}function populate_datatype_info(a){ext_to_type=a.ext_to_class_name;type_to_type=a.class_to_classes}function ScrollPanel(a){this.panel=a}$.extend(ScrollPanel.prototype,{test:function(v,d){clearTimeout(this.timeout);var k=v.pageX,j=v.pageY,l=$(this.panel),c=l.position(),b=l.width(),i=l.height(),w=l.parent(),s=w.width(),a=w.height(),r=w.offset(),p=r.left,m=r.top,A=p+w.width(),u=m+w.height(),B=-(b-(s/2)),z=-(i-(a/2)),g=(s/2),f=(a/2),h=false,q=5,o=23;if(k-q<p){if(c.left<g){var n=Math.min(o,g-c.left);l.css("left",c.left+n);h=true}}else{if(k+q>A){if(c.left>B){var n=Math.min(o,c.left-B);l.css("left",c.left-n);h=true}}else{if(j-q<m){if(c.top<f){var n=Math.min(o,f-c.top);l.css("top",c.top+n);h=true}}else{if(j+q>u){if(c.top>z){var n=Math.min(o,c.top-B);l.css("top",(c.top-n)+"px");h=true}}}}}if(h){d();var l=this;this.timeout=setTimeout(function(){l.test(v,d)},50)}},stop:function(b,a){clearTimeout(this.timeout)}});function CanvasManager(b,a){this.cv=b;this.cc=this.cv.find("#canvas-container");this.oc=a.find("#overview-canvas");this.ov=a.find("#overview-viewport");this.init_drag()}$.extend(CanvasManager.prototype,{init_drag:function(){var b=this;var a=function(f,g){f=Math.min(f,b.cv.width()/2);f=Math.max(f,-b.cc.width()+b.cv.width()/2);g=Math.min(g,b.cv.height()/2);g=Math.max(g,-b.cc.height()+b.cv.height()/2);b.cc.css({left:f,top:g});b.update_viewport_overlay()};this.cc.each(function(){this.scroll_panel=new ScrollPanel(this)});var d,c;this.cv.bind("dragstart",function(){var g=$(this).offset();var f=b.cc.position();c=f.top-g.top;d=f.left-g.left}).bind("drag",function(f,g){a(g.offsetX+d,g.offsetY+c)}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});this.ov.bind("drag",function(k,l){var h=b.cc.width(),n=b.cc.height(),m=b.oc.width(),j=b.oc.height(),f=$(this).offsetParent().offset(),i=l.offsetX-f.left,g=l.offsetY-f.top;a(-(i/m*h),-(g/j*n))}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});$("#overview-border").bind("drag",function(g,i){var j=$(this).offsetParent();var h=j.offset();var f=Math.max(j.width()-(i.offsetX-h.left),j.height()-(i.offsetY-h.top));$(this).css({width:f,height:f});b.draw_overview()});$("#overview-border div").bind("drag",function(){})},update_viewport_overlay:function(){var b=this.cc,f=this.cv,a=this.oc,c=this.ov,d=b.width(),j=b.height(),i=a.width(),g=a.height(),h=b.position();c.css({left:-(h.left/d*i),top:-(h.top/j*g),width:(f.width()/d*i)-2,height:(f.height()/j*g)-2})},draw_overview:function(){var j=$("#overview-canvas"),m=j.parent().parent().width(),i=j.get(0).getContext("2d"),d=$("#canvas-container").width(),l=$("#canvas-container").height();var g,a,k,f;var h=this.cv.width();var b=this.cv.height();if(d<h&&l<b){k=d/h*m;f=(m-k)/2;g=l/b*m;a=(m-g)/2}else{if(d<l){a=0;g=m;k=Math.ceil(g*d/l);f=(m-k)/2}else{k=m;f=0;g=Math.ceil(k*l/d);a=(m-g)/2}}j.parent().css({left:f,top:a,width:k,height:g});j.attr("width",k);j.attr("height",g);$.each(workflow.nodes,function(t,q){i.fillStyle="#D2C099";i.strokeStyle="#D8B365";i.lineWidth=1;var s=$(q.element),n=s.position(),c=n.left/d*k,r=n.top/l*g,o=s.width()/d*k,p=s.height()/l*g;if(q.tool_errors){i.fillStyle="#FFCCCC";i.strokeStyle="#AA6666"}else{if(q.workflow_outputs!=undefined&&q.workflow_outputs.length>0){i.fillStyle="#E8A92D";i.strokeStyle="#E8A92D"}}i.fillRect(c,r,o,p);i.strokeRect(c,r,o,p)});this.update_viewport_overlay()}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            commit/galaxy-central: natefoo: Fix for pysam egg conditional, which would always fail, and actually check always_conditional eggs in the crate's all_eggs method. Fixes downloading of eggs for offline systems.
                        
                        
by Bitbucket 10 Feb '11
                    by Bitbucket 10 Feb '11
10 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/559a9ad2844d/
changeset:   r5038:559a9ad2844d
user:        natefoo
date:        2011-02-10 18:13:55
summary:     Fix for pysam egg conditional, which would always fail, and actually check always_conditional eggs in the crate's all_eggs method.  Fixes downloading of eggs for offline systems.
affected #:  1 file (82 bytes)
--- a/lib/galaxy/eggs/__init__.py	Thu Feb 10 10:33:08 2011 -0500
+++ b/lib/galaxy/eggs/__init__.py	Thu Feb 10 12:13:55 2011 -0500
@@ -295,8 +295,9 @@
         """
         rval = []
         for egg in self.eggs.values():
-            if egg.name not in self.galaxy_config.always_conditional:
-                rval.append( egg )
+            if egg.name in self.galaxy_config.always_conditional and not self.galaxy_config.check_conditional( egg.name ):
+                continue
+            rval.append( egg )
         return rval
     def __getitem__( self, name ):
         """
@@ -357,7 +358,7 @@
                          "python_daemon":   lambda: sys.version_info[:2] >= ( 2, 5 ),
                          "GeneTrack":       lambda: sys.version_info[:2] >= ( 2, 5 ),
                          "ctypes":          lambda: ( "drmaa" in self.config.get( "app:main", "start_job_runners" ).split(",") ) and sys.version_info[:2] == ( 2, 4 ),
-                         "pysam":           check_pysam()
+                         "pysam":           lambda: check_pysam()
                        }.get( egg_name, lambda: True )()
             except:
                 return False
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            commit/galaxy-central: guru: Better handling of complex interrupted microsatellites in 'Extract orthologous microsatellites for multiple species alignments' tool.
                        
                        
by Bitbucket 10 Feb '11
                    by Bitbucket 10 Feb '11
10 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/d5ce1d53e611/
changeset:   r5037:d5ce1d53e611
user:        guru
date:        2011-02-10 16:33:08
summary:     Better handling of complex interrupted microsatellites in 'Extract orthologous microsatellites for multiple species alignments' tool.
affected #:  2 files (2.6 KB)
--- a/tools/regVariation/multispecies_MicrosatDataGenerator_interrupted_GALAXY.pl	Wed Feb 09 16:49:43 2011 -0500
+++ b/tools/regVariation/multispecies_MicrosatDataGenerator_interrupted_GALAXY.pl	Thu Feb 10 10:33:08 2011 -0500
@@ -18,7 +18,12 @@
 #-------------------------------------------------------------------------------
 # WHICH SPUTNIK USED?
 my $sputnikpath = ();
-$sputnikpath = "sputnik" ;
+$sputnikpath = "/Users/ydk/work/rhesus_microsat/codes/./sputnik_Mac-PowerPC";
+#print "sputnik_Mac-PowerPC non-existant\n" if !-e $sputnikpath;
+#exit if !-e $sputnikpath;
+#$sputnikpath = "bx-sputnik" ;
+#print "ARGV input = @ARGV\n";
+#print "ARGV input :\n mafile=$mafile\n orthfile=$orthfile\n threshold_array=$threshold_array\n  species_set=$species_set\n tree_definition=$tree_definition\n separation=$separation\n";
 #-------------------------------------------------------------------------------
 # RUNFILE
 #-------------------------------------------------------------------------------
@@ -37,9 +42,12 @@
 my $tdir = tempdir( CLEANUP => 0 );
 chdir $tdir;
 my $dir = getcwd;  
+#print "current dit=$dir\n";
 #-------------------------------------------------------------------------------
 # CREATE AXT FILES IN FORWARD AND REVERSE ORDERS IF NECESSARY
 my @chrfiles=();
+
+#my $mafile =  "/Users/ydk/work/rhesus_microsat/results/galay/align.txt"; #$ARGV[0];
 my $chromt=int(rand(10000));
 my $p_chr=$chromt;
 
@@ -54,20 +62,27 @@
 		push @exactspecies, $spec if $spec eq $espec;
 	}
 }
+#print "exactspecies=@exactspecies\n";
 my $focalspec = $exactspecies[0];
 my $arranged_species_set=join(".",@exactspecies);
 my $chr_name = join(".",("chr".$p_chr),$arranged_species_set, "net", "axt");
+#print "sending to maftoAxt_multispecies: $mafile, $tree_definition, $chr_name, $species_set .. focalspec=$focalspec \n"; 
 maftoAxt_multispecies($mafile, $tree_definition, $chr_name, $species_set);
+#print "done maf to axt conversion\n";
 my $reverse_chr_name = join(".",("chr".$p_chr."r"),$arranged_species_set, "net", "axt");
 artificial_axdata_inverter ($chr_name, $reverse_chr_name);
+#print "reverse_chr_name=$reverse_chr_name\n"; 
 #-------------------------------------------------------------------------------
+# FIND THE CORRESPONDING CHIMP CHROMOSOME FROM FILE ORTp_chrS.TXT
 foreach my $direct ("reverse_direction","forward_direction"){
 	$p_chr=$chromt;
+	#print "direction = $direct\n";
 	$p_chr = $p_chr."r" if $direct eq "reverse_direction";
 	$p_chr = $p_chr if $direct eq "forward_direction";
 	my $config = $species_set;
 	$config=~s/,/./g;
 	my @orgs = split(/\./,$arranged_species_set);
+	#print "ORGS= @orgs\n";
 	my @tag=@orgs;
 		
 	
@@ -80,6 +95,7 @@
 	my $ptag = $orgs[0]."-".$pchr.".".join(".",@orgs[1 ... scalar(@orgs)-1])."-".$threshold_array;
 	my @sp_tags = ();
 	
+	#print "orgs=@orgs, pchr=$pchr, hence, ptag = $ptag\n";
 	foreach my $sp (@tag){
 		push(@sp_tags, ($sp.".".$ptag));
 	}
@@ -105,6 +121,10 @@
 		push(@title_queries, $title);
 	}
 	my $title_query = join($sep, @title_queries);
+	#print "title_queries=@title_queries\n";
+	#print "query = >$title_query<\n"; 
+	#print "orgs = @orgs\n"; 
+	#-------------------------------------------------------------------------------
 	# GET AXTNET FILES, EDIT THEM AND SPLIT THEM INTO HUMAN AND CHIMP INPUT FILES
 	my $t1input = $pchr.".".$arranged_species_set.".net.axt";
 	
@@ -115,6 +135,8 @@
 	}
 	
 	multi_species_t1($t1input,$tags,(join(",", @t1outputs)), $title_query); 
+	#print "t1outputs=@t1outputs\n";
+	#print "done t1\n";
 	#-------------------------------------------------------------------------------
 	#START T2.PL
 	
@@ -261,6 +283,7 @@
 		multispecies_filtering_compound_microsats($compound_microsats, $compound_filterout, $compound_residue,$threshold_array,$threshold_array,scalar(@sp_tags));
 		$species_counter++;
 	}
+	#print "done filtering both simple and compound microsatellites \n";
 	
 	#-------------------------------------------------------------------------------
 	
@@ -289,6 +312,7 @@
 		}
 		$sp_counter++;		
 	}
+	#print "\ndone grouping interrupted & simple microsats based on their motif size for further extention\n";
 	
 	#-------------------------------------------------------------------------------
 	# BREAK CHROMOSOME INTO PARTS OF CERTAIN NO. CONTIGS EACH, FOR FUTURE SEARCHING OF INTERRUPTED MICROSATELLITES
@@ -311,6 +335,7 @@
 	
 
 	my @unionarray = ();
+	#print "splist=@splist\n";
 	#-------------------------------------------------------------------------------
 	# FIND INTERRUPTED MICROSATELLITES
 	
@@ -426,6 +451,7 @@
 #xxxxxxx maftoAxt_multispecies xxxxxxx xxxxxxx maftoAxt_multispecies xxxxxxx xxxxxxx maftoAxt_multispecies xxxxxxx 
 
 sub maftoAxt_multispecies {
+	#print "in maftoAxt_multispecies : got @_\n";
 	my $fname=$_[0];
 	open(IN,"<$_[0]") or die "Cannot open $_[0]: $! \n";
 	my $treedefinition = $_[1];
@@ -443,6 +469,7 @@
 			push @exactspecies, $spec if $spec eq $espec;
 		}
 	}
+	#print "exactspecies=@exactspecies\n";
 	
 	###########
 	my $select = 2;  
@@ -453,7 +480,9 @@
 	my @allowedset = ();
 	@allowedset = split(/;/,allowedSetOfSpecies(join("_",@species))) if $select == 0;
 	@allowedset = join("_",0,@species) if $select == 1;
+	#print "species = @species , allowedset =",join("\n", @allowedset) ," \n"; 
 	@allowedset = join("_",0,@exactspecies) if $select == 2;
+	#print "allowedset = @allowedset and exactspecies = @exactspecies\n";
 	
 	my $start = 0;
 	my @sequences = ();
@@ -474,6 +503,7 @@
 		}
 		
 		if ($line =~ /^s /){
+		#	print "fields1 = $fields[1] , start = $start\n";
 		
 			foreach my $sp (@species){
 				if ($fields[1] =~ /$sp/){
@@ -493,12 +523,14 @@
 			my $arrno = 0;
 			foreach my $set (@allowedset){
 				if ($arranged eq $set){
+	#				print "$arranged == $set\n";
 					$stopper = 0; last;
 				}
 				$arrno++;
 			}
 	
 			if ($stopper == 0) {
+			#	print "    accepted\n";
 				@titles = split ";", orderInfo(join(";", @titles), $species_counter, $arranged) if $species_counter ne $arranged;				
 				@sequences = split ";", orderInfo(join(";", @sequences), $species_counter, $arranged) if $species_counter ne $arranged;				
 				my $filteredseq = filter_gaps(@sequences);
@@ -519,6 +551,7 @@
 			
 		}
 	}
+#	print "countermatch = $countermatch\n";
 }
 
 sub reorderSpecies{
@@ -535,6 +568,7 @@
 
 sub filter_gaps{
 	my @sequences = @_;
+#	print "sequences sent are @sequences\n";
 	my $seq_length = length($sequences[0]);
 	my $seq_no = scalar(@sequences);
 	my $allgaps = ();
@@ -557,7 +591,9 @@
 		for my $u (0 ... $#seq_array){
 			$bases = $bases.$seq_array[$u][$g];
 		}	
+#		print $bases, "\n";
 		if ($bases eq $allgaps){
+#			print "bases are $bases, position is $g \n";
 			for my $seq (@seq_array){
 				splice(@$seq , $g, 1);
 			}
@@ -580,6 +616,7 @@
 sub allowedSetOfSpecies{
 	my @allowed_species = split(/_/,$_[0]);
 	unshift @allowed_species, 0;
+#	print "allowed set = @allowed_species \n";
 	my @output = ();
 	for (0 ... scalar(@allowed_species) - 4){
 		push(@output, join("_",@allowed_species));
@@ -626,14 +663,15 @@
 				my @fields = split(/\s*/,$line);
 				
 				$final_line = join("",reverse(@fields));
-				print colored ['red'], "$line\n$final_line\n" if $final_line eq $line && $line !~ /chr/ && $line =~ /[a-zA-Z]/;
+		#		print colored ['red'], "$line\n$final_line\n" if $final_line eq $line && $line !~ /chr/ && $line =~ /[a-zA-Z]/;
 		#		$trycounter++;
+		#		print "trying again....$trycounter : $final_line\n" if $final_line eq $line;
 		#	}
 		}
 		
-		print colored ['yellow'], "$line\n$final_line\n" if $final_line eq $line && $line !~ /chr/ && $line =~ /[a-zA-Z]/;
+	#	print colored ['yellow'], "$line\n$final_line\n" if $final_line eq $line && $line !~ /chr/ && $line =~ /[a-zA-Z]/;
 		if ($line =~ /^[0-9]/){
-			$line =~ s/chr([0-9a-b]+)/chr$1r/g;
+			$line =~ s/chr([A-Z0-9a-b]+)/chr$1r/g;
 			$final_line = $line;
 		}
 		print OUT $final_line,"\n";
@@ -649,7 +687,7 @@
 sub multi_species_t1 {
 
 	my $input1 = $_[0];
-	#print "@_\n"; #<STDIN>;
+#	print "@_\n"; #<STDIN>;
 	my @tags = split(/_/, $_[1]);
 	my @outputs = split(/,/, $_[2]);
 	my $title_query = $_[3];
@@ -1678,7 +1716,7 @@
 			$key = join("\t",$1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);
 		}
 		else{
-			print "no key in $sine\nfor pattern ([a-z0-9A-Z]+) (chr[0-9a-zA-Z]+) ([0-9]+) ([0-9]+) [\+|\-] (a-z0-9A-Z) (chr[0-9a-zA-Z]+) ([0-9]+) ([0-9]+) [\+|\-] (a-z0-9A-Z) (chr[0-9a-zA-Z]+) ([0-9]+) ([0-9]+)   / \n"; 
+#			print "no key in $sine\nfor pattern ([a-z0-9A-Z]+) (chr[0-9a-zA-Z]+) ([0-9]+) ([0-9]+) [\+|\-] (a-z0-9A-Z) (chr[0-9a-zA-Z]+) ([0-9]+) ([0-9]+) [\+|\-] (a-z0-9A-Z) (chr[0-9a-zA-Z]+) ([0-9]+) ([0-9]+)   / \n"; 
 		}
 	
 		if (exists $micros{$key}){
@@ -1686,8 +1724,8 @@
 			delete $micros{$key};
 			
 			foreach my $line (@microstring){
-				print "#---------#---------#---------#---------#---------#---------#---------#---------\n" if $printer == 1; 
-				print "microsat = $line" if $printer == 1; 
+#				print "#---------#---------#---------#---------#---------#---------#---------#---------\n" if $printer == 1; 
+#				print "microsat = $line" if $printer == 1; 
 				$linecounter++;
 				my $copy_line = $line;
 				my @mields = split(/\t/,$line);
@@ -1704,7 +1742,7 @@
 				my @microields = split(/\][a-zA-Z|-]*\[/,$microsatcopy);
 				my @inields = split(/\[[a-zA-Z|-]*\]/,$microsat);
 				my $absolutstart = 1; my $absolutend = $absolutstart + ($end-$start);
-				print "absolut: start = $absolutstart, end = $absolutend\n" if $printer == 1;
+#				print "absolut: start = $absolutstart, end = $absolutend\n" if $printer == 1;
 				shift @inields;
 				#print "inields =@inields<\n";
 				$motifline =~ s/^\[|\]$//gs;
@@ -1790,11 +1828,11 @@
 				
 				if ($rightstopper == 1 && $leftstopper == 1){
 					print COMP $line; 
-					print "rightstopper == 1 && leftstopper == 1\n" if $printer == 1; 
+#					print "rightstopper == 1 && leftstopper == 1\n" if $printer == 1; 
 					next;
 				}
 	
-				print "pased initial testing phase \n" if $printer == 1; 
+#				print "pased initial testing phase \n" if $printer == 1; 
 				my @outputs = ();
 				my @orig_starts = ();
 				my @orig_ends = ();
@@ -1845,7 +1883,7 @@
 	
 					while($lefter == 1){
 						$newline = left_extender($templine, $seq,$org);
-						print "returned line from left extender= $newline \n" if $printer == 1; 
+#						print "returned line from left extender= $newline \n" if $printer == 1; 
 						if ($newline eq $templine){$templine = $newline; last;}
 						else {$templine = $newline;}
 						
@@ -1853,7 +1891,7 @@
 					}
 					while($righter == 1){
 						$newline = right_extender($templine, $seq,$org);
-						print "returned line from right extender= $newline \n" if $printer == 1; 
+#						print "returned line from right extender= $newline \n" if $printer == 1; 
 						if ($newline eq $templine){$templine = $newline; last;}
 						else {$templine = $newline;}
 						if (right_extention_permission_giver($templine) eq "no") {last;}
@@ -1864,7 +1902,7 @@
 					my @tempmotields = split(/\]\[/,$tempfields[$motifcord]);			
 					
 					if (scalar(@tempmotields) == 1 && $templine eq $orig_templine) { 
-						print "scalar ( tempmotields) = 1\n" if $printer == 1; 
+#						print "scalar ( tempmotields) = 1\n" if $printer == 1; 
 						next;
 					} 
 					my $prevmotif = shift(@tempmotields);
@@ -1877,7 +1915,7 @@
 						$prevmotif = $tempmot;
 					}
 					if ( $stopper == 1) { 
-						print "length tempmot  != length prevmotif\n" if $printer == 1; 
+#						print "length tempmot  != length prevmotif\n" if $printer == 1; 
 						next; 
 					} 
 					my $lastend  = 0;
@@ -1886,32 +1924,32 @@
 					my $left_bp = (); my $right_bp = ();
 	#				print "new startcord = $tempfields[$startcord] , new endcord  = $tempfields[$endcord].. orig strts = @orig_starts and orig ends = @orig_ends\n";
 					for my $o (0 ... $#orig_starts){
-						print "we are talking abut tempstart:$tempfields[$startcord] >= origstart:$lastend && tempstart:$tempfields[$startcord] <= origend: $orig_ends[$o] \n" if $printer == 1; 
-						print "we are talking abut tempend:$tempfields[$endcord] >= origstart:$lastend && tempstart:$tempfields[$endcord] >= origend: $orig_ends[$o] \n" if $printer == 1; 
+#						print "we are talking abut tempstart:$tempfields[$startcord] >= origstart:$lastend && tempstart:$tempfields[$startcord] <= origend: $orig_ends[$o] \n" if $printer == 1; 
+#						print "we are talking abut tempend:$tempfields[$endcord] >= origstart:$lastend && tempstart:$tempfields[$endcord] >= origend: $orig_ends[$o] \n" if $printer == 1; 
 	
 						if (($tempfields[$startcord] > $lastend)  && ($tempfields[$startcord] <= $orig_ends[$o])){ # && ($tempfields[$startcord] != $fields[$startcord])
-							print "motif captured on left is $microields[$o] from $microsat\n" if $printer == 1; 
+#							print "motif captured on left is $microields[$o] from $microsat\n" if $printer == 1; 
 							$left_captured  = $o;
 							$left_bp =  $orig_ends[$o] - $tempfields[$startcord] + 1;
 						}
 						elsif ($tempfields[$endcord] > $lastend  && $tempfields[$endcord] <= $orig_ends[$o]){ #&& $tempfields[$endcord] != $fields[$endcord])
-							print "motif captured on right is $microields[$o] from $microsat\n" if $printer == 1; 
+#							print "motif captured on right is $microields[$o] from $microsat\n" if $printer == 1; 
 							$right_captured  = $o;
 							$right_bp = $tempfields[$endcord]  - $orig_starts[$o] + 1;
 						}
 						$lastend = $orig_ends[$o]
 					}
-					print "leftcaptured = $left_captured, right = $right_captured\n" if $printer==1;
+#					print "leftcaptured = $left_captured, right = $right_captured\n" if $printer==1;
 					my $leftmotif = (); my $left_trashed = ();
 					if ($tempfields[$startcord] != $fields[$startcord]) {
 						$leftmotif = $motields[$left_captured]; 
-						print "$left_captured in @microields: $motields[$left_captured]\n" if $printer == 1; 
+#						print "$left_captured in @microields: $motields[$left_captured]\n" if $printer == 1; 
 						if ( $left_captured !~ /[0-9]+/) {print $line,"\n", $templine,"\n"; }
 						 $left_trashed = length($microields[$left_captured]) - $left_bp;
 					}
 					my $rightmotif = (); my $right_trashed = ();
 					if ($tempfields[$endcord] != $fields[$endcord]) {
-						print "$right_captured in @microields: $motields[$right_captured]\n" if $printer == 1; 
+#						print "$right_captured in @microields: $motields[$right_captured]\n" if $printer == 1; 
 						$rightmotif = $motields[$right_captured];
 						$right_trashed = length($microields[$right_captured]) - $right_bp;
 					} 
@@ -1920,54 +1958,54 @@
 					$stopper = 0;
 					my $deletioner = 0;
 					#if($tempfields[$startcord] != $fields[$startcord]){
-						print "enter left: tempfields,startcord  : $tempfields[$startcord] != $absolutstart && left_captured: $left_captured != 0 \n" if $printer==1;
+#						print "enter left: tempfields,startcord  : $tempfields[$startcord] != $absolutstart && left_captured: $left_captured != 0 \n" if $printer==1;
 						if ($left_captured != 0){ 
-							print "at line 370, going: 0 ... $left_captured-1 \n" if $printer == 1;
+#							print "at line 370, going: 0 ... $left_captured-1 \n" if $printer == 1;
 							for my $e (0 ... $left_captured-1){
 								if( length($motields[$e]) > 2 && length($microields[$e]) > (3* length($motields[$e]) )){
-									print "motif on left not included too big to be ignored : $microields[$e] \n" if $printer == 1;  
+#									print "motif on left not included too big to be ignored : $microields[$e] \n" if $printer == 1;  
 									$deletioner++; last;
 								}
 								if( length($motields[$e]) == 2 && length($microields[$e]) > (3* length($motields[$e]) )){
-									print "motif on left not included too big to be ignored : $microields[$e] \n" if $printer == 1;  
+#									print "motif on left not included too big to be ignored : $microields[$e] \n" if $printer == 1;  
 									$deletioner++; last;
 								}
 								if( length($motields[$e]) == 1 && length($microields[$e]) > (4* length($motields[$e]) )){
-									print "motif on left not included too big to be ignored : $microields[$e] \n" if $printer == 1; 
+#									print "motif on left not included too big to be ignored : $microields[$e] \n" if $printer == 1; 
 									$deletioner++; last;
 								}
 							}				
 						}
 					#}
-					print "after left search, deletioner = $deletioner\n" if $printer == 1;
+#					print "after left search, deletioner = $deletioner\n" if $printer == 1;
 					if ($deletioner >= 1) {  
-						print "deletioner = $deletioner\n" if $printer == 1;
+#						print "deletioner = $deletioner\n" if $printer == 1;
 						next; 
 					} 
 					
 					$deletioner = 0;
 	
 					#if($tempfields[$endcord] != $fields[$endcord]){				
-						print "if tempfields endcord: $tempfields[$endcord] != absolutend: $absolutend\n and $right_captured != $#microields\n" if $printer==1;
+#						print "if tempfields endcord: $tempfields[$endcord] != absolutend: $absolutend\n and $right_captured != $#microields\n" if $printer==1;
 						if ($right_captured != $#microields){ 
-							print "at line 394, going: $right_captured+1 ... $#microields \n" if $printer == 1;
+#							print "at line 394, going: $right_captured+1 ... $#microields \n" if $printer == 1;
 							for my $e ($right_captured+1 ... $#microields){
 								if( length($motields[$e]) > 2 &&  length($microields[$e]) > (3* length($motields[$e])) ){
-									print "motif on right not included too big to be ignored : $microields[$e] \n" if $printer == 1; 
+#									print "motif on right not included too big to be ignored : $microields[$e] \n" if $printer == 1; 
 									$deletioner++; last;
 								}
 								if( length($motields[$e]) == 2 && length($microields[$e]) > (3* length($motields[$e]) )){
-									print "motif on right not included too big to be ignored : $microields[$e] \n" if $printer == 1;
+#									print "motif on right not included too big to be ignored : $microields[$e] \n" if $printer == 1;
 									$deletioner++; last;
 								}
 								if( length($motields[$e]) == 1 && length($microields[$e]) > (4* length($motields[$e]) )){
-									print "motif on right not included too big to be ignored : $microields[$e] \n" if $printer == 1;
+#									print "motif on right not included too big to be ignored : $microields[$e] \n" if $printer == 1;
 									$deletioner++; last;
 								}
 							}				
 						}
 					#}
-					print "deletioner = $deletioner\n" if $printer == 1;
+#					print "deletioner = $deletioner\n" if $printer == 1;
 					if ($deletioner >= 1) {  
 						next; 
 					} 
@@ -1977,24 +2015,24 @@
 					if ($tempfields[$startcord] != $fields[$startcord] ){
 						#print "in left params: (length($leftmotif) == 1 && $tempfields[$startcord] != $fields[$startcord]) ... and .... $left_trashed > (1.5* length($leftmotif]) && ($tempfields[$startcord] != $fields[$startcord])\n";
 						if (length($leftmotif) == 1 && $left_trashed > 3){
-							print "invaded left motif is long mononucleotide" if $printer == 1;
+#							print "invaded left motif is long mononucleotide" if $printer == 1;
 							 next;
 	
 						}
 						elsif ((length($leftmotif) != 1 && $left_trashed > ( thrashallow($leftmotif)) && ($tempfields[$startcord] != $fields[$startcord]) ) ){
-							print "invaded left motif too long" if $printer == 1; 						
+#							print "invaded left motif too long" if $printer == 1; 						
 							 next; 
 						}
 					}
 					if ($tempfields[$endcord] != $fields[$endcord] ){
 						#print "in right params: after $tempfields[$endcord] != $fields[$endcord]  .....   (length($rightmotif)==1 && $tempfields[$endcord] != $fields[$endcord]) ... and ... $right_trashed > (1.5* length($rightmotif))\n";
 						if (length($rightmotif)==1 && $right_trashed){
-							print "invaded right motif is long mononucleotide" if $printer == 1; 
+#							print "invaded right motif is long mononucleotide" if $printer == 1; 
 							 next; 
 	
 						}
 						elsif (length($rightmotif) !=1 && ($right_trashed > ( thrashallow($rightmotif))  && $tempfields[$endcord] != $fields[$endcord])){
-							print "invaded right motif too long" if $printer == 1;
+#							print "invaded right motif too long" if $printer == 1;
 							 next; 
 	
 						}
@@ -2286,8 +2324,8 @@
 	
 	##print "scalar of fields = ",scalar(@fields),"\n";
 	if (exists ($fields[$motifcord+1])){
-		print " print fields = @fields.. scalar=", scalar(@fields),".. motifcord+1 = $motifcord + 1 \n " if !exists $fields[$motifcord+1];
-		<STDIN> if !exists $fields[$motifcord+1];
+#		print " print fields = @fields.. scalar=", scalar(@fields),".. motifcord+1 = $motifcord + 1 \n " if !exists $fields[$motifcord+1];
+#		<STDIN> if !exists $fields[$motifcord+1];
 		$fields[$motifcord+1] = $fields[$motifcord+1].",indel/deletion";
 	}
 	else{$fields[$motifcord+1] = "indel/deletion";}
@@ -2302,7 +2340,7 @@
 	my @seventeen=();
 	if (exists ($fields[$motifcord+3])){
 		##print "at 608 we are doing this:length($microsat)+$intervalposs[$nikaal]\n";
-		print " print fields = @fields\n " if !exists $fields[$motifcord+3];
+#		print " print fields = @fields\n " if !exists $fields[$motifcord+3];
 		<STDIN> if !exists $fields[$motifcord+3];
 		my $currpos = length($microsat)+$intervalposs[$nikaal];
 		$fields[$motifcord+3] = $fields[$motifcord+3].",".$currpos;
@@ -2596,7 +2634,7 @@
 			open(SUB,">$subset");
 			print SUB $sine;
 			print OUT $subset,"\n";
-			print $subset,"\n";
+	#		print $subset,"\n";
 		}
 	}
 	close OUT;
@@ -2684,7 +2722,7 @@
 			my @microstring = @{$micros{$key}};
 			delete $micros{$key};
 			my @filteredmicrostring;
-			print "sequence = $sields[$sequencepos]" if $prinkter == 1;
+#			print "sequence = $sields[$sequencepos]" if $prinkter == 1;
 			foreach my $line (@microstring){
 				$linecounter++;
 				my $copy_line = $line;
@@ -2692,7 +2730,7 @@
 				my $start = $fields[$startcord];
 				my $end = $fields[$endcord];
 				
-				print $line if $prinkter == 1;
+#				print $line if $prinkter == 1;
 				#LOOKING FOR LEFTWARD EXTENTION OF MICROSATELLITE 
 				my $newline;
 				while(1){
@@ -2704,7 +2742,7 @@
 					else {$line = $newline;}
 					
 					if (multiSpecies_interruptedMicrosatHunter_left_extention_permission_giver($line) eq "no") {last;}
-					print "returned line from left extender= $line \n" if $prinkter == 1;
+#					print "returned line from left extender= $line \n" if $prinkter == 1;
 				}
 				while(1){
 				#	print "sequence = $sields[$sequencepos]\n" if $prinkter == 1;
@@ -2715,9 +2753,9 @@
 					else {$line = $newline;}
 					
 					if (multiSpecies_interruptedMicrosatHunter_right_extention_permission_giver($line) eq "no") {last;}
-					print "returned line from right extender= $line \n" if $prinkter == 1;
+#					print "returned line from right extender= $line \n" if $prinkter == 1;
 				}
-				print "\n>>>>>>>>>>>>>>>>\n In the end, the line is: \n$line\n<<<<<<<<<<<<<<<<\n" if $prinkter == 1;
+#				print "\n>>>>>>>>>>>>>>>>\n In the end, the line is: \n$line\n<<<<<<<<<<<<<<<<\n" if $prinkter == 1;
 	
 				my @tempfields = split(/\t/,$line);
 				if ($tempfields[$microsatcord] =~ /\[/){
@@ -2744,7 +2782,7 @@
 
 sub multiSpecies_interruptedMicrosatHunter_left_extender{
 	my ($line, $seq, $org) = @_;	
-	print "left extender, like passed = $line\n" if $prinkter == 1;
+#	print "left extender, like passed = $line\n" if $prinkter == 1;
 #	print "in left extender... line passed = $line and sequence is $seq\n" if $prinkter == 1;
 	chomp $line;
 	my @fields = split(/\t/,$line);
@@ -2763,7 +2801,7 @@
 	}
 	else {$firstmotif = $motif;}
 	
-	print "hacked microsat = $microsat, motif = $motif, firstmotif = $firstmotif\n" if $prinkter == 1;
+#	print "hacked microsat = $microsat, motif = $motif, firstmotif = $firstmotif\n" if $prinkter == 1;
 	my $leftphase = substr($microsat, 0,length($firstmotif));
 	my $phaser = $leftphase.$leftphase;
 	my @phase = split(/\s*/,$leftphase);
@@ -2779,7 +2817,7 @@
 	my $end = $rend;
 	
 	my $leftseq = substr($seq, 0, $start);
-	print "left phases are @phases , start = $start left sequence = ",substr($leftseq, -10),"\n" if $prinkter == 1;	
+#	print "left phases are @phases , start = $start left sequence = ",substr($leftseq, -10),"\n" if $prinkter == 1;	
 	my @extentions = ();
 	my @trappeds = ();
 	my @intervalposs = ();
@@ -2788,15 +2826,15 @@
 	my @intervals = ();
 	my $firstmotif_length = length($firstmotif);
 	foreach my $phase (@phases){
-		print "left phase\t",substr($leftseq, -10),"\t$phase\n" if $prinkter == 1;
-		print "search patter = (($phase)+([a-zA-Z|-]{0,$firstmotif_length})) \n" if $prinkter == 1;
+#		print "left phase\t",substr($leftseq, -10),"\t$phase\n" if $prinkter == 1;
+#		print "search patter = (($phase)+([a-zA-Z|-]{0,$firstmotif_length})) \n" if $prinkter == 1;
 		if ($leftseq =~ /(($phase)+([a-zA-Z|-]{0,$firstmotif_length}))$/i){
-			print "in left pattern\n" if $prinkter == 1;
+#			print "in left pattern\n" if $prinkter == 1;
 			my $trapped = $1;
 			my $trappedpos = length($leftseq)-length($trapped);
 			my $interval = $3;
 			my $intervalpos = index($trapped, $interval) + 1;
-			print "left trapped = $trapped, interval = $interval, intervalpos = $intervalpos\n" if $prinkter == 1;
+#			print "left trapped = $trapped, interval = $interval, intervalpos = $intervalpos\n" if $prinkter == 1;
 
 			my $extention = substr($trapped, 0, length($trapped)-length($interval));
 			my $leftpeep = substr($seq, 0, ($start-length($trapped)));
@@ -2804,12 +2842,12 @@
 			
 			for my $i (1 ... length($phase)-1){
 				my $overhang = substr($phase, -length($phase)+$i);
-				print "current overhang = $overhang, leftpeep = ",substr($leftpeep,-10)," whole sequence = ",substr($seq, ($end - ($end-$start) - 20), (($end-$start)+20)),"\n" if $prinkter == 1;
+#				print "current overhang = $overhang, leftpeep = ",substr($leftpeep,-10)," whole sequence = ",substr($seq, ($end - ($end-$start) - 20), (($end-$start)+20)),"\n" if $prinkter == 1;
 				#TEMPORARY... BETTER METHOD NEEDED
 				$leftpeep =~ s/-//g;
 				if ($leftpeep =~ /$overhang$/i){
 					push(@passed_overhangs,$overhang);
-					print "l overhang\n" if $prinkter == 1;
+#					print "l overhang\n" if $prinkter == 1;
 				}
 			}
 			
@@ -2817,17 +2855,17 @@
 				my $overhang = $passed_overhangs[longest_array_element(@passed_overhangs)];
 				$extention = $overhang.$extention;
 				$trapped = $overhang.$trapped;
-				print "trapped extended to $trapped \n" if $prinkter == 1;
+#				print "trapped extended to $trapped \n" if $prinkter == 1;
 				$trappedpos = length($leftseq)-length($trapped);
 			}
 			
 			push(@extentions,$extention);
-			print "extentions = @extentions \n" if $prinkter == 1;
+#			print "extentions = @extentions \n" if $prinkter == 1;
 
 			push(@trappeds,$trapped );
 			push(@intervalposs,length($extention)+1);
 			push(@trappedposs, $trappedpos);
-			print "trappeds = @trappeds\n" if $prinkter == 1;
+#			print "trappeds = @trappeds\n" if $prinkter == 1;
 			push(@trappedphases, substr($extention,0,length($phase)));
 			push(@intervals, $interval);
 		}
@@ -2837,7 +2875,7 @@
 ############################	my $nikaal = longest_array_element(@trappeds);
 	my $nikaal = shortest_array_element(@intervals);
 	
-	print "longest element found = $nikaal \n" if $prinkter == 1;
+#	print "longest element found = $nikaal \n" if $prinkter == 1;
 	
 	if ($fields[$motifcord] !~ /\[/i) {$fields[$motifcord] = "[".$fields[$motifcord]."]";}
 	$fields[$motifcord] = "[".$trappedphases[$nikaal]."]".$fields[$motifcord];
@@ -2889,14 +2927,14 @@
 	if ($fields[$microsatcord] =~ /\[/){
 		$returnline = multiSpecies_interruptedMicrosatHunter_merge($returnline);
 	}
-	print "finally left-extended line = ",$returnline,"\n" if $prinkter == 1;
+#	print "finally left-extended line = ",$returnline,"\n" if $prinkter == 1;
 	return $returnline;
 }
 
 sub multiSpecies_interruptedMicrosatHunter_right_extender{
-	print "right extender\n" if $prinkter == 1;
+#	print "right extender\n" if $prinkter == 1;
 	my ($line, $seq, $org) = @_;	
-	print "in right extender... line passed = $line\n" if $prinkter == 1;
+#	print "in right extender... line passed = $line\n" if $prinkter == 1;
 #	print "line = $line, sequence = ",$seq, "\n" if $prinkter == 1;
 	chomp $line;
 	my @fields = split(/\t/,$line);
@@ -2915,7 +2953,7 @@
 	}
 	else {$temp_lastmotif = $motif;}
 	my $lastmotif = substr($microsat,-length($temp_lastmotif));
-	print "hacked microsat = $microsat, motif = $motif, lastmotif = $lastmotif\n" if $prinkter == 1;
+#	print "hacked microsat = $microsat, motif = $motif, lastmotif = $lastmotif\n" if $prinkter == 1;
 	my $rightphase = substr($microsat, -length($lastmotif));
 	my $phaser = $rightphase.$rightphase;
 	my @phase = split(/\s*/,$rightphase);
@@ -2931,8 +2969,8 @@
 	my $end = $rend;
 	
 	my $rightseq = substr($seq, $end+1);
-	print "length of sequence  = " ,length($seq), "the coordinate to start from = ", $end+1, "\n" if $prinkter == 1;
-	print "right phases are @phases , end = $end right sequence = ",substr($rightseq,0,10),"\n" if $prinkter == 1;	
+#	print "length of sequence  = " ,length($seq), "the coordinate to start from = ", $end+1, "\n" if $prinkter == 1;
+#	print "right phases are @phases , end = $end right sequence = ",substr($rightseq,0,10),"\n" if $prinkter == 1;	
 	my @extentions = ();
 	my @trappeds = ();
 	my @intervalposs = ();
@@ -2941,15 +2979,15 @@
 	my @intervals = ();
 	my $lastmotif_length = length($lastmotif);
 	foreach my $phase (@phases){
-		print "right phase\t$phase\t",substr($rightseq,0,10),"\n" if $prinkter == 1;
-		print "search patter = (([a-zA-Z|-]{0,$lastmotif_length})($phase)+) \n" if $prinkter == 1;
+#		print "right phase\t$phase\t",substr($rightseq,0,10),"\n" if $prinkter == 1;
+#		print "search patter = (([a-zA-Z|-]{0,$lastmotif_length})($phase)+) \n" if $prinkter == 1;
 		if ($rightseq =~ /^(([a-zA-Z|-]{0,$lastmotif_length}?)($phase)+)/i){
-			print "in right pattern\n" if $prinkter == 1;
+#			print "in right pattern\n" if $prinkter == 1;
 			my $trapped = $1;
 			my $trappedpos = $end+1;
 			my $interval = $2;
 			my $intervalpos = index($trapped, $interval) + 1;
-			print "trapped = $trapped, interval = $interval\n" if $prinkter == 1;
+#			print "trapped = $trapped, interval = $interval\n" if $prinkter == 1;
 
 			my $extention = substr($trapped, length($interval));
 			my $rightpeep = substr($seq, ($end+length($trapped))+1);
@@ -2960,17 +2998,17 @@
 
 			for my $i (1 ... length($phase)-1){
 				my $overhang = substr($phase,0, $i);
-				print "current extention = $extention, overhang = $overhang, rightpeep = ",substr($rightpeep,0,10),"\n" if $prinkter == 1;
+#				print "current extention = $extention, overhang = $overhang, rightpeep = ",substr($rightpeep,0,10),"\n" if $prinkter == 1;
 				if ($rightpeep =~ /^$overhang/i){
 					push(@passed_overhangs, $overhang);
-					print "r overhang\n" if $prinkter == 1;
+#					print "r overhang\n" if $prinkter == 1;
 				}
 			}
 			if (scalar(@passed_overhangs) > 0){			
 				my $overhang = @passed_overhangs[longest_array_element(@passed_overhangs)];
 				$extention = $extention.$overhang;
 				$trapped = $trapped.$overhang;
-				print "trapped extended to $trapped \n" if $prinkter == 1;
+#				print "trapped extended to $trapped \n" if $prinkter == 1;
 			}
 		
 			push(@extentions,$extention);
@@ -2979,7 +3017,7 @@
 			push(@trappeds,$trapped );
 			push(@intervalposs,$intervalpos);
 			push(@trappedposs, $trappedpos);
-			print "trappeds = @trappeds\n" if $prinkter == 1;
+#			print "trappeds = @trappeds\n" if $prinkter == 1;
 			push(@trappedphases, substr($extention,0,length($phase)));
 			push(@intervals, $interval);
 		}
@@ -2989,7 +3027,7 @@
 ###################################	my $nikaal = longest_array_element(@trappeds);
 	my $nikaal = shortest_array_element(@intervals);
 	
-	print "longest element found = $nikaal \n" if $prinkter == 1;
+#	print "longest element found = $nikaal \n" if $prinkter == 1;
 	
 	if ($fields[$motifcord] !~ /\[/i) {$fields[$motifcord] = "[".$fields[$motifcord]."]";}
 	$fields[$motifcord] = $fields[$motifcord]."[".$trappedphases[$nikaal]."]";
@@ -3032,7 +3070,7 @@
 	if ($fields[$microsatcord] =~ /\[/){
 		$returnline = multiSpecies_interruptedMicrosatHunter_merge($returnline);
 	}
-	print "finally right-extended line = ",$returnline,"\n" if $prinkter == 1;
+#	print "finally right-extended line = ",$returnline,"\n" if $prinkter == 1;
 	return $returnline;
 
 }
@@ -3058,7 +3096,7 @@
 		#print "firststretch = $firststretch\n" if $prinkter == 1;
 	}
 	else {$firstmotif = $motif;$firststretch = $microsat;}
-	print "if length:firststretch - length($firststretch) < threshes length :firstmotif ($firstmotif) - $thresholds[length($firstmotif)]\n" if $prinkter == 1; 
+#	print "if length:firststretch - length($firststretch) < threshes length :firstmotif ($firstmotif) - $thresholds[length($firstmotif)]\n" if $prinkter == 1; 
 	if (length($firststretch) < $thresholds[length($firstmotif)]){
 		return "no";
 	}
@@ -3206,20 +3244,22 @@
 
 }
 sub multiSpecies_interruptedMicrosatHunter_merge{
+		$prinkter = 0;
+#	print "~~~~~~~~|||~~~~~~~~|||~~~~~~~~|||~~~~~~~~|||~~~~~~~~|||~~~~~~~~|||~~~~~~~~\n";
 	my $line = $_[0];
-	print "sent for mering: $line \n" if $prinkter ==1;
+#	print "sent for mering: $line \n" if $prinkter ==1;
 	my @mields = split(/\t/,$line);
 	my @fields = @mields;
 	my $microsat = allCaps($fields[$microsatcord]);
 	my $motifline = allCaps($fields[$motifcord]);
 	my $microsatcopy = $microsat;
-	print "microsat = $microsat|\n" if $prinkter ==1;
+#	print "microsat = $microsat|\n" if $prinkter ==1;
 	$microsatcopy =~ s/^\[|\]$//sg;
 	chomp $microsatcopy;
 	my @microields = split(/\][a-zA-Z|-]*\[/,$microsatcopy);
 	my @inields = split(/\[[a-zA-Z|-]*\]/,$microsat);
 	shift @inields;
-	print "inields =",join("|",@inields)," microields = ",join("|",@microields)," and count of microields = ", $#microields,"\n" if $prinkter ==1;
+#	print "inields =",join("|",@inields)," microields = ",join("|",@microields)," and count of microields = ", $#microields,"\n" if $prinkter ==1;
 	$motifline =~ s/^\[|\]$//sg;
 	my @motields = split(/\]\[/,$motifline);
 	my @firstmotifs = ();
@@ -3228,7 +3268,7 @@
 		$firstmotifs[$i] =  substr($microields[$i],0,length($motields[$i]));
 		$lastmotifs[$i] = substr($microields[$i],-length($motields[$i]));
 	}
-	print "firstmotif = @firstmotifs... lastmotif = @lastmotifs\n" if $prinkter ==1;
+#	print "firstmotif = @firstmotifs... lastmotif = @lastmotifs\n" if $prinkter ==1;
 	my @mergelist = ();
 	my @inter_poses = split(/,/,$fields[$interr_poscord]);
 	my $no_of_interruptions = $fields[$no_of_interruptionscord];
@@ -3236,52 +3276,56 @@
 	my @interrtypes = split(/,/,$fields[$interrtypecord]);
 	my $stopper = 0;
 	for my $i (0 ... $#motields-1){
-		print "studying connection of $motields[$i] and $motields[$i+1], i = $i in $microsat\n:$lastmotifs[$i] eq $firstmotifs[$i+1]?\n" if $prinkter ==1;
+#		print "studying connection of $motields[$i] and $motields[$i+1], i = $i in $microsat\n:$lastmotifs[$i] eq $firstmotifs[$i+1]?\n" if $prinkter ==1;
 		if ((allCaps($lastmotifs[$i]) eq allCaps($firstmotifs[$i+1])) && (!exists $inields[$i] || $inields[$i] !~ /[a-zA-Z]/)){
 			$stopper = 1;
 			push(@mergelist, ($i)."_".($i+1)); #<STDIN> if $prinkter ==1;
 		}
 	}
 	
-	print "mergelist = @mergelist\n" if $prinkter ==1;
+#	print "mergelist = @mergelist\n" if $prinkter ==1;
 	return $line if scalar(@mergelist) == 0;
-	print "merging @mergelist\n" if $prinkter ==1;
+#	print "merging @mergelist\n" if $prinkter ==1;
 #	<STDIN> if $prinkter ==1;
 	
 	foreach my $merging (@mergelist){
 		my @sets = split(/_/, $merging);
-		print "sets = @sets\n" if $prinkter ==1;
+#		print "sets = @sets\n" if $prinkter ==1;
 		my @tempmicro = ();
 		my @tempmot = ();
-		print "for loop going from 0 ... ", $sets[0]-1, "\n" if $prinkter ==1;
+#		print "for loop going from 0 ... ", $sets[0]-1, "\n" if $prinkter ==1;
 		for my $i (0 ... $sets[0]-1){
-			print " adding pre- i = $i adding: microields= $microields[$i]. motields = $motields[$i], inields = |$inields[$i]|\n" if $prinkter ==1;
+#			print " adding pre- i = $i adding: microields= $microields[$i]. motields = $motields[$i], inields = |$inields[$i]|\n" if $prinkter ==1;
 			push(@tempmicro, "[".$microields[$i]."]");
 			push(@tempmicro, $inields[$i]);
 			push(@tempmot, "[".$motields[$i]."]");
-			print "adding pre-motifs number $i\n" if $prinkter ==1;
-			print "tempmot = @tempmot, tempmicro = @tempmicro \n" if $prinkter ==1;
+#			print "adding pre-motifs number $i\n" if $prinkter ==1;
+#			print "tempmot = @tempmot, tempmicro = @tempmicro \n" if $prinkter ==1;
 		}
-		print "tempmot = @tempmot, tempmicro = @tempmicro \n" if $prinkter ==1;
-		print "now pushing ", "[",$microields[$sets[0]]," and ",$microields[$sets[1]],"]\n" if $prinkter ==1;
+#		print "tempmot = @tempmot, tempmicro = @tempmicro \n" if $prinkter ==1;
+#		print "now pushing ", "[",$microields[$sets[0]]," and ",$microields[$sets[1]],"]\n" if $prinkter ==1;
 		my $pusher = "[".$microields[$sets[0]].$microields[$sets[1]]."]";
+#		print "middle is, from @motields -   @sets, number 0 which is  is\n";
+#		print ": $motields[$sets[0]]\n";
 		push (@tempmicro, $pusher);
 		push(@tempmot, "[".$motields[$sets[0]]."]");
-		push (@tempmicro, $inields[$sets[1]]) if $sets[1] != $#microields;
+		push (@tempmicro, $inields[$sets[1]]) if $sets[1] != $#microields && exists $sets[1] && exists $inields[$sets[1]];
 		my $outcoming = -2;
-		print "tempmot = @tempmot, tempmicro = @tempmicro \n" if $prinkter ==1;
-		print "for loop going from ",$sets[1]+1, " ... ", $#microields, "\n" if $prinkter ==1;
+#		print "tempmot = @tempmot, tempmicro = @tempmicro \n" if $prinkter ==1;
+#		print "for loop going from ",$sets[1]+1, " ... ", $#microields, "\n" if $prinkter ==1;
 		for my $i ($sets[1]+1 ... $#microields){
-			print " adding post- i = $i adding: microields= $microields[$i]. motields = $motields[$i]\n" if $prinkter ==1;
-			push(@tempmicro, "[".$microields[$i]."]");
-			push(@tempmicro, $inields[$i]) unless $i == $#microields;
+#			print " adding post- i = $i adding: microields= $microields[$i]. motields = $motields[$i]\n" if $prinkter ==1;
+			push(@tempmicro, "[".$microields[$i]."]") if exists $microields[$i];
+			push(@tempmicro, $inields[$i]) unless $i == $#microields || !exists $inields[$i];
 			push(@tempmot, "[".$motields[$i]."]");
-			print "adding post-motifs number $i\n" if $prinkter ==1;
+#			print "adding post-motifs number $i\n" if $prinkter ==1;
 			$outcoming  = $i;
 		}
+#		print "____________________________________________________________________________\n";
+		$prinkter = 0;
 		$fields[$microsatcord] = join("",@tempmicro);
 		$fields[$motifcord] = join("",@tempmot);
-		print "tempmot = @tempmot, tempmicro = @tempmicro . microsat = $fields[$microsatcord] and motif = $fields[$motifcord] \n" if $prinkter ==1;
+#		print "tempmot = @tempmot, tempmicro = @tempmicro . microsat = $fields[$microsatcord] and motif = $fields[$motifcord] \n" if $prinkter ==1;
 		
 		splice(@interrtypes, $sets[0], 1);
 		$fields[$interrtypecord] = join(",",@interrtypes);
@@ -3300,7 +3344,7 @@
 	else{
 		$line = join("\t", @fields);
 	}
-	print "post merging, the line is $line\n" if $prinkter ==1;
+#	print "post merging, the line is $line\n" if $prinkter ==1;
 	#<STDIN> if $stopper ==1;
 	return $line;
 }
@@ -3411,7 +3455,7 @@
 	while(my $sine = <SEQ>){
 		#<STDIN> if $sine =~ /16349128/;
 		next if $sine !~ /[a-zA-Z0-9]/;
-		print "-" x 150, "\n"  if $printer == 1;
+#		print "-" x 150, "\n"  if $printer == 1;
 		my @sields = split(/\t/,$sine);
 		my @merged = ();
 	
@@ -3435,7 +3479,7 @@
 		#	print "line no : $linecount\n";
 			my @raw_microstring = @{$fmicros{$key}};
 			my %starts = (); my %ends = ();
-			print colored ['yellow'],"unsorted, unfiltered microats = \n" if $printer == 1; foreach (@raw_microstring) {print colored ['blue'],$_,"\n" if $printer == 1;}
+#			print colored ['yellow'],"unsorted, unfiltered microats = \n" if $printer == 1; foreach (@raw_microstring) {print colored ['blue'],$_,"\n" if $printer == 1;}
 			my @microstring=();
 			for my $u (0 ... $#raw_microstring){
 				my @tields = split(/\t/,$raw_microstring[$u]);
@@ -3457,7 +3501,7 @@
 		#	print "line no : $linecount\n";
 			my @raw_microstring = @{$rmicros{$key}};
 			my %starts = (); my %ends = ();
-			print colored ['yellow'],"unsorted, unfiltered microats = \n" if $printer == 1; foreach (@raw_microstring) {print colored ['blue'],$_,"\n" if $printer == 1;}
+#			print colored ['yellow'],"unsorted, unfiltered microats = \n" if $printer == 1; foreach (@raw_microstring) {print colored ['blue'],$_,"\n" if $printer == 1;}
 			my @microstring=();
 			for my $u (0 ... $#raw_microstring){
 				my @tields = split(/\t/,$raw_microstring[$u]);
@@ -3553,7 +3597,7 @@
 	my @mergedSet = ();
 #		print "set of microsats = @microstring \n";
 	my @microstring = map { $_->[0] } sort custom map { [$_, split /\t/ ] } @microstring0; 
-	print "microstring = ", join("\n",@microstring0) ," \n---->\n", join("\n", @microstring),"\n ,,+." if $printer == 1; 
+#	print "microstring = ", join("\n",@microstring0) ," \n---->\n", join("\n", @microstring),"\n ,,+." if $printer == 1; 
 	#<STDIN> if $printer == 1; 
 	my @tempmicrostring = @microstring;
 	foreach my $line (@tempmicrostring){
@@ -3567,7 +3611,7 @@
 	}
 	my $firstflag = 'down';
 	while( my $line =shift(@microstring)){
-		print "-----------\nline = $line \n" if $printer == 1;
+#		print "-----------\nline = $line \n" if $printer == 1;
 		chomp $line;
 		my @fields = split(/\t/,$line);
 		my $start = $fields[$startcord];
@@ -3592,9 +3636,9 @@
 		my $endrank = 1;
 
 		while( ($startflag eq "down") || ($endflag eq "down") ){
-			print "prestart=$prestart, post end =$postend.. seqlen =", length($sequence)," firstflag = $firstflag \n" if $printer == 1;
+#			print "prestart=$prestart, post end =$postend.. seqlen =", length($sequence)," firstflag = $firstflag \n" if $printer == 1;
 			if ( (($prestart < 0) && $firstflag eq "up") || (($postend > length($sequence) && $firstflag eq "up")) ){
-				print "coming to the end of sequence,post end = $postend and sequence length =", length($sequence)," so exiting\n" if $printer == 1;
+#				print "coming to the end of sequence,post end = $postend and sequence length =", length($sequence)," so exiting\n" if $printer == 1;
 				last;
 			}
 			
@@ -3611,7 +3655,7 @@
 							chomp $startmicro;
 							$flag = 'down';
 							$startrank++;
-							print "deleting $microend{$i}[0] and $microstart{$tields[$startcord]}[0]\n" if $printer == 1;
+#							print "deleting $microend{$i}[0] and $microstart{$tields[$startcord]}[0]\n" if $printer == 1;
 							delete $microend{$i};
 							delete $microstart{$tields[$startcord]};
 							$end = $tields[$endcord];
@@ -3629,7 +3673,7 @@
 			if ($endflag eq "down"){	
 
 				for my $i ($start ... $postend){
-					print "$start ----> $i -----> $postend\n" if $printer == 1;
+#					print "$start ----> $i -----> $postend\n" if $printer == 1;
 					if(exists $microstart{$i} ){
 						chomp $microstart{$i}[0];
 						if(exists $compoundhash{$microstart{$i}[0]}) {next;}	
@@ -3640,11 +3684,11 @@
 							$endrank++;
 							chomp $endmicro;
 							$flag = 'down';
-							print "deleting $microend{$tields[$endcord]}[0]\n" if $printer == 1;
+#							print "deleting $microend{$tields[$endcord]}[0]\n" if $printer == 1;
 							
 							delete $microstart{$i} if exists $microstart{$i} ;
 							delete $microend{$tields[$endcord]} if exists $microend{$tields[$endcord]};
-							print "done\n" if $printer == 1;
+#							print "done\n" if $printer == 1;
 							
 							shift @microstring;
 							$end = $tields[$endcord];
@@ -3656,25 +3700,25 @@
 						$flag = 'up';
 						$endflag = 'up';
 					}
-					print "out of the if\n" if $printer == 1;
+#					print "out of the if\n" if $printer == 1;
 				}
-				print "out of the for\n" if $printer == 1;
+#				print "out of the for\n" if $printer == 1;
 
 			}
 #			print "for next turn, flag status: startflag = $startflag and endflag = $endflag \n";
 		} 														#end while( $flag eq "down")
-			print "compoundlines = @compoundlines \n" if $printer == 1;
+#			print "compoundlines = @compoundlines \n" if $printer == 1;
 
 		if (scalar (@compoundlines) == 1){
 			push(@nonmerged, $line);		
 
 		}
 		if (scalar (@compoundlines) > 1){
-			print "FROM CLUSTERER\n"  if $printer == 1;
+#			print "FROM CLUSTERER\n"  if $printer == 1;
 			push(@mergedSet,merge_microsats(@compoundlines, $sequence) );
 		}
 	} #end foreach my $line (@microstring){
-print join("\n",@mergedSet),"<-----mergedSet\n"  if $printer == 1;
+#	print join("\n",@mergedSet),"<-----mergedSet\n"  if $printer == 1;
 #<STDIN> if scalar(@mergedSet) > 0;
 #	print "EXIT: find_clusters\n";
 return (join("_",@nonmerged). "=".join("_",@mergedSet));
@@ -3711,7 +3755,7 @@
 	my %forPopouting = ();
 
 	while( my $line =shift(@merged)){
-		print "\n MErgedline: $line \n" if $printer == 1;
+#		print "\n MErgedline: $line \n" if $printer == 1;
 		chomp $line;
 		my @fields = split(/\t/,$line);
 		my $start = $fields[$startcord];
@@ -3764,7 +3808,7 @@
 			push(@mergedSet,join("\t",@compoundlines) );
 		}
 		else {
-			print "FROM POPOUTER\n" if $printer == 1;
+#			print "FROM POPOUTER\n" if $printer == 1;
 			push(@mergedSet, merge_microsats(@compoundlines, $sequence) );
 		}
 	} 
@@ -3789,7 +3833,7 @@
 	$fields[$startcord] = $start;
 	$fields[$endcord] = $end;
 	$fields[$microsatcord] = reverse_micro($fields[$microsatcord]);
-	print "RETURNIG: ", join("\t",@fields), "\n" if $printer == 1;
+#	print "RETURNIG: ", join("\t",@fields), "\n" if $printer == 1;
 	return join("\t",@fields); 	
 }
 
@@ -3823,7 +3867,7 @@
 	my @fmerged = ();
 	foreach my $micro (@merged) {
 		my @fields = split(/\t/,$micro);
-		if ($fields[3] =~ /chr[0-9a-z]+r/){
+		if ($fields[3] =~ /chr[A-Z0-9a-z]+r/){
 			my $key = join("_",$fields[1], $fields[$startcord], $fields[$endcord]);
 	#		print "adding  ... \n$key\n$micro\n";
 			push(@{$revmerged{$key}}, $micro);
@@ -3853,7 +3897,7 @@
 sub invert_microsat{
 	my $micro = $_[0];
 	chomp $micro;
-	if ($micro =~ /chr[0-9a-z]+r/) { $micro =~  s/chr([0-9a-b]+)r/chr$1/g ;}
+	if ($micro =~ /chr[A-Z0-9a-z]+r/) { $micro =~  s/chr([0-9a-b]+)r/chr$1/g ;}
 	else {  $micro =~  s/chr([0-9a-b]+)/chr$1r/g ; }
 	my $sequence = $_[1];
 	$sequence =~ s/ //g;
@@ -4032,10 +4076,10 @@
 		foreach my $r (@localrs){
 			chomp $r;
 			my @rields = split(/\t/,$r);
-			print "rields = @rields\n" if $printer == 1;
+#			print "rields = @rields\n" if $printer == 1;
 			my $reciprocalstart = length($sequence) - $rields[$endcord] + 1;
 			my $reciprocalend = length($sequence) - $rields[$startcord] + 1;
-			print "reciprocal start = $reciprocalstart = ",length($sequence)," - $rields[$endcord] + 1\n" if $printer == 1;
+#			print "reciprocal start = $reciprocalstart = ",length($sequence)," - $rields[$endcord] + 1\n" if $printer == 1;
 			my $microsat = reverse_micro(all_caps($rields[$microsatcord]));
 			my @localcollection=();
 			for my $i ($reciprocalstart+1 ... $reciprocalend-1){
@@ -4055,11 +4099,11 @@
 			}
 	
 			elsif (scalar(@localcollection) == 1){
-				print "f microsat = $localcollection[0]\n"  if $printer == 1;
+#				print "f microsat = $localcollection[0]\n"  if $printer == 1;
 				my @lields = split(/\t/,$localcollection[0]);
 				$lields[$microsatcord]=all_caps($lields[$microsatcord]);
-				print "comparing: $microsat and $lields[$microsatcord]\n" if $printer == 1;
-				print "coordinates are: $lields[$startcord]-$lields[$endcord] and $reciprocalstart-$reciprocalend\n" if $printer == 1;
+#				print "comparing: $microsat and $lields[$microsatcord]\n" if $printer == 1;
+#				print "coordinates are: $lields[$startcord]-$lields[$endcord] and $reciprocalstart-$reciprocalend\n" if $printer == 1;
 				if ($microsat eq $lields[$microsatcord]){
 					chomp $localcollection[0];
 					print SAME $localcollection[0], "\n";
@@ -4067,19 +4111,19 @@
 				if ($microsat ne $lields[$microsatcord]){
 					chomp $localcollection[0];
 					my $newmicro = microsatChooser(join("\t",@lields), join("\t",@rields), $sequence);
-					print "newmicro = $newmicro\n"  if $printer == 1;
+#					print "newmicro = $newmicro\n"  if $printer == 1;
 					if ($newmicro =~ /[a-zA-Z]/){
 						print SAME $newmicro,"\n";
 					}
 					else{
 					print DIFF join("\t",$localcollection[0],"-->",$rields[$typecord],$reciprocalstart,$reciprocalend, $rields[$microsatcord], reverse_micro($rields[$motifcord]), @rields[$motifcord+1 ... $#rields] ),"\n";
-					print join("\t",$localcollection[0],"-->",$rields[$typecord],$reciprocalstart,$reciprocalend, $rields[$microsatcord], reverse_micro($rields[$motifcord]), @rields[$motifcord+1 ... $#rields] ),"\n" if $printer == 1;
-					print "@rields\n@lields\n" if $printer == 1;
+#					print join("\t",$localcollection[0],"-->",$rields[$typecord],$reciprocalstart,$reciprocalend, $rields[$microsatcord], reverse_micro($rields[$motifcord]), @rields[$motifcord+1 ... $#rields] ),"\n" if $printer == 1;
+#					print "@rields\n@lields\n" if $printer == 1;
 					}
 				}			
 			}
 			else{
-				print "multiple found for $r --> ", join("\t",@localcollection),"\n" if $printer == 1;
+#				print "multiple found for $r --> ", join("\t",@localcollection),"\n" if $printer == 1;
 			}
 		}
 	}	
@@ -4146,13 +4190,13 @@
 	my $r_purestretch = join("",@r_microields);
 
 	if ($fields[$typecord]=~/nucleotide/ && $rields[$typecord]=~/nucleotide/){
-		print "now.. studying $forward\n$reverse\n" if $printer == 1;
+#		print "now.. studying $forward\n$reverse\n" if $printer == 1;
 		if ($fields[$typecord] eq $rields[$typecord]){
-			print "comparing motifs::", all_caps($fields[$motifcord]) ," and ", all_caps(reverse_micro($rields[$motifcord])), "\n" if $printer == 1;
+#			print "comparing motifs::", all_caps($fields[$motifcord]) ," and ", all_caps(reverse_micro($rields[$motifcord])), "\n" if $printer == 1;
 
 			if(motifBYmotif_match(all_caps($fields[$motifcord]), all_caps(reverse_micro($rields[$motifcord]))) == 1){
 				my $subset_answer = isSubset($forward, $reverse, $seqLength);
-				print "subset answer = $subset_answer\n" if $printer == 1;
+#				print "subset answer = $subset_answer\n" if $printer == 1;
 				return $forward if $subset_answer == 1; 
 				return invert_microsat($reverse, $sequence) if $subset_answer == 2; 
 				return $forward if $subset_answer == 0 && length($f_purestretch) >= length($r_purestretch);
@@ -4202,13 +4246,13 @@
 		}
 	}
 	if ($fields[$typecord] eq "compound" && $rields[$typecord] eq "compound"){
-			print "comparing compound motifs::", all_caps($fields[$motifcord]) ," and ", all_caps(reverse_micro($rields[$motifcord])), "\n" if $printer == 1;
+#			print "comparing compound motifs::", all_caps($fields[$motifcord]) ," and ", all_caps(reverse_micro($rields[$motifcord])), "\n" if $printer == 1;
 			if(motifBYmotif_match(all_caps($fields[$motifcord]), all_caps(reverse_micro($rields[$motifcord]))) == 1){
 				my $subset_answer = isSubset($forward, $reverse, $seqLength);
-				print "subset answer = $subset_answer\n" if $printer == 1;
+#				print "subset answer = $subset_answer\n" if $printer == 1;
 				return $forward if $subset_answer == 1; 
 				return invert_microsat($reverse, $sequence) if $subset_answer == 2; 
-				print length($f_purestretch) ,">", length($r_purestretch)," \n" if $printer == 1;
+#				print length($f_purestretch) ,">", length($r_purestretch)," \n" if $printer == 1;
 				return $forward if $subset_answer == 0 && length($f_purestretch) >= length($r_purestretch);
 				return invert_microsat($reverse, $sequence) if $subset_answer == 0 && length($f_purestretch) < length($r_purestretch);
 				if ($subset_answer == 3){
@@ -4243,11 +4287,11 @@
 	}
 	
 	if ($fields[$typecord] eq "compound" && $rields[$typecord] =~ /nucleotide/){
-		print "one compound, one nucleotide\n" if $printer == 1; 
+#		print "one compound, one nucleotide\n" if $printer == 1; 
 		return merge_microsats($forward, invert_microsat($reverse, $sequence), $sequence);
 	}
 	if ($fields[$typecord] =~ /nucleotide/ && $rields[$typecord]eq "compound"){
-		print "one compound, one nucleotide\n" if $printer == 1; 
+#		print "one compound, one nucleotide\n" if $printer == 1; 
 		return merge_microsats($forward, invert_microsat($reverse, $sequence), $sequence);
 	}
 }
@@ -4258,7 +4302,7 @@
 	my $seqLength = $_[2];
 	my $r_start = $seqLength - $rields[$endcord] + 1;
 	my $r_end = $seqLength - $rields[$startcord] + 1;
-	print "we have $fields[$startcord] -> $fields[$endcord] && $r_start -> $r_end\n" if $printer == 1;
+#	print "we have $fields[$startcord] -> $fields[$endcord] && $r_start -> $r_end\n" if $printer == 1;
 	return "0" if $fields[$startcord] == $r_start && $fields[$endcord] == $r_end;
 	return "1" if $fields[$startcord] <= $r_start && $fields[$endcord] >= $r_end;
 	return "2" if $r_start <= $fields[$startcord] && $r_end >= $fields[$endcord];
@@ -4284,7 +4328,7 @@
 		
 		for my $i (0 ... $#sub){
 			my $probe = $sub[$i].$sub[$i];
-			print "probing $probe and $mega[$i]\n" if $printer == 1;
+#			print "probing $probe and $mega[$i]\n" if $printer == 1;
 			if ($probe =~ /$mega[$i]/) {$subresult = 1; }
 			else {$subresult = 0; last; }
 		}
@@ -4416,7 +4460,7 @@
 	#		print $key, "#-#-#-#-#-#-#-#\n";
 		if ($line =~ /([0-9]+)\s+([0-9a-zA-Z]+)\s(chr[0-9a-zA-Z]+)\s([0-9]+)\s([0-9]+)\s/ ) {
 			my $key = join("\t",$1, $2, $3, $4, $5);
-			print "key = $key\n" if $prinkter == 1;
+#			print "key = $key\n" if $prinkter == 1;
 			push (@{$seen{$key}},$line);	
 			$microcounter++;
 		}
@@ -4424,7 +4468,7 @@
 		}
 	}
 #	print "done hash.. linecounter = $linecounter, microcounter = $microcounter and total keys entered = ",scalar(keys %seen),"\n";
-	print INFO  "done hash.. linecounter = $linecounter, microcounter = $microcounter and total keys entered = ",scalar(keys %seen),"\n";
+#	print INFO  "done hash.. linecounter = $linecounter, microcounter = $microcounter and total keys entered = ",scalar(keys %seen),"\n";
 	close SPUT;
 	
 	#----------------------------------------------------------------------------------------------------------------
@@ -4449,7 +4493,7 @@
 	my $keysused = 0;
 	
 	while (my $line = <MATCH>)	{
-		print    colored ['magenta'], $line  if $prinkter == 1;
+#		print    colored ['magenta'], $line  if $prinkter == 1;
 		next if $line !~ /[a-zA-Z0-9]/;
 		chomp $line;	
 		my @fields2 = split(/\t/,$line);
@@ -4458,10 +4502,10 @@
 		if ($line =~ /([0-9]+)\s+([0-9a-zA-Z]+)\s(chr[0-9a-zA-Z]+)\s([0-9]+)\s([0-9]+)\s/ ) {
 			$matchkeysformed++;
 			$key2 = join("\t",$1, $2, $3, $4, $5);
-			print "key = $key2 \n" if $prinkter == 1; 
+#			print "key = $key2 \n" if $prinkter == 1; 
 		}
 		else{
-			print "could not make ker in SEQ : $line\n";
+#			print "could not make ker in SEQ : $line\n";
 			next;
 		}
 		my $sequence = $fields2[$sequencepos];
@@ -4473,7 +4517,7 @@
 			delete $seen{$key2};
 			my @sequencearr = split(/\s*/, $sequence);
 			
-			print "sequencearr = @sequencearr\n" if $prinkter == 1;
+#			print "sequencearr = @sequencearr\n" if $prinkter == 1;
 			
 			my $counter;
 	
@@ -4487,13 +4531,13 @@
 			
 			my @unsorted = ();
 			my %starts = (); my %ends = ();
-			print colored ['yellow'],"unsorted, unfiltered microats = \n" if $prinkter == 1; foreach (@unsorted_raw) {print colored ['blue'],$_,"\n" if $prinkter == 1;}
+#			print colored ['yellow'],"unsorted, unfiltered microats = \n" if $prinkter == 1; foreach (@unsorted_raw) {print colored ['blue'],$_,"\n" if $prinkter == 1;}
 			for my $u (0 ... $#unsorted_raw){
 				my @tields = split(/\t/,$unsorted_raw[$u]);
 				next if exists $starts{$tields[$startcord]} && exists $ends{$tields[$endcord]};
 				push(@unsorted, $unsorted_raw[$u]);
 				$starts{$tields[$startcord]} = $unsorted_raw[$u];
-				print "in starts : $tields[$startcord] -> $unsorted_raw[$u]\n" if $prinkter == 1;
+#				print "in starts : $tields[$startcord] -> $unsorted_raw[$u]\n" if $prinkter == 1;
 			}
 			
 			my $basecounter= 0;
@@ -4517,7 +4561,7 @@
 				
 				if (exists $starts{$basecounter}){
 					my $locus = $starts{$basecounter};
-					print "locus identified = $locus\n" if $prinkter == 1;
+#					print "locus identified = $locus\n" if $prinkter == 1;
 					my @fields3 = split(/\t/,$locus);
 					my $start = $fields3[$startcord];
 					my $end = $fields3[$endcord];
@@ -4529,14 +4573,14 @@
 					my $leftbrackets=();
 					my $rightbrackets = ();
 					my $micro_cpy = $microsat;
-					print "microsat = $microsat\n" if $prinkter == 1;
+#					print "microsat = $microsat\n" if $prinkter == 1;
 					while($microsat =~ m/\[/g) {push(@leftbracketpos, (pos($microsat)));  $leftbrackets = join("__",@leftbracketpos);$bracket_picker='yes';}
 					while($microsat =~ m/\]/g) {push(@rightbracketpos, (pos($microsat))); $rightbrackets = join("__",@rightbracketpos);}
 					$microsat =~ s/[\[\]\-\*]//g;
-					print "microsat = $microsat\n" if $prinkter == 1;
+#					print "microsat = $microsat\n" if $prinkter == 1;
 					my $human_search = join '-*', split //, $microsat;
 					my $temp = substr($sequence, $poscounter-1);
-					print "with poscounter = $poscounter\n" if $prinkter == 1;
+#					print "with poscounter = $poscounter\n" if $prinkter == 1;
 					my $search_result = ();
 					my $posnow  = ();
 					while ($temp =~ /($human_search)/gi){
@@ -4725,9 +4769,9 @@
 			if ($line =~ /([0-9]+)\s+($focalspec)\s(chr[0-9a-zA-Z]+)\s([0-9]+)\s([0-9]+)/ ) {
 				$key = join("\t",$1, $2,  $4, $5);
 	
-					print "key =  : $key\n" if $prinkter == 1;
+#					print "key =  : $key\n" if $prinkter == 1;
 				
-				print $line if $prinkter == 1;
+#				print $line if $prinkter == 1;
 				push (@{$single_hash{$key}},$line);
 			}
 			else{
@@ -4736,10 +4780,10 @@
 		}
 		push @hasharr, {%single_hash};
 	#	print "@{$single_hash{$key}} \n";
-		print "done $path: counter = $counter\n" if $prinkter == 1;
+#		print "done $path: counter = $counter\n" if $prinkter == 1;
 		close READ;
 	}	
-	#print "Done hashes\n";
+#	print "Done hashes\n";
 	#----------------------------------------------------------------------------------------------------------------
 	my $question=();
 	#----------------------------------------------------------------------------------------------------------------
@@ -4754,22 +4798,24 @@
 	my %contigpath=();
 	my $dotcounter = 0;
 	while (my $line = <BO>){
-		print "x" x 60, "\n" if $prinkter == 1;
+#		print "x" x 60, "\n" if $prinkter == 1;
 		$dotcounter++;
 		
 	
 		
-		#print "." if $dotcounter % 100 ==0;
-		#print "\n" if $dotcounter % 5000 ==0;
+#		print "." if $dotcounter % 100 ==0;
+#		print "\n" if $dotcounter % 5000 ==0;
 		next if $line !~ /^[0-9]+/;
-		print $line if $prinkter == 1;
+#		print $line if $prinkter == 1;
 		chomp $line;	
 		my @fields2 = split(/\t/,$line);
 		my $key2 = ();
 		if ($line =~ /([0-9]+)\s+($focalspec)\s(chr[0-9a-zA-Z]+)\s([0-9]+)\s([0-9]+)/ ) {
 			$key2 = join("\t",$1, $2,  $4, $5);
 		}
-		else {print "seq line $line incompatible\n" if $prinkter == 1; next;}
+		else {
+#			print "seq line $line incompatible\n" if $prinkter == 1; 
+			next;}
 		
 		
 		
@@ -4809,22 +4855,22 @@
 		my @currentcontigchrs=();
 		
 		for my $i (0 ... $#tags){
-			print "searching for : if exists  hasharr: $i : $tags[$i] : $key2 \n" if $prinkter == 1;
+#			print "searching for : if exists  hasharr: $i : $tags[$i] : $key2 \n" if $prinkter == 1;
 			my @temparr = (); 
 	
 			if (exists $hasharr[$i]{$key2}){
 				@temparr =  @{$hasharr[$i]{$key2}};
 				
-				print "in line $line, trying to hunt for: $tags[$i]\\s([a-zA-Z0-9])+\\s([0-9]+)\\s([0-9]+) \n" if $prinkter == 1;
+#				print "in line $line, trying to hunt for: $tags[$i]\\s([a-zA-Z0-9])+\\s([0-9]+)\\s([0-9]+) \n" if $prinkter == 1;
 				$line =~ /$tags[$i]\s([a-zA-Z0-9]+)\s([0-9]+)\s([0-9]+)/;
-				print "org = $tags[$i], and chr = $1, start = $2, end =$3 \n" if $prinkter == 1; 
+#				print "org = $tags[$i], and chr = $1, start = $2, end =$3 \n" if $prinkter == 1; 
 				my $startkey = $1."_".$2; print "adding start key for this alignmebt block: $startkey to species $tags[$i]\n" if $prinkter == 1;
 				my $endkey = $1."_".$3; print "adding end key for this alignmebt block: $endkey to species $tags[$i]\n" if $prinkter == 1;
 				$contigstarts[$i]{$startkey}= $key2;
 				$contigends[$i]{$endkey}= $key2;
-				print "confirming existance: \n" if $prinkter == 1;
-				print "present \n" if exists $contigends[$i]{$endkey} && $prinkter == 1;
-				print "absent \n" if !exists $contigends[$i]{$endkey} && $prinkter == 1;			
+#				print "confirming existance: \n" if $prinkter == 1;
+#				print "present \n" if exists $contigends[$i]{$endkey} && $prinkter == 1;
+#				print "absent \n" if !exists $contigends[$i]{$endkey} && $prinkter == 1;			
 				$currentcontigchrs[$i]=$1;
 				$currentcontigstarts[$i]=$2;
 				$currentcontigends[$i]=$3;
@@ -4846,7 +4892,7 @@
 	#		print "---------------------------\n";
 	
 			foreach my $templine (@temparr){
-				print "templine = $templine\n" if $prinkter == 1;
+#				print "templine = $templine\n" if $prinkter == 1;
 				my @tields = split(/\t/,$templine);
 				my $start = $tields[$startcord]; # - $tields[$gapcord];
 				my $end = $tields[$endcord]; #- $tields[$gapcord];
@@ -4870,7 +4916,7 @@
 			
 			foreach my $cluster (@clusters) {
 				my @constituenst = split(/,/,$cluster);
-				print "clusters returned: @constituenst\n" if $prinkter == 1;
+#				print "clusters returned: @constituenst\n" if $prinkter == 1;
 			}
 	
 			@string = split("_",stringPainter(join("_",@string),$foundclusters));
@@ -4879,13 +4925,13 @@
 		}
 		next if $stopper == 1;
 	
-		print colored ['blue'],"FINAL:\n" if $prinkter == 1;
+#		print colored ['blue'],"FINAL:\n" if $prinkter == 1;
 		my $finalclusters  =findClusters(join("!",@string), 1);
-		print colored ['blue'],"----------------------\n" if $prinkter == 1;
+#		print colored ['blue'],"----------------------\n" if $prinkter == 1;
 		my @clusters = split(/,/,$finalclusters);
-			print "@string\n" if $prinkter == 1;
-			print "@clusters\n" if $prinkter == 1;
-			print "------------------------------------------------------------------\n" if $prinkter == 1;
+#			print "@string\n" if $prinkter == 1;
+#			print "@clusters\n" if $prinkter == 1;
+#			print "------------------------------------------------------------------\n" if $prinkter == 1;
 		
 		my $clustno = 0;
 		
@@ -4921,7 +4967,7 @@
 			my $extremeend = largest_number(@ends);
 			push(@contigClusterstarts, $extremestart);
 			push(@contigClusterends, $extremeend);
-			print "cluster starts from $extremestart and ends at $extremeend \n" if $prinkter == 1 ;
+#			print "cluster starts from $extremestart and ends at $extremeend \n" if $prinkter == 1 ;
 					
 			foreach my $clustparts (@localclust){
 				my @pattern = split(/:/, $clustparts);
@@ -4929,7 +4975,7 @@
 				push (@result, $starthash[$pattern[0]]{$pattern[1]});
 			}
 			push(@contigcluster, join("\t", @result));
-			print join("\t", @result),"<-result \n" if $prinkter == 1 ;
+#			print join("\t", @result),"<-result \n" if $prinkter == 1 ;
 		}	
 		
 	
@@ -4940,7 +4986,7 @@
 		$contigclustersFirstStartOnly{$key2}=$firstclusterstart;	
 		$contigclustersLastEndOnly{$key2} = $lastclusterend;
 		$contigclusters{$key2}=[ @contigcluster ];
-		print "currentcontigchr are @currentcontigchrs , firstclusterstart = $firstclusterstart, lastclusterend = $lastclusterend\n " if $prinkter == 1;
+#		print "currentcontigchr are @currentcontigchrs , firstclusterstart = $firstclusterstart, lastclusterend = $lastclusterend\n " if $prinkter == 1;
 		for my $i (0 ... $#tags){
 			#1 check if there exists adjacent alignment block wrt coordinates of this species.
 			next if $currentcontigchrs[$i] eq "0"; #1 this means that there are no microsats in this species in this alignment block.. 
@@ -4951,7 +4997,7 @@
 			#3 adjacent alignment block is found lateron, the exact distance between the potentially
 			#4 adjacent microsat clusters can be found here. the exact start coordinate will be used
 			#5 immediately below.
-			print "full sequence = $origsequences[$i] and its length = ",length($origsequences[$i])," \n" if $prinkter == 1;		
+	#		print "full sequence = $origsequences[$i] and its length = ",length($origsequences[$i])," \n" if $prinkter == 1;		
 			
 			my $species_startsubstring = substr($origsequences[$i], 0, $firstclusterstart);
 			my $species_endsubstring = ();
@@ -4959,8 +5005,8 @@
 			if (length ($origsequences[$i]) <= $lastclusterend+1){ $species_endsubstring = "";}
 			else{  $species_endsubstring = substr($origsequences[$i], $lastclusterend+1);}
 			
-			print "\nnot defined species_endsubstring...\n"  if !defined $species_endsubstring && $prinkter == 1;
-			print "for species: $tags[$i]: \n" if $prinkter == 1;
+#			print "\nnot defined species_endsubstring...\n"  if !defined $species_endsubstring && $prinkter == 1;
+#			print "for species: $tags[$i]: \n" if $prinkter == 1;
 			
 			$species_startsubstring =~ s/-| //g;
 			$species_endsubstring =~ s/-| //g;
@@ -4969,11 +5015,11 @@
 	
 	
 	
-			print "species_startsubstring = $species_startsubstring, and its length =",length($species_startsubstring)," \n" if $prinkter == 1;
-			print "species_endsubstring = $species_endsubstring, and its length =",length($species_endsubstring)," \n" if $prinkter == 1;
-			print "attaching to contigclustersLastEndOnly: $key2: $i\n" if $prinkter == 1;	
+#			print "species_startsubstring = $species_startsubstring, and its length =",length($species_startsubstring)," \n" if $prinkter == 1;
+#			print "species_endsubstring = $species_endsubstring, and its length =",length($species_endsubstring)," \n" if $prinkter == 1;
+#			print "attaching to contigclustersLastEndOnly: $key2: $i\n" if $prinkter == 1;	
 			
-			print "just confirming: $contigclustersLastEndLengthOnly{$key2}[$i] \n" if $prinkter == 1;
+#			print "just confirming: $contigclustersLastEndLengthOnly{$key2}[$i] \n" if $prinkter == 1;
 	
 		}
 	
@@ -5001,7 +5047,7 @@
 	my $existing_removed=0;
 	
 	while (my $line = <BO>){
-		print "x" x 60, "\n" if $prinkter == 1;
+#		print "x" x 60, "\n" if $prinkter == 1;
 		next if $line !~ /^[0-9]+/;
 		#print $line;
 		chomp $line;	
@@ -5012,7 +5058,7 @@
 		}
 		
 		else {print "seq line $line incompatible\n"; next;}
-		print "KEY =  : $key2\n" if $prinkter == 1;
+#		print "KEY =  : $key2\n" if $prinkter == 1;
 	
 	
 		my @currentcontigstarts=();
@@ -5024,9 +5070,9 @@
 			@clusters =  @{$contigclusters{$key2}};
 			@clusterscopy=@clusters;
 			for my $i (0 ... $#tags){
-				print "in line $line, trying to hunt for: $tags[$i]\\s([a-zA-Z0-9])+\\s([0-9]+)\\s([0-9]+) \n" if $prinkter == 1;
+	#			print "in line $line, trying to hunt for: $tags[$i]\\s([a-zA-Z0-9])+\\s([0-9]+)\\s([0-9]+) \n" if $prinkter == 1;
 				if ($line =~ /$tags[$i]\s([a-zA-Z0-9]+)\s([0-9]+)\s([0-9]+)/){
-					print "org = $tags[$i], and chr = $1, start = $2, end =$3 \n" if $prinkter == 1; 
+	#				print "org = $tags[$i], and chr = $1, start = $2, end =$3 \n" if $prinkter == 1; 
 					my $startkey = $1."_".$2; #print "adding start key for this alignmebt block: $startkey to species $tags[$i]\n" if $prinkter == 1;
 					my $endkey = $1."_".$3; #print "adding end key for this alignmebt block: $endkey to species $tags[$i]\n" if $prinkter == 1;
 					$currentcontigchrs[$i]=$1;
@@ -5035,7 +5081,7 @@
 				}
 				else {
 					$currentcontigchrs[$i] = 0;
-					print "no microsat clusters for $key2\n" if $prinkter == 1; next;	
+	#				print "no microsat clusters for $key2\n" if $prinkter == 1; next;	
 				}
 			}
 		} # print "exists: @{$hasharr[$i]{$key2}}[0]\n"}
@@ -5050,7 +5096,7 @@
 		
 		next if scalar @currentcontigchrs == 0;
 		
-		print "contigchrs= @currentcontigchrs \n" if $prinkter == 1;
+	#	print "contigchrs= @currentcontigchrs \n" if $prinkter == 1;
 		my %visitedcontigs=();
 	
 		for my $i (0 ... $#tags){
@@ -5067,38 +5113,38 @@
 			my $lastclusterend = $contigclustersLastEndOnly{$key2};
 					
 			my $key3 = $currentcontigchrs[$i]."_".($currentcontigstarts[$i]);
-			print  "check if exists $key3 in  contigends for $i\n" if $prinkter == 1; 
+#			print  "check if exists $key3 in  contigends for $i\n" if $prinkter == 1; 
 			
 			if (exists($contigends[$i]{$key3}) && !exists $visitedcontigs{$contigends[$i]{$key3}}){
 				$visitedcontigs{$contigends[$i]{$key3}} = $contigends[$i]{$key3}; #1 this array keeps track of adjacent contigs that we have already visited, thus saving computational time and potential redundancies#
-				print "just checking the hash visitedcontigs: ",$visitedcontigs{$contigends[$i]{$key3}} ,"\n" if $prinkter == 1;
+	#			print "just checking the hash visitedcontigs: ",$visitedcontigs{$contigends[$i]{$key3}} ,"\n" if $prinkter == 1;
 	
 				#1 extract coordinates of the last cluster of this found alignment block
-				print "key of the found alignment block = ", $contigends[$i]{$key3},"\n" if $prinkter == 1;
-				print "we are trying to mine: contigclustersAllLastEndLengthOnly_raw: $contigends[$i]{$key3}: $i \n" if $prinkter == 1;
-				print "EXISTS\n" if exists $contigclusters{$contigends[$i]{$key3}} && $prinkter == 1;
-				print "does NOT EXIST\n" if !exists $contigclusters{$contigends[$i]{$key3}} && $prinkter == 1;
+#				print "key of the found alignment block = ", $contigends[$i]{$key3},"\n" if $prinkter == 1;
+	#			print "we are trying to mine: contigclustersAllLastEndLengthOnly_raw: $contigends[$i]{$key3}: $i \n" if $prinkter == 1;
+	#			print "EXISTS\n" if exists $contigclusters{$contigends[$i]{$key3}} && $prinkter == 1;
+	#			print "does NOT EXIST\n" if !exists $contigclusters{$contigends[$i]{$key3}} && $prinkter == 1;
 				my @contigclustersAllFirstStartLengthOnly_raw=@{$contigclustersFirstStartLengthOnly{$key2}};
 				my @contigclustersAllLastEndLengthOnly_raw=@{$contigclustersLastEndLengthOnly{$contigends[$i]{$key3}}};
 				my @contigclustersAllFirstStartLengthOnly=(); my @contigclustersAllLastEndLengthOnly=();
 				
 				for my $val (0 ... $#contigclustersAllFirstStartLengthOnly_raw){
-					print "val = $val\n" if $prinkter == 1;
+	#				print "val = $val\n" if $prinkter == 1;
 					if (defined $contigclustersAllFirstStartLengthOnly_raw[$val]){
 						push(@contigclustersAllFirstStartLengthOnly, $contigclustersAllFirstStartLengthOnly_raw[$val]) if $contigclustersAllFirstStartLengthOnly_raw[$val] =~ /[0-9]+/;
 					}
 				}
-				print "-----\n" if $prinkter == 1;
+	#			print "-----\n" if $prinkter == 1;
 				for my $val (0 ... $#contigclustersAllLastEndLengthOnly_raw){
-					print "val = $val\n" if $prinkter == 1;
+	#				print "val = $val\n" if $prinkter == 1;
 					if (defined $contigclustersAllLastEndLengthOnly_raw[$val]){
 						push(@contigclustersAllLastEndLengthOnly, $contigclustersAllLastEndLengthOnly_raw[$val]) if  $contigclustersAllLastEndLengthOnly_raw[$val] =~ /[0-9]+/;
 					}
 				}
 				
 				
-				print "our two arrays are: starts = <@contigclustersAllFirstStartLengthOnly> ......... and ends = <@contigclustersAllLastEndLengthOnly>\n" if $prinkter == 1;
-				print "the last cluster's end in that one is: ",smallest_number(@contigclustersAllFirstStartLengthOnly) + smallest_number(@contigclustersAllLastEndLengthOnly)," = ", smallest_number(@contigclustersAllFirstStartLengthOnly)," + ",smallest_number(@contigclustersAllLastEndLengthOnly),"\n" if $prinkter == 1; 
+	#			print "our two arrays are: starts = <@contigclustersAllFirstStartLengthOnly> ......... and ends = <@contigclustersAllLastEndLengthOnly>\n" if $prinkter == 1;
+	#			print "the last cluster's end in that one is: ",smallest_number(@contigclustersAllFirstStartLengthOnly) + smallest_number(@contigclustersAllLastEndLengthOnly)," = ", smallest_number(@contigclustersAllFirstStartLengthOnly)," + ",smallest_number(@contigclustersAllLastEndLengthOnly),"\n" if $prinkter == 1; 
 				
 	#			if ($contigclustersFirstStartLengthOnly{$key2}[$i] + $contigclustersLastEndLengthOnly{$contigends[$i]{$key3}}[$i] < 50){
 				if (smallest_number(@contigclustersAllFirstStartLengthOnly) + smallest_number(@contigclustersAllLastEndLengthOnly) < $CLUSTER_DIST){
@@ -5119,7 +5165,7 @@
 	#					print " clusteringpaths $key2 -> $contigends[$i]{$key3}\n";
 						$founkeys_enteredcount-- if exists $foundkeys{$key2};
 						$existing_removed++  if exists $foundkeys{$key2};
-						print "$key2->",@{$contigclusters{$key2}},"->>$foundkeys{$key2}\n" if exists $foundkeys{$key2} && $prinkter == 1;
+#						print "$key2->",@{$contigclusters{$key2}},"->>$foundkeys{$key2}\n" if exists $foundkeys{$key2} && $prinkter == 1;
 						delete $foundkeys{$key2} if exists $foundkeys{$key2};
 						$complete_transfered++;
 					}
@@ -5165,13 +5211,13 @@
 	my $pathed_count=0; 
 	foreach my $key2 (keys %foundkeys){
 		#print "x" x 60, "\n";
-		print "x" if $dotcounter % 100 ==0;
-		print "\n" if $dotcounter % 5000 ==0;
+#		print "x" if $dotcounter % 100 ==0;
+#		print "\n" if $dotcounter % 5000 ==0;
 		$founkeys_count++;
 		my $key = $key2;
-		print "$key2 -> $clusteringpaths{$key2}\n" if $prinkter == 1;
+#		print "$key2 -> $clusteringpaths{$key2}\n" if $prinkter == 1;
 		if ($clusteringpaths{$key} eq $key){
-			print "printing hit the alignment block immediately... no path needed\n" if $prinkter == 1;
+#			print "printing hit the alignment block immediately... no path needed\n" if $prinkter == 1;
 			$nopath_count++;
 			delete $foundkeys{$key2};
 			print ORTH join ("\n",@{$contigclusters{$key2}}),"\n";
@@ -5180,43 +5226,43 @@
 			my @pool=();
 			my $key3=();
 			$pathed_count++;
-			print "going reverse... clusteringpathsRev, $key = $clusteringpathsRev{$key}\n" if exists $clusteringpathsRev{$key} && $prinkter == 1;
-			print "going reverse... clusteringpathsRev  $key does not exist\n" if !exists $clusteringpathsRev{$key} && $prinkter == 1;
+#			print "going reverse... clusteringpathsRev, $key = $clusteringpathsRev{$key}\n" if exists $clusteringpathsRev{$key} && $prinkter == 1;
+#			print "going reverse... clusteringpathsRev  $key does not exist\n" if !exists $clusteringpathsRev{$key} && $prinkter == 1;
 			if ($clusteringpathsRev{$key} eq "0") {
  				next;
 			}
 			else{
 				my $yek3 = $clusteringpathsRev{$key};
 				my $yek = $key;
-				print "caught in the middle of a path, now goin down from $yek to $yek3, which is $clusteringpathsRev{$key} \n" if $prinkter == 1;
+#				print "caught in the middle of a path, now goin down from $yek to $yek3, which is $clusteringpathsRev{$key} \n" if $prinkter == 1;
 				while ($yek3 ne "0"){
-					print "$yek->$yek3," if $prinkter == 1;
+#					print "$yek->$yek3," if $prinkter == 1;
 					$yek = $yek3;
 					$yek3 = $clusteringpathsRev{$yek};
 				}
-				print "\nfinally reached the end of path: $yek3, and the next in line is $yek, and its up-route is  $clusteringpaths{$yek}\n" if $prinkter == 1; 
+#				print "\nfinally reached the end of path: $yek3, and the next in line is $yek, and its up-route is  $clusteringpaths{$yek}\n" if $prinkter == 1; 
 				$key3 = $clusteringpaths{$yek};
 				$key = $yek;
 			}
 		
-			print "now that we are at bottom of the path, lets start climbing up again\n" if $prinkter == 1;
+#			print "now that we are at bottom of the path, lets start climbing up again\n" if $prinkter == 1;
 			
 			while($key ne $key3){
-				print "KEEY $key->$key3\n" if $prinkter == 1;
-				print "our contigcluster = @{$contigclusters{$key}}\n----------\n" if $prinkter == 1;
+#				print "KEEY $key->$key3\n" if $prinkter == 1;
+#				print "our contigcluster = @{$contigclusters{$key}}\n----------\n" if $prinkter == 1;
 				
 				if (scalar(@{$contigclusters{$key}}) > 0) {push @pool, @{$contigclusters{$key}}; print "now pool = @pool\n" if $prinkter == 1;}
 				delete $foundkeys{$key3};
 				$key=$key3;
 				$key3=$clusteringpaths{$key};
 			}
-			print "\nfinally, adding the first element of path: @{$contigclusters{$key}}\n AND printing the contents:\n" if $prinkter == 1;
+#			print "\nfinally, adding the first element of path: @{$contigclusters{$key}}\n AND printing the contents:\n" if $prinkter == 1;
 			my @firstcontig= @{$contigclusters{$key}};
 			delete $foundkeys{$key2} if exists $foundkeys{$key2} ;
 			delete $foundkeys{$key} if exists $foundkeys{$key};
 	
 			unshift @pool, pop @firstcontig;
-			print join("\t",@pool),"\n" if $prinkter == 1;
+#			print join("\t",@pool),"\n" if $prinkter == 1;
 			print ORTH join ("\n",@firstcontig),"\n" if scalar(@firstcontig) > 0;
 			print ORTH join ("\t",@pool),"\n";		
 		#	join();
@@ -5224,7 +5270,7 @@
 	
 	}
 	#close (NORTH);
-	print "founkeys_entered =$founkeys_enteredcount, plain_transfered=$plain_transfered,existing_removed=$existing_removed,founkeys_count =$founkeys_count, nopath_count =$nopath_count, transfered = $transfered, complete_transfered = $complete_transfered, totalcount = $totalcount, pathed=$pathed_count\n" if $prinkter == 1;
+#	print "founkeys_entered =$founkeys_enteredcount, plain_transfered=$plain_transfered,existing_removed=$existing_removed,founkeys_count =$founkeys_count, nopath_count =$nopath_count, transfered = $transfered, complete_transfered = $complete_transfered, totalcount = $totalcount, pathed=$pathed_count\n" if $prinkter == 1;
 	close (BO);
 	close (ORTH);
 	close (OUTP);
--- a/tools/regVariation/multispecies_MicrosatDataGenerator_interrupted_GALAXY.xml	Wed Feb 09 16:49:43 2011 -0500
+++ b/tools/regVariation/multispecies_MicrosatDataGenerator_interrupted_GALAXY.xml	Thu Feb 10 10:33:08 2011 -0500
@@ -1,4 +1,4 @@
-<tool id="multispecies_orthologous_microsats" name="Extract orthologous microsatellites" version="1.0.0">
+<tool id="multispecies_orthologous_microsats" name="Extract orthologous microsatellites" version="1.0.1"><description> for multiple (>2) species alignments</description><command interpreter="perl">
     multispecies_MicrosatDataGenerator_interrupted_GALAXY.pl
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            commit/galaxy-central: natefoo: Fix for MySQL index lengths in migration script 62. Thanks Leandro Hermida.
                        
                        
by Bitbucket 09 Feb '11
                    by Bitbucket 09 Feb '11
09 Feb '11
                    
                        1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/72cbd1ed1a81/
changeset:   r5036:72cbd1ed1a81
user:        natefoo
date:        2011-02-09 22:49:43
summary:     Fix for MySQL index lengths in migration script 62.  Thanks Leandro Hermida.
affected #:  1 file (1 byte)
--- a/lib/galaxy/model/migrate/versions/0062_user_openid_table.py	Wed Feb 09 16:46:30 2011 -0500
+++ b/lib/galaxy/model/migrate/versions/0062_user_openid_table.py	Wed Feb 09 16:49:43 2011 -0500
@@ -40,7 +40,7 @@
 
     ix_name = 'ix_galaxy_user_openid_openid'
     if migrate_engine.name == 'mysql':
-        i = "ALTER TABLE galaxy_user_openid ADD UNIQUE INDEX ( openid( 1000 ) )"
+        i = "ALTER TABLE galaxy_user_openid ADD UNIQUE INDEX ( openid( 255 ) )"
         db_session.execute( i )
     else:
         i = Index( ix_name, UserOpenID_table.c.openid, unique=True )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0