Mercurial > repos > peterjc > count_roi_variants
changeset 6:fb728e40b5e0 draft
planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/count_roi_variants commit 5fb6ee31f33e8e24c1ae5d56c93ac3e0157dad72-dirty
author | peterjc |
---|---|
date | Thu, 09 Feb 2017 11:19:32 -0500 |
parents | 2ad9d74f97a8 |
children | 4ca3bde07d49 |
files | tools/count_roi_variants/count_roi_variants.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/count_roi_variants/count_roi_variants.py Fri Feb 03 12:49:07 2017 -0500 +++ b/tools/count_roi_variants/count_roi_variants.py Thu Feb 09 11:19:32 2017 -0500 @@ -12,9 +12,10 @@ the observed variants spanning the ROI, and outputs this as a tabular file. """ -import sys + import os import subprocess +import sys import tempfile if "-v" in sys.argv or "--version" in sys.argv: @@ -140,6 +141,7 @@ else: raise NotImplementedError("Unexpected CIGAR operator %s" % op) + assert list(expand_cigar("ACGT", decode_cigar("4M"))) == [(0, "A"), (1, "C"), (2, "G"), (3, "T")] assert list(expand_cigar("ACGT", decode_cigar("2=1X1="))) == [(0, "A"), (1, "C"), (2, "G"), (3, "T")] assert list(expand_cigar("ACGT", decode_cigar("2M1D2M"))) == [(0, "A"), (1, "C"), (3, "G"), (4, "T")] @@ -184,6 +186,7 @@ # want to exclude e.g. 3.5 and 7.5 when given start 4 and end 8. return "".join(base for i, base in expand_cigar(seq, cigar_ops) if start <= i <= end - 1) + assert "GGGG" == get_roi("AAAAGGGGTTTT", decode_cigar("12M"), 4, 8) assert "GGGG" == get_roi("AAAAcGGGGTTTT", decode_cigar("4M1I8M"), 4, 8) assert "GGGG" == get_roi("AAAAGGGGcTTTT", decode_cigar("8M1I4M"), 4, 8)