Cython API: fixed a bug where the quality format would not be read

properly from the configuration values
This commit is contained in:
Celine Mercier
2018-02-12 14:42:30 +01:00
parent 370fb9272c
commit 00993d4215
2 changed files with 11 additions and 8 deletions

View File

@ -96,11 +96,11 @@ def run(config):
logger("info", "obi alignpairedend") logger("info", "obi alignpairedend")
# Open the input # Open the input
finput = open_uri(config["alignpairedend"]["forward"], config) finput = open_uri(config["alignpairedend"]["forward"])
if finput is None: if finput is None:
raise Exception("Could not open forward reads") raise Exception("Could not open forward reads")
forward = finput[1] forward = finput[1]
rinput = open_uri(config["alignpairedend"]["reverse"], config) rinput = open_uri(config["alignpairedend"]["reverse"])
if rinput is None: if rinput is None:
raise Exception("Could not open reverse reads") raise Exception("Could not open reverse reads")
reverse = rinput[1] reverse = rinput[1]
@ -108,14 +108,13 @@ def run(config):
if len(forward) != len(reverse): if len(forward) != len(reverse):
raise Exception("Error: the number of forward and reverse reads are different") raise Exception("Error: the number of forward and reverse reads are different")
if "index" in config["alignpairedend"]: if "index" in config["alignpairedend"]: # TODO
index = open_uri(config["alignpairedend"]["index"], config) index = open_uri(config["alignpairedend"]["index"])
else: else:
index = None index = None
# Open the output # Open the output
output = open_uri(config['obi']['outputURI'], output = open_uri(config['obi']['outputURI'],
config,
input=False, input=False,
newviewtype=View_NUC_SEQS) newviewtype=View_NUC_SEQS)
if output is None: if output is None:

View File

@ -62,7 +62,7 @@ def open_dms_element(DMS dms, bytes path,
if not path: if not path:
return (dms,dms) return (dms,dms)
# The URI is target a taxonomy # The URI targets a taxonomy
# dms:dmspath/taxonomy/taxoname[/taxid] # dms:dmspath/taxonomy/taxoname[/taxid]
if path_parts[0]==b"taxonomy": if path_parts[0]==b"taxonomy":
if len(path_parts) > 1: if len(path_parts) > 1:
@ -74,7 +74,7 @@ def open_dms_element(DMS dms, bytes path,
raise MalformedURIException('Malformed Taxonomy URI') raise MalformedURIException('Malformed Taxonomy URI')
return (dms,taxo) return (dms,taxo)
# The URI is target a view # The URI targets a view
# dms:dmspath/viewname[/columnname|#line|*[/#line|columnname|*[/subcolumn]]] # dms:dmspath/viewname[/columnname|#line|*[/#line|columnname|*[/subcolumn]]]
if create: if create:
@ -282,7 +282,11 @@ def open_uri(uri,
offset=64 offset=64
else: else:
try: 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: except KeyError:
offset=33 offset=33