How to use the mappy.ThreadBuffer function in mappy

To help you get started, we’ve selected a few mappy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nanoporetech / tombo / tombo / resquiggle.py View on Github external
obs_filter, seq_samp_type, overwrite, map_conn, q_score_thresh,
        std_ref, sig_len_rng, seq_len_rng):
    # increase update interval as more reads are provided
    proc_update_interval = 1
    def update_progress(num_processed, proc_update_interval):
        if num_processed % proc_update_interval == 0:
            progress_q.put(proc_update_interval)
            # increase update interval as more reads are processed
            if num_processed == 100:
                proc_update_interval = 10
            if num_processed == 1000:
                proc_update_interval = 100
        return proc_update_interval

    # get mappy aligner thread buffer
    map_thr_buf = mappy.ThreadBuffer()

    num_processed = 0
    while True:
        try:
            fast5_fn = fast5_q.get(block=False)
        except queue.Empty:
            sleep(0.1)
            continue

        if fast5_fn is None:
            try:
                # signal that all reads have been processed to child process
                map_conn.send(None)
            except BrokenPipeError:
                # ignore if the re-squiggle process was killed during run
                pass

mappy

Minimap2 python binding

MIT
Latest version published 8 months ago

Package Health Score

74 / 100
Full package analysis

Similar packages