Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.tools.util package

Utilities used by various Galaxy tools

FIXME: These are used by tool scripts, not the framework, and should not live
in this package.

Submodules

galaxy.tools.util.maf_utilities module

Provides wrappers and utilities for working with MAF files and alignments.

class galaxy.tools.util.maf_utilities.GenomicRegionAlignment(start, end, species=[], temp_file_handler=None)[source]

Bases: galaxy.tools.util.maf_utilities.RegionAlignment

__init__(start, end, species=[], temp_file_handler=None)[source]
class galaxy.tools.util.maf_utilities.RegionAlignment(size, species=[], temp_file_handler=None)[source]

Bases: object

DNA_COMPLEMENT = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@TBGDEFCHIJKLMNOPQRSAUVWXYZ[\\]^_`tbgdefchijklmnopqrsauvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
MAX_SEQUENCE_SIZE = 9223372036854775807
__init__(size, species=[], temp_file_handler=None)[source]
add_species(species)[source]
flush(species=None)[source]
get_sequence(species)[source]
get_sequence_reverse_complement(species)[source]
get_species_names(skip=[])[source]
set_position(index, species, base)[source]
set_range(index, species, bases)[source]
class galaxy.tools.util.maf_utilities.SplicedAlignment(exon_starts, exon_ends, species=[], temp_file_handler=None)[source]

Bases: object

DNA_COMPLEMENT = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@TBGDEFCHIJKLMNOPQRSAUVWXYZ[\\]^_`tbgdefchijklmnopqrsauvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
__init__(exon_starts, exon_ends, species=[], temp_file_handler=None)[source]
end
get_sequence(species)[source]
get_sequence_reverse_complement(species)[source]
get_species_names(skip=[])[source]
start
class galaxy.tools.util.maf_utilities.TempFileHandler(max_open_files=None, **kwds)[source]

Bases: object

Handles creating, opening, closing, and deleting of Temp files, with a maximum number of files open at one time.

DEFAULT_MAX_OPEN_FILES = 524288
__init__(max_open_files=None, **kwds)[source]
close(index, delete=False)[source]
flush(index)[source]
get_open_tempfile(index=None, **kwds)[source]
galaxy.tools.util.maf_utilities.build_maf_index(maf_file, species=None)[source]
galaxy.tools.util.maf_utilities.build_maf_index_species_chromosomes(filename, index_species=None)[source]
galaxy.tools.util.maf_utilities.chop_block_by_region(block, src, region, species=None, mincols=0)[source]
galaxy.tools.util.maf_utilities.component_overlaps_region(c, region)[source]
galaxy.tools.util.maf_utilities.fill_region_alignment(alignment, index, primary_species, chrom, start, end, strand='+', species=None, mincols=0, overwrite_with_gaps=True)[source]
galaxy.tools.util.maf_utilities.get_attributes_from_fasta_header(header)[source]
galaxy.tools.util.maf_utilities.get_chopped_blocks_for_region(index, src, region, species=None, mincols=0)[source]
galaxy.tools.util.maf_utilities.get_chopped_blocks_with_index_offset_for_region(index, src, region, species=None, mincols=0)[source]
galaxy.tools.util.maf_utilities.get_components_by_src(block, src)[source]
galaxy.tools.util.maf_utilities.get_components_by_src_start(block, src)[source]
galaxy.tools.util.maf_utilities.get_fasta_header(component, attributes={}, suffix=None)[source]
galaxy.tools.util.maf_utilities.get_oriented_chopped_blocks_for_region(index, src, region, species=None, mincols=0, force_strand=None)[source]
galaxy.tools.util.maf_utilities.get_oriented_chopped_blocks_with_index_offset_for_region(index, src, region, species=None, mincols=0, force_strand=None)[source]
galaxy.tools.util.maf_utilities.get_region_alignment(index, primary_species, chrom, start, end, strand='+', species=None, mincols=0, overwrite_with_gaps=True, temp_file_handler=None)[source]
galaxy.tools.util.maf_utilities.get_species_in_block(block)[source]
galaxy.tools.util.maf_utilities.get_species_in_maf(maf_filename)[source]
galaxy.tools.util.maf_utilities.get_spliced_region_alignment(index, primary_species, chrom, starts, ends, strand='+', species=None, mincols=0, overwrite_with_gaps=True, temp_file_handler=None)[source]
galaxy.tools.util.maf_utilities.get_starts_ends_fields_from_gene_bed(line)[source]
galaxy.tools.util.maf_utilities.iter_blocks_split_by_species(block, species=None)[source]
galaxy.tools.util.maf_utilities.iter_blocks_split_by_src(block, src)[source]
galaxy.tools.util.maf_utilities.iter_components_by_src(block, src)[source]
galaxy.tools.util.maf_utilities.iter_components_by_src_start(block, src)[source]
galaxy.tools.util.maf_utilities.iter_fasta_alignment(filename)[source]
galaxy.tools.util.maf_utilities.line_enumerator(lines, comment_start='#')[source]
galaxy.tools.util.maf_utilities.maf_index_by_uid(maf_uid, index_location_file)[source]
galaxy.tools.util.maf_utilities.open_or_build_maf_index(maf_file, index_filename, species=None)[source]
galaxy.tools.util.maf_utilities.orient_block_by_region(block, src, region, force_strand=None)[source]
galaxy.tools.util.maf_utilities.parse_species_option(species)[source]
galaxy.tools.util.maf_utilities.reduce_block_by_primary_genome(block, species, chromosome, region_start)[source]
galaxy.tools.util.maf_utilities.remove_temp_index_file(index_filename)[source]
galaxy.tools.util.maf_utilities.sort_block_components_by_block(block1, block2)[source]
galaxy.tools.util.maf_utilities.src_merge(spec, chrom, contig=None)[source]
galaxy.tools.util.maf_utilities.src_split(src)[source]
galaxy.tools.util.maf_utilities.tool_fail(msg='Unknown Error')[source]