From 634ff3dad4a71e0453b5b5626cf36e57dc42ba97 Mon Sep 17 00:00:00 2001 From: Yi Li Date: Wed, 29 Jun 2016 21:02:00 -0700 Subject: [PATCH] io.py bqual = read.alignment.query_qualities[qpos] added --- pyloh/preprocess/io.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyloh/preprocess/io.py b/pyloh/preprocess/io.py index 00c8ddd..2c3e2af 100644 --- a/pyloh/preprocess/io.py +++ b/pyloh/preprocess/io.py @@ -88,10 +88,12 @@ def _parse_pileup_column(self, pileup_column): if read.is_del: continue - if hasattr(read, 'qpos') == True: - qpos = read.qpos - elif hasattr(read, 'query_position') == True: + if hasattr(read, 'query_position') == True: qpos = read.query_position + bqual = read.alignment.query_qualities[qpos] + elif hasattr(read, 'qpos') == True: + qpos = read.qpos + bqual = ord(read.alignment.qual[qpos]) - ascii_offset else: raise Exception("Error in pysam qpos/query_position.") @@ -99,9 +101,7 @@ def _parse_pileup_column(self, pileup_column): if mqual < self.min_mqual: continue - - bqual = ord(read.alignment.qual[qpos]) - ascii_offset - + if bqual < self.min_bqual: continue