From 3d62098c759c1108aca1b36dddb369093fd5a8d5 Mon Sep 17 00:00:00 2001
From: Blaise Li <blaise.li__git@nsup.org>
Date: Thu, 15 Nov 2018 20:12:08 +0100
Subject: [PATCH] Switched to new small RNA classification.

This is not yet fully tested, and may have effects on other pipelines.
---
 libhts/libhts.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libhts/libhts.py b/libhts/libhts.py
index fa2deb7..5b4e1b0 100644
--- a/libhts/libhts.py
+++ b/libhts/libhts.py
@@ -275,8 +275,11 @@ def aligner2min_mapq(aligner, wildcards):
     What minimal MAPQ value should a read have to be considered uniquely mapped?
     See <https://sequencing.qcfail.com/articles/mapq-values-are-really-useful-but-their-implementation-is-a-mess/>.
     """
-    mapped_type = wildcards.mapped_type
-    if mapped_type.startswith("unique_"):
+    try:
+        mapping_type = wildcards.mapping_type
+    except AttributeError:
+        mapping_type = wildcards.mapped_type
+    if mapping_type.startswith("unique_"):
         if aligner == "hisat2":
             return "-Q 60"
         elif aligner == "bowtie2":
-- 
GitLab