Commit 4a54d055 authored by Fabrice Allain's avatar Fabrice Allain
Browse files

feat: add options to activate or deactivate pdq quality tools (pdbqual command)

parent 737dd533
......@@ -241,7 +241,7 @@ class AriaEcCommands(CLI):
u"Convert configuration files into a unique csv file")
contact_types = set(MapFile.types).union(
set(CONTACT_FILE_PARSERS))
set(CONTACT_FILE_PARSERS)).union(set(MapFile.conkit_alias))
default_confile = "conf/config.ini"
def __init__(self):
......
......@@ -9,7 +9,7 @@ import logging
import os
import shutil
from ..core.legacy.QualityChecks.QualityChecks import runChecks
from ..core.legacy.QualityChecks.QualityChecks import runChecks, FILENAME_REPORT
from .common import CommandProtocol
LOG = logging.getLogger(__name__)
......@@ -32,11 +32,14 @@ class AriaEcPdbqual(CommandProtocol):
runChecks(
workingDirectory=self.settings.pdbqual["output_directory"],
trashDirectory=self.settings.pdbqual["trash_directory"],
prosaOnOff=1 if self.settings.pdbqual["prosa"] else 0,
procheckExe=self.settings.main["procheck_executable"],
procheckOnOff=1 if self.settings.main["procheck_enabled"] in ("yes", True, "True") else 0,
whatIfExe=self.settings.main["whatif_executable"],
whatifOnOff=1 if self.settings.main["whatif_enabled"] in ("yes", True, "True") else 0,
clashlistExe=self.settings.main["clashlist_executable"],
clashlistOnOff=1 if self.settings.main["clashlist_enabled"] in ("yes", True, "True") else 0,
prosaExe=self.settings.main["prosa_executable"] if self.settings.main["prosa_executable"] else "",
prosaOnOff=1 if self.settings.pdbqual["prosa_enabled"] in ("yes", True, "True") else 0,
cshExe=self.settings.pdbqual["csh_executable"],
howManyPdb=len(self.settings.pdbqual["infiles"]),
verbose=1,
......@@ -45,7 +48,7 @@ class AriaEcPdbqual(CommandProtocol):
)
LOG.info("%s generated",
os.path.join(self.settings.pdbqual["output_directory"],
QualityChecks.FILENAME_REPORT))
FILENAME_REPORT))
LOG.info("Removing infile(s) in output directory %s", self.settings.pdbqual["output_directory"])
[os.remove(
os.path.join(self.settings.pdbqual["output_directory"],
......
......@@ -150,6 +150,9 @@ class MapFile(RegexFile):
# sort_field allow sorting lines with values into this field
# TODO: wrong regex for native_full ?
# TODO: smarter dict ...
conkit_alias = {
"raptorx": "casprr",
}
types = {
"plmdca": {
"regex": re.compile(r"^(?P<res1_nb>\d+)\s+(?P<res1_name>\w)\s+"
......@@ -328,6 +331,8 @@ class MapFile(RegexFile):
self.checkflag = kwargs.pop("check_type") \
if "check_type" in kwargs else True
super(MapFile, self).__init__(*args, **kwargs)
self.filetype = self.filetype if self.filetype not in self.conkit_alias else \
self.conkit_alias[self.filetype]
if not self.conioflag and self.checkflag:
LOG.info("The file format {ftype} is not supported by the conkit "
"plugin. Switching to homemade parsers.".format(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment