comparison extract_genomic_dna_utils.py @ 2:702970e4a134 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/extract_genomic_dna commit 9192c1e90e2fd5017e6044884bcc6f2e80ba8b31
author iuc
date Wed, 09 Mar 2016 05:07:21 -0500
parents 8dd8e89c0603
children b71579ad576c
comparison
equal deleted inserted replaced
1:9af3f57e50b9 2:702970e4a134
290 return seq_path 290 return seq_path
291 except Exception, e: 291 except Exception, e:
292 stop_err('Error running faToTwoBit. ' + str(e)) 292 stop_err('Error running faToTwoBit. ' + str(e))
293 293
294 294
295 def get_bedtools_getfasta_default_header(chrom, start, end, strand, includes_strand_col):
296 """
297 Return a fasta header that is the default produced by the bedtools
298 getfasta tool, assuming "force strandedness". This will produce a
299 header with this format: <chrom>:<start>-<end>(strand). If the input
300 data includes a strand column and the strand is '+' or '-', then use it.
301 If the input data includes a strand column and the value of strand is
302 anything but '+' or '-', set strand to '.' in the header. If the input
303 data does not include a strand column, set strand to '.' in the header.
304 """
305 if includes_strand_col and strand in ['+', '-']:
306 strand_val = strand
307 else:
308 strand_val = '.'
309 return '%s:%s-%s(%s)' % (chrom, start, end, strand_val)
310
311
312 def get_fasta_header_delimiter(delimiter):
313 # Return a specified fasta header delimiter.
314 if delimiter == 'underscore':
315 return '_'
316 if delimiter == 'semicolon':
317 return ';'
318 if delimiter == 'comma':
319 return ','
320 if delimiter == 'tilde':
321 return '~'
322 if delimiter == 'vertical_bar':
323 return '|'
324 # Set the default to underscore.
325 return '_'
326
327
295 def get_lines(feature): 328 def get_lines(feature):
296 # Get feature's line(s). 329 # Get feature's line(s).
297 if isinstance(feature, GFFFeature): 330 if isinstance(feature, GFFFeature):
298 return feature.lines() 331 return feature.lines()
299 else: 332 else: