From 00993d4215fef05e591b5ba6b902a589aff46218 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Mon, 12 Feb 2018 14:42:30 +0100 Subject: [PATCH] Cython API: fixed a bug where the quality format would not be read properly from the configuration values --- python/obitools3/commands/alignpairedend.pyx | 9 ++++----- python/obitools3/uri/decode.pyx | 10 +++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/python/obitools3/commands/alignpairedend.pyx b/python/obitools3/commands/alignpairedend.pyx index 896d7f9..17ab75c 100644 --- a/python/obitools3/commands/alignpairedend.pyx +++ b/python/obitools3/commands/alignpairedend.pyx @@ -96,11 +96,11 @@ def run(config): logger("info", "obi alignpairedend") # Open the input - finput = open_uri(config["alignpairedend"]["forward"], config) + finput = open_uri(config["alignpairedend"]["forward"]) if finput is None: raise Exception("Could not open forward reads") forward = finput[1] - rinput = open_uri(config["alignpairedend"]["reverse"], config) + rinput = open_uri(config["alignpairedend"]["reverse"]) if rinput is None: raise Exception("Could not open reverse reads") reverse = rinput[1] @@ -108,14 +108,13 @@ def run(config): if len(forward) != len(reverse): raise Exception("Error: the number of forward and reverse reads are different") - if "index" in config["alignpairedend"]: - index = open_uri(config["alignpairedend"]["index"], config) + if "index" in config["alignpairedend"]: # TODO + index = open_uri(config["alignpairedend"]["index"]) else: index = None # Open the output output = open_uri(config['obi']['outputURI'], - config, input=False, newviewtype=View_NUC_SEQS) if output is None: diff --git a/python/obitools3/uri/decode.pyx b/python/obitools3/uri/decode.pyx index 284b995..11b1237 100644 --- a/python/obitools3/uri/decode.pyx +++ b/python/obitools3/uri/decode.pyx @@ -62,7 +62,7 @@ def open_dms_element(DMS dms, bytes path, if not path: return (dms,dms) - # The URI is target a taxonomy + # The URI targets a taxonomy # dms:dmspath/taxonomy/taxoname[/taxid] if path_parts[0]==b"taxonomy": if len(path_parts) > 1: @@ -74,7 +74,7 @@ def open_dms_element(DMS dms, bytes path, raise MalformedURIException('Malformed Taxonomy URI') return (dms,taxo) - # The URI is target a view + # The URI targets a view # dms:dmspath/viewname[/columnname|#line|*[/#line|columnname|*[/subcolumn]]] if create: @@ -282,7 +282,11 @@ def open_uri(uri, offset=64 else: try: - offset=config["obi"]["qualityoffset"] + if config["obi"]["qualityformat"][0]=="sanger": + offset=33 + elif config["obi"]["qualityformat"][0]=="solexa": + offset=64 + #offset=config["obi"]["qualityoffset"] # TODO discuss except KeyError: offset=33