diff --git a/lib/galaxy/tools/dynamic_options.py b/lib/galaxy/tools/dynamic_options.py index 21ef6d075c7..7e0063b977b 100644 --- a/lib/galaxy/tools/dynamic_options.py +++ b/lib/galaxy/tools/dynamic_options.py @@ -6,13 +6,31 @@ log = logging.getLogger(__name__) class DynamicOptions( object ): """Handles dynamically generated SelectToolParameter options""" def __init__( self, elem ): - self.data_ref = elem.get( 'data_ref', None) - self.param_ref = elem.get( 'param_ref', None) - self.from_file = elem.get( 'from_file', None ) - self.func = elem.get( 'func', None ) - assert self.func is not None, "Value for option generator function not found" - self.func_params = elem.findall( 'func_param' ) + # FIXME: Pushing these things in as options ends up being pretty ugly. + # We should find a way to make this work through the validation mechanism. self.no_data_option = ( 'No data available for this build', 'None', True ) + self.from_file = elem.get( 'from_file', None ) + if elem.tag == 'select_options': + self.data_ref = elem.get( 'data_ref', None ) + self.param_ref = elem.get( 'param_ref', None ) + self.func = elem.get( 'func', None ) + assert self.func is not None, "Value for option generator function not found" + self.func_params = elem.findall( 'func_param' ) + else: #elem.tag =='options' + self.name_col = int( elem.get( 'name_col', None ) ) + assert self.name_col is not None, "Value for option generator name_col not found" + self.value_col = int( elem.get( 'value_col', None ) ) + assert self.value_col is not None, "Value for option generator value_col not found" + self.filters = elem.findall( 'filter' ) + for filter in self.filters: + filter_type = filter.get( 'type', None ) + assert filter_type is not None, "type attribute missing from filter" + filter_type = filter_type.strip() + if filter_type == 'data_meta': + # We're using metadata information from self.data_ref + self.data_ref = filter.get( 'data_ref', None ) + #FIXME: this attr is used only by microbial import, so shouldn't be at this level + self.microbe_info = None def get_dataset( self, trans, other_values ): # No value indicates a configuration error, the named DataToolParameter must preceed this parameter in the tool config assert self.data_ref in other_values, "Value for associated DataToolParameter not found" @@ -25,98 +43,100 @@ class DynamicOptions( object ): """ return None return dataset - def get_param_ref( self, trans, other_values ): + def get_param_value( self, trans, other_values ): if self.param_ref is None: return None - else: - assert self.param_ref in other_values, "Value for associated parameter not found" - return other_values[ self.param_ref ] + assert self.param_ref in other_values, "Value for associated parameter %s not found" %self.param_ref.name + return other_values[ self.param_ref ] + def load_from_file( self, key=None, value=None, col=None, sep='\t' ): + """key: build, value: dbkey, col: 0""" + options = [] + d = {} + tool_type = None + + for line in open( self.from_file ): + line = line.rstrip( '\r\n' ) + if line and not line.startswith( '#' ): + try: + fields = line.split( sep ) + if key == 'build': + if col is not None: + if fields[ col ].strip() == 'align': # tool is: Extract blastz alignments1 + tool_type = 'blastz' + try: d[ fields[ self.name_col ] ].append( fields[ self.value_col ] ) + except: d[ fields[ self.name_col ] ] = [ fields[ self.value_col ] ] + else: # tool is one of: aggregate_scores_in_intervals2, phastOdds_for_intervals, random_intervals1 + tool_type = 'intervals' + if not fields[ col ] in d: + d[ fields[ col ] ] = [] + d[ fields[ col ] ].append( (fields[ self.name_col ], fields[ self.value_col ]) ) + else: + options.append( (fields[ self.name_col ], fields[ self.value_col ], False) ) + elif key == 'some future key': + pass + else: # tool is one of: axt_to_concat_fasta, axt_to_fasta, axt_to_lav_1 + options.append( (fields[ self.name_col ], fields[ self.value_col ], False) ) + except: continue + if tool_type == 'blastz': + # FIXME: We need a database of descriptive names corresponding to dbkeys. + # We need to resolve the musMusX <--> mmX confusion + if value[ 0:2 ] == "mm": value = value.replace( 'mm', 'musMus' ) + if value[ 0:2 ] == "rn": value = value.replace( 'rn', 'ratNor' ) + if value in d: + for val in d[ value ]: + options.append( ( val, val, False ) ) + elif tool_type == 'intervals': + if value in d: + for (key, val) in d[ value ]: + options.append( (key, val, False) ) + else: # tool_type is some future tool type + pass + if key == 'build' and not options: return [ ('unspecified', '?', True ) ] + return options + def get_options( self, trans, other_values ): + """ + Used by the following tools so far... + random_intervals1 - associated data file: /depot/data2/galaxy/regions.loc + phastOdds_for_intervals - associated data file: /depot/data2/galaxy/phastOdds.loc + aggregate_scores_in_intervals2 - associated data file: /depot/data2/galaxy/binned_scores.loc + axt_to_concat_fasta - associated data file: static/ucsc/builds.txt + axt_to_fasta - associated data file: static/ucsc/builds.txt + axt_to_lav_1 - - associated data file: static/ucsc/builds.txt + Extract blastz alignments1 - associated data file: /depot/data2/galaxy/alignseq.loc + """ + # Check for filters first and process any that we find + for filter in self.filters: + filter_type = filter.get( 'type', None ) + assert filter_type is not None, "type attribute missing from filter" + filter_type = filter_type.strip() + if filter_type == 'data_meta': + # We're using metadata information from self.data_ref + dataset = self.get_dataset( trans, other_values ) + if dataset is None: + return options + key = filter.get( 'key', None ) + assert key is not None, "key attribute missing from data_meta filter" + key = key.strip() + value = filter.get( 'value', None ) + assert value is not None, "value attribute missing from data_meta filter" + value = value.strip() + col = filter.get( 'col', None ) + assert col is not None, "col attribute missing from data_meta filter" + col = int( col.strip() ) + if key == 'build': # value must be 'dbkey' + value = eval( '''dataset.%s''' %value ) + elif key == 'some other future key': + pass + return self.load_from_file( key=key, value=value, col=col, sep='\t' ) + elif filter_type == 'some other future type': + pass + # We must not have found a filter, so we'll generate the list generically + return self.load_from_file() """ TODO: the following functions should be generalized so that they are not specific to certain tools (e.g., encode). We may need to standardize data file formats to be able to do this. Comments in the functions show the tools that use them along with associated data files, if any - """ - def get_options_for_build( self, trans, other_values ): - """ - Used by the following tools: - random_intervals1 - associated data file: /depot/data2/galaxy/regions.loc - phastOdds_for_intervals - associated data file: /depot/data2/galaxy/phastOdds.loc - aggregate_scores_in_intervals2 - associated data file: /depot/data2/galaxy/binned_scores.loc - """ - options = [] - dataset = self.get_dataset( trans, other_values ) - if dataset is None: - return options - def load_from_file_for_build(): - d = {} - for line in open( self.from_file ): - line = line.rstrip( '\r\n' ) - if line and not line.startswith( '#' ): - try: - fields = line.split( "\t" ) - if not fields[0] in d: - d[ fields[0] ] = [] - d[ fields[0] ].append( (fields[1], fields[2]) ) - except: - continue - return d - d = load_from_file_for_build() - if dataset.dbkey in d: - for (key, val) in d[ dataset.dbkey ]: - options.append( (key, val, False) ) - return options - - def get_options_for_build_2( self, trans, other_values ): - """ - Used by the following tools: - axt_to_concat_fasta - associated data file: static/ucsc/builds.txt - axt_to_fasta - associated data file: static/ucsc/builds.txt - axt_to_lav_1 - - associated data file: static/ucsc/builds.txt - """ - def load_from_file_for_build_2(): - options = [] - for line in open( self.from_file ): - line = line.rstrip( '\r\n' ) - if line and not line.startswith( '#' ): - try: - fields = line.split( '\t' ) - options.append( (fields[1], fields[0], False) ) - except: continue - if len( options ) < 1: - return [('unspecified', '?', True )] - return options - return load_from_file_for_build_2() - - def get_options_for_build_3( self, trans, other_values ): - # FIXME: We need a database of descriptive names corresponding to dbkeys. - # We need to resolve the musMusX <--> mmX confusion - """ - Used by the following tools: - Extract blastz alignments1 - associated data file: /depot/data2/galaxy/alignseq.loc - """ - options = [] - dataset = self.get_dataset( trans, other_values ) - if dataset is None: - return options - def load_from_file_for_build_3(): - d = {} - for line in open( self.from_file ): - line = line.rstrip( '\r\n' ) - if line and not line.startswith( '#' ): - fields = line.split() - if fields[0].strip() == "align": - try: d[ fields[1] ].append( fields[2] ) - except: d[ fields[1] ] = [ fields[2] ] - return d - d = load_from_file_for_build_3() - build = dataset.dbkey - if build[ 0:2 ] == "mm": build = build.replace( 'mm', 'musMus' ) - if build[ 0:2 ] == "rn": build = build.replace( 'rn', 'ratNor' ) - if build in d: - for val in d[ build ]: - options.append( ( val, val, False ) ) - return options - + """ def load_from_file_for_maf( self ): d = {} for line in open( self.from_file ): @@ -138,7 +158,6 @@ class DynamicOptions( object ): d[maf_uid]['builds'] = build_list except: continue return d - def get_options_for_maf( self, trans, other_values ): """ Used by the following tools: @@ -158,7 +177,6 @@ class DynamicOptions( object ): if len( options ) < 1: return [self.no_data_option] return options - def get_options_for_species( self, trans, other_values ): """ Used by the following tools: @@ -179,7 +197,6 @@ class DynamicOptions( object ): for species in dataset.metadata.species: options.append( ( species, species, False ) ) return options - def get_options_for_species_for_maf( self, trans, other_values ): """ Used by the following tools: @@ -192,7 +209,7 @@ class DynamicOptions( object ): maf_source = func_param.get( 'value' ).strip() if maf_source == 'cached': d = self.load_from_file_for_maf() - maf_uid = self.get_param_ref( trans, other_values ) + maf_uid = self.get_param_value( trans, other_values ) if maf_uid is None: return [self.no_data_option] if maf_uid == 'None': @@ -208,7 +225,6 @@ class DynamicOptions( object ): for species in dataset.metadata.species: options.append( ( species, species, False ) ) return options - def get_options_for_features( self, trans, other_values ): """ Used by the following tools: @@ -248,7 +264,6 @@ class DynamicOptions( object ): for elem in elem_list: options.append( ( elem, elem, False ) ) return options - def get_options_for_encode( self, trans, other_values ): """ Used by the following tools: @@ -343,3 +358,129 @@ class DynamicOptions( object ): except: options.append( self.no_data_option ) return options + def load_from_file_for_microbial( self ): + self.from_file = "/depot/data2/galaxy/microbes/microbial_data.loc" + microbe_info= {} + orgs = {} + for line in open( self.from_file ): + line = line.rstrip( '\r\n' ) + if line and not line.startswith( '#' ): + fields = line.split( '\t' ) + #read each line, if not enough fields, go to next line + try: + info_type = fields.pop(0) + if info_type.upper() == "ORG": + #ORG 12521 Clostridium perfringens SM101 bacteria Firmicutes CP000312,CP000313,CP000314,CP000315 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=genomeprj&cmd=Retrieve&dopt=Overview&list_uids=12521 + org_num = fields.pop(0) + name = fields.pop(0) + kingdom = fields.pop(0) + group = fields.pop(0) + chromosomes = fields.pop(0) + info_url = fields.pop(0) + link_site = fields.pop(0) + if org_num not in orgs: + orgs[org_num] = {} + orgs[org_num]['chrs'] = {} + orgs[org_num]['name'] = name + orgs[org_num]['kingdom'] = kingdom + orgs[org_num]['group'] = group + orgs[org_num]['chromosomes'] = chromosomes + orgs[org_num]['info_url'] = info_url + orgs[org_num]['link_site'] = link_site + elif info_type.upper() == "CHR": + #CHR 12521 CP000315 Clostridium perfringens phage phiSM101, complete genome 38092 110684521 CP000315.1 + org_num = fields.pop(0) + chr_acc = fields.pop(0) + name = fields.pop(0) + length = fields.pop(0) + gi = fields.pop(0) + gb = fields.pop(0) + info_url = fields.pop(0) + chr = {} + chr['name'] = name + chr['length'] = length + chr['gi'] = gi + chr['gb'] = gb + chr['info_url'] = info_url + if org_num not in orgs: + orgs[org_num] = {} + orgs[org_num]['chrs'] = {} + orgs[org_num]['chrs'][chr_acc] = chr + elif info_type.upper() == "DATA": + #DATA 12521_12521_CDS 12521 CP000315 CDS bed /home/djb396/alignments/playground/bacteria/12521/CP000315.CDS.bed + uid = fields.pop(0) + org_num = fields.pop(0) + chr_acc = fields.pop(0) + feature = fields.pop(0) + filetype = fields.pop(0) + path = fields.pop(0) + data = {} + data['filetype'] = filetype + data['path'] = path + data['feature'] = feature + + if org_num not in orgs: + orgs[org_num] = {} + orgs[org_num]['chrs'] = {} + if 'data' not in orgs[org_num]['chrs'][chr_acc]: + orgs[org_num]['chrs'][chr_acc]['data'] = {} + orgs[org_num]['chrs'][chr_acc]['data'][uid] = data + else: continue + except: continue + for org_num in orgs: + org = orgs[org_num] + if org['kingdom'] not in microbe_info: + microbe_info[org['kingdom']] = {} + if org_num not in microbe_info[org['kingdom']]: + microbe_info[org['kingdom']][org_num] = org + self.microbe_info = microbe_info + def get_options_for_kingdoms( self, trans, other_values ): + if self.microbe_info == None: self.load_from_file_for_microbial() + options = [] + kingdoms = self.microbe_info.keys() + kingdoms.sort() + for kingdom in kingdoms: + options.append( (kingdom, kingdom, False) ) + return options + def get_options_for_orgs_by_kingdom( self, trans, other_values ): + if self.microbe_info == None: self.load_from_file_for_microbial() + options = [] + kingdom = self.get_param_value( trans, other_values ) + orgs = self.microbe_info[kingdom].keys() + #need to sort by name + swap_test = False + for i in range( 0, len(orgs) - 1 ): + for j in range( 0, len(orgs) - i - 1 ): + if self.microbe_info[kingdom][orgs[j]]['name'] > self.microbe_info[kingdom][orgs[j + 1]]['name']: + orgs[j], orgs[j + 1] = orgs[j + 1], orgs[j] + swap_test = True + if swap_test == False: break + for org in orgs: + if self.microbe_info[kingdom][org]['link_site'] == "UCSC": + options.append( ( "" + self.microbe_info[kingdom][org]['name'] + " (about)", org, False ) ) + else: + options.append( ( self.microbe_info[kingdom][org]['name'] + " (about)", org, False ) ) + """ + if options: + options[0] = ( options[0][0], options[0][1], True) + """ + return options + def get_options_for_kingdom_org_feature( self, trans, other_values ): + if self.microbe_info == None: self.load_from_file_for_microbial() + options = [] + for func_param in self.func_params: + if func_param.get( 'name' ) == 'kingdom': + kingdom = other_values[ func_param.get( 'value' ) ] + elif func_param.get( 'name' ) == 'org': + org = other_values[ func_param.get( 'value' ) ] + elif func_param.get( 'name' ) == 'feature': + feature = func_param.get( 'value' ) + log.debug("kingdom: %s, org: %s, feature: %s" %(kingdom, org, feature)) + chroms = self.microbe_info[kingdom][org]['chrs'].keys() + chroms.sort() + for chr in chroms: + for data in self.microbe_info[kingdom][org]['chrs'][chr]['data']: + if self.microbe_info[kingdom][org]['chrs'][chr]['data'][data]['feature'] == feature: + options.append( ( self.microbe_info[kingdom][org]['chrs'][chr]['name'] + " (about)", data, False ) ) + return options + diff --git a/lib/galaxy/tools/parameters.py b/lib/galaxy/tools/parameters.py index 47dd09d61bf..c152a23ca64 100644 --- a/lib/galaxy/tools/parameters.py +++ b/lib/galaxy/tools/parameters.py @@ -329,9 +329,6 @@ class SelectToolParameter( ToolParameter ): """ Parameter that takes on one (or many) or a specific set of values. - TODO: There should be an alternate display that allows single selects to be - displayed as radio buttons and multiple selects as a set of checkboxes - >>> p = SelectToolParameter( None, XML( ... ''' ... @@ -415,23 +412,32 @@ class SelectToolParameter( ToolParameter ): self.select_options = None else: self.select_options = dynamic_options.DynamicOptions( select_options ) - if self.dynamic_options is None and self.select_options is None: - self.options = list() - for index, option in enumerate( elem.findall("option") ): + options = elem.find( 'options' ) + if options is None: + self.options = None + else: + self.options = dynamic_options.DynamicOptions( options ) + if self.dynamic_options is None and self.select_options is None and self.options is None: + self.static_options = list() + for index, option in enumerate( elem.findall( "option" ) ): value = option.get( "value" ) self.legal_values.add( value ) selected = ( option.get( "selected", None ) == "true" ) - self.options.append( ( option.text, value, selected ) ) - self.is_dynamic = ( ( self.dynamic_options is not None ) or ( self.select_options is not None ) ) + self.static_options.append( ( option.text, value, selected ) ) + self.is_dynamic = ( ( self.dynamic_options is not None ) or ( self.select_options is not None ) or ( self.options is not None ) ) def get_options( self, trans, other_values ): - if self.select_options: + if self.options: + return self.options.get_options( trans, other_values ) + elif self.select_options: return eval( '''self.select_options.%s( trans, other_values )''' %self.select_options.func ) elif self.dynamic_options: return eval( self.dynamic_options, self.tool.code_namespace, other_values ) else: - return self.options + return self.static_options def get_legal_values( self, trans, other_values ): - if self.select_options: + if self.options: + return set( v for _, v, _ in self.options.get_options( trans, other_values ) ) + elif self.select_options: return set( v for _, v, _ in eval( '''self.select_options.%s( trans, other_values )''' %self.select_options.func ) ) elif self.dynamic_options: return set( v for _, v, _ in eval( self.dynamic_options, self.tool.code_namespace, other_values ) ) @@ -507,14 +513,21 @@ class SelectToolParameter( ToolParameter ): value = value[0] return value def get_dependencies( self ): - try: - data_ref = self.select_options.data_ref - param_ref = self.select_options.param_ref - if data_ref is None and param_ref is None: return [] - elif data_ref is None: return [ param_ref ] - elif param_ref is None: return [ data_ref ] - else: return [ data_ref, param_ref ] - except: return [] + data_ref = param_ref = None + if self.options: + try: data_ref = self.options.data_ref + except: pass + try: param_ref = self.options.param_ref + except: pass + elif self.select_options: + try: data_ref = self.select_options.data_ref + except: pass + try: param_ref = self.select_options.param_ref + except: pass + if data_ref is None and param_ref is None: return [] + elif data_ref is None: return [ param_ref ] + elif param_ref is None: return [ data_ref ] + else: return [ data_ref, param_ref ] class GenomeBuildParameter( SelectToolParameter ): """ diff --git a/test-data/4.bed b/test-data/4.bed new file mode 100644 index 00000000000..6f32a4fb5a3 --- /dev/null +++ b/test-data/4.bed @@ -0,0 +1 @@ +chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + diff --git a/tools/encode/random_intervals.xml b/tools/encode/random_intervals.xml index 5fbb093e02b..e9867696465 100644 --- a/tools/encode/random_intervals.xml +++ b/tools/encode/random_intervals.xml @@ -1,44 +1,52 @@ create a random set of intervals random_intervals_no_bits.py $regions $input2 $input1 $out_file1 $input2_chromCol $input2_startCol $input2_endCol $input1_chromCol $input1_startCol $input1_endCol $input1_strandCol $use_mask $strand_overlaps - - - - - - - - - - - - - - - - - - - - - - - - -This tool will attempt to create a random set of intervals that mimic those found within your source file. You may also specify a set of intervals to mask. + + + + + + + + + + + + + + + + + + + + + + -There are several overlap options: - * Across Strands: Random regions are allowed to overlap only if they are on different strands. - * Any: All overlaps are allowed. - * None: No overlapping regions are allowed. +.. class:: warningmark -The second step will let you select a bounding region of interest. +This tool currently only works with data from genome builds hg16 or hg17. + +----- .. class:: infomark **Note:** If you do not wish to mask a set of intervals, change the Use Mask option to No, this option will override any Mask files selected. +----- + +**Syntax** + +This tool will attempt to create a random set of intervals that mimic those found within your source file. You may also specify a set of intervals to mask. + +**Allow overlaps** options + * **Across Strands** Random regions are allowed to overlap only if they are on different strands. + * **Any** All overlaps are allowed. + * **None** No overlapping regions are allowed. + +**Regions to use** options + * Bounding region of interest based on the dataset build. - \ No newline at end of file diff --git a/tools/encode/random_intervals_code.py b/tools/encode/random_intervals_code.py deleted file mode 100644 index 3c0cfb6122f..00000000000 --- a/tools/encode/random_intervals_code.py +++ /dev/null @@ -1,40 +0,0 @@ -#build list of available data -import os, sys -#available_regions[build][uids] -available_regions = {} - -loc_file = "/depot/data2/galaxy/regions.loc" - - -try: - for line in open( loc_file ): - if line[0:1] == "#" : continue - - fields = line.split('\t') - #read each line, if not enough fields, go to next line - try: - build = fields[0] - uid = fields[1] - description = fields[2] - filepath =fields[3].replace("\n","").replace("\r","") - if build not in available_regions: - available_regions[build]=[] - available_regions[build].append((description,uid,False)) - except: - continue - -except Exception, exc: - print >>sys.stdout, 'random_intervals_code.py initialization error -> %s' % exc - -#return available datasets for group and build, set None option as selected for hg16 -def get_available_data( build ): - available_sets = [] - if build in available_regions: - return available_regions[build] - else: - return [('No data available for this build','None',True)] - - -#def exec_before_job(app, inp_data, out_data, param_dict, tool): -# for name, data in out_data.items(): -# data.name = data.name + " [" + maf_sets[param_dict['mafType']]['description'] + "]" diff --git a/tools/extract/extractAxt_wrapper.xml b/tools/extract/extractAxt_wrapper.xml index 2669149eb0b..a92df9d5a8c 100644 --- a/tools/extract/extractAxt_wrapper.xml +++ b/tools/extract/extractAxt_wrapper.xml @@ -4,8 +4,10 @@ - - + + + + diff --git a/tools/extract/phastOdds/get_scores_galaxy.py b/tools/extract/phastOdds/get_scores_galaxy.py index e9d12757b7b..27207462082 100755 --- a/tools/extract/phastOdds/get_scores_galaxy.py +++ b/tools/extract/phastOdds/get_scores_galaxy.py @@ -17,6 +17,10 @@ from bx.cookbook import doc_optparse from bx import intervals +def stop_err( msg ): + sys.stderr.write(msg) + sys.exit() + def main(): # Parse command line options, args = doc_optparse.parse( __doc__ ) @@ -31,8 +35,7 @@ def main(): doc_optparse.exception() if h5_fname == 'None.h5': - print 'Invalid genome build - this tool currently only works with data from genome build hg17. Click "edit attributes" (the pencil icon) in your history item to correct the genome build if appropriate.' - sys.exit() + stop_err( 'Invalid genome build, this tool currently only works with data from build hg17. Click the pencil icon in your history item to correct the build if appropriate.' ) # Open the h5 file h5 = openFile( h5_fname, mode = "r" ) @@ -47,30 +50,34 @@ def main(): out_file = open( out_fname, "w" ) # Find the subregion containing each input interval for index, line in enumerate( in_file ): + line = line.rstrip( '\r\n' ) if line.startswith( "#" ): if index == 0: - print >> out_file, line.rstrip() + "\tscore" + print >> out_file, line + "\tscore" else: print >> out_file, line, - fields = line.rstrip().split( "\t" ) - chr = fields[ chrom_col ] - start = int( fields[ start_col ] ) - end = int( fields[ end_col ] ) + fields = line.split( "\t" ) + try: + chr = fields[ chrom_col ] + start = int( fields[ start_col ] ) + end = int( fields[ end_col ] ) + except: + stop_err( "Invalid chrom, start and end column settings. Click the pencil icon in your history item to correct the settings." ) # Find matching interval - matches = intersecters[ chr ].find( start, end ) + try: + matches = intersecters[ chr ].find( start, end ) + except: + stop_err( "'%s' is not a valid chrom value for the region" %chr ) if not len( matches ) == 1: - print "Interval must match exactly one target region" - break + stop_err( "Interval must match exactly one target region" ) region = matches[0] - if not (start >= region.start and end <= region.end): - print "Interval must fall entirely within region" - break + if not ( start >= region.start and end <= region.end ): + stop_err( "Interval must fall entirely within region" ) region_name = region.value rel_start = start - region.start rel_end = end - region.start if not rel_start < rel_end: - print "Region %s is empty - relative start:%d, relative end:%d" % ( region_name, rel_start, rel_end ) - break + stop_err( "Region %s is empty - relative start:%d, relative end:%d" % ( region_name, rel_start, rel_end ) ) s = h5.getNode( h5.root, "scores_" + region_name ) c = h5.getNode( h5.root, "counts_" + region_name ) score = s[rel_end-1] diff --git a/tools/extract/phastOdds/phastOdds_tool.xml b/tools/extract/phastOdds/phastOdds_tool.xml index b1c720a0866..8681d682424 100644 --- a/tools/extract/phastOdds/phastOdds_tool.xml +++ b/tools/extract/phastOdds/phastOdds_tool.xml @@ -4,13 +4,23 @@ - - + + + + + + + + + + + + .. class:: warningmark diff --git a/tools/filters/axt_to_concat_fasta.xml b/tools/filters/axt_to_concat_fasta.xml index 04eeeb55e4a..cb9db77a911 100644 --- a/tools/filters/axt_to_concat_fasta.xml +++ b/tools/filters/axt_to_concat_fasta.xml @@ -4,11 +4,11 @@ - - + + - - + + diff --git a/tools/filters/axt_to_fasta.xml b/tools/filters/axt_to_fasta.xml index 202b7e22434..0370cc692c6 100644 --- a/tools/filters/axt_to_fasta.xml +++ b/tools/filters/axt_to_fasta.xml @@ -4,11 +4,11 @@ - - + + - - + + diff --git a/tools/filters/axt_to_lav.xml b/tools/filters/axt_to_lav.xml index c11098bf3f5..747cca001f4 100644 --- a/tools/filters/axt_to_lav.xml +++ b/tools/filters/axt_to_lav.xml @@ -5,11 +5,11 @@ - - + + - - + + diff --git a/tools/stats/aggregate_binned_scores_in_intervals.xml b/tools/stats/aggregate_binned_scores_in_intervals.xml index a843bbfbdd6..c36e4d687e8 100644 --- a/tools/stats/aggregate_binned_scores_in_intervals.xml +++ b/tools/stats/aggregate_binned_scores_in_intervals.xml @@ -4,8 +4,10 @@ - - + + + +