INNER CODE UNIT · Python

get_query_loc

MariaNattestad/assemblytics · assemblytics/dotplot.py:61

    def get_query_loc(query, pos):
        return query_offsets[query] + pos

    coords['query_loc_start'] = coords.apply(lambda row: get_query_loc(row['query'], row['query_start']), axis=1)
    coords['query_loc_stop'] = coords.apply(lambda row: get_query_loc(row['query'], row['query_end']), axis=1)

    # Labels (hide for small chromosomes/queries)
    total_ref_length = chr_lengths.sum()
    chr_labels = [name if length >= 0.02 * total_ref_length else "" for name, length in chr_lengths.items()]
    chr_breaks = chr_lengths.cumsum().tolist()

    total_query_length = query_lengths.sum()
    query_labels = [name if length >= 0.02 * total_query_length else "" for name, length in query_lengths.items()]
    query_breaks = query_lengths.cumsum().tolist()

    # Plotting
    plt.figure(figsize=(10, 10))
    

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…