Пример #1
0
def get_info_by_chr(chr,
                    aligned_bases_by_chr,
                    chr_sizes,
                    contigs_fpaths,
                    contig_names_by_refs,
                    one_chromosome=False):
    if one_chromosome:
        html_name = qconfig.one_alignment_viewer_name
        chr_link = os.path.join(qconfig.icarus_dirname, html_name + '.html')
    else:
        chr_link = os.path.join(qconfig.icarus_dirname,
                                trim_ref_name(chr) + '.html')
    chr_name = chr.replace('_', ' ')
    tooltip = ''
    if len(chr_name) > 70:
        short_name = chr[:70]
        tooltip = chr_name
        chr_name = short_name + '...'
    aligned_lengths = [
        aligned_len for aligned_len in aligned_bases_by_chr[chr]
        if aligned_len is not None
    ]
    chr_genome = sum(aligned_lengths) * 100.0 / (chr_sizes[chr] *
                                                 len(contigs_fpaths))
    chr_size = chr_sizes[chr]
    return chr_link, chr_name, chr_genome, chr_size, tooltip
Пример #2
0
def get_info_by_chr(chr, aligned_bases_by_chr, chr_sizes, contigs_fpaths, contig_names_by_refs, one_chromosome=False):
    if one_chromosome:
        html_name = qconfig.one_alignment_viewer_name
        chr_link = os.path.join(qconfig.icarus_dirname, html_name + '.html')
    else:
        chr_link = os.path.join(qconfig.icarus_dirname, trim_ref_name(chr) + '.html')
    chr_name = chr.replace('_', ' ')
    tooltip = ''
    if len(chr_name) > 70:
        short_name = chr[:70]
        tooltip = chr_name
        chr_name = short_name + '...'
    aligned_lengths = [aligned_len for aligned_len in aligned_bases_by_chr[chr] if aligned_len is not None]
    chr_genome = sum(aligned_lengths) * 100.0 / (chr_sizes[chr] * len(contigs_fpaths))
    chr_size = chr_sizes[chr]
    return chr_link, chr_name, chr_genome, chr_size, tooltip
Пример #3
0
def get_html_name(chr, chr_full_names):
    if len(chr_full_names) == 1:
        return qconfig.one_alignment_viewer_name
    return trim_ref_name(chr)
Пример #4
0
def get_html_name(chr, chr_full_names):
    if len(chr_full_names) == 1:
        return qconfig.one_alignment_viewer_name
    return trim_ref_name(chr)