commands.py 20.4 KB
Newer Older
1
# coding=utf-8
fabrice's avatar
fabrice committed
2
3
4
"""
                            Input/Output aria_ec
"""
5
from __future__ import absolute_import, division, print_function
fabrice's avatar
fabrice committed
6
7
8
9
10

import os
import logging
import argparse as argp

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
11
from . import __doc__
12
from .common import format_dict, CustomLogging
13
from .settings import AriaEcSettings
fabrice's avatar
fabrice committed
14
from .maplot import AriaEcContactMap
15
16
from .converter import AriaEcBbConverter, AriaEcXMLConverter, \
    AriaEcConfigConverter
17
from .reader import MapFile
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
18
from .pdbdist import PDBDist
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
19
from .pdbstat import PDBStat
20
21
from .setup import AriaEcSetup
from .pdbqual import AriaEcPdbqual
22
from .analysis import EnsembleAnalysis
23
from conkit.io import CONTACT_FILE_PARSERS
fabrice's avatar
fabrice committed
24

25
26

LOG = logging.getLogger(__name__)
fabrice's avatar
fabrice committed
27
28
29


def check_file(prospective_file):
30
    """
31
    
fabrice's avatar
fabrice committed
32

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
33
34
35
36
37
38
39
40
41
    Parameters
    ----------
    prospective_file :
        

    Returns
    -------

    
42
    """
43
    LOG.debug("Checking if %s is a readable file", prospective_file)
fabrice's avatar
fabrice committed
44
45
46
47
48
49
50
51
    if not os.path.exists(prospective_file):
        raise argp.ArgumentTypeError("readable_file:'{0}' is not a valid "
                                     "path".format(prospective_file))
    if not os.access(prospective_file, os.R_OK):
        raise argp.ArgumentTypeError("readable_file:'{0}' is not a readable "
                                     "file".format(prospective_file))


52
53
54
55
56
57
58
59
def seqrange_type(s):
    try:
        x, y = map(int, s.split('-'))
        return x, y
    except:
        raise argp.ArgumentTypeError("Sequence indexes must be start-end")


fabrice's avatar
fabrice committed
60
class ReadableFile(argp.Action):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
61
    """Class used with argparse action to check if a file is readable"""
fabrice's avatar
fabrice committed
62

Fabrice Allain's avatar
Fabrice Allain committed
63
64
65
    def __init__(self, *args, **kwargs):
        super(ReadableFile, self).__init__(*args, **kwargs)

fabrice's avatar
fabrice committed
66
    def __call__(self, parser, namespace, values, option_string=None):
67
        if isinstance(values, list):
fabrice's avatar
fabrice committed
68
69
            for prospective_file in values:
                check_file(prospective_file)
Fabrice Allain's avatar
Fabrice Allain committed
70
71
            setattr(namespace, self.dest,
                    [os.path.abspath(os.path.expanduser(val)) for val in values])
72
        elif isinstance(values, str):
fabrice's avatar
fabrice committed
73
            check_file(values)
Fabrice Allain's avatar
Fabrice Allain committed
74
            setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))
fabrice's avatar
fabrice committed
75
76
77
78


# TODO: Make parent Command class with _create_argparser, self.args,
# update_logger and run
79
class AriaEcCommands(object):
80
81
82
83
84
85
86
87
88
89
    """
    Command line interface for aria_ec

    Attributes
    ----------
    AriaEcCommands.command_list: list
        available command line tools
    AriaEcCommands.desc_list: list

    """
fabrice's avatar
fabrice committed
90

91
    command_list = ("setup", "bbconv", "maplot", "pdbqual", "analysis",
92
                    "tbl2xml", "pdbdist", "pdbstat", "iniconv")
93
    desc_list = (u"Setup ARIA infrastructure with contact maps translated "
fabrice's avatar
fabrice committed
94
                 u"into ARIA restraints",
95
96
                 u"Convert a contact map in bbcontact format",
                 u"Contactmap visualization tool",
97
                 u"Quality tool for pdb file(s)",
98
                 u"Extended ARIA ensemble analysis on a specific iteration ",
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
99
                 u"XML converter for tbl distance restraint",
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
100
                 u"Extract distance distribution from culled list of pdb files",
101
102
                 u"Analyze distance distribution with GMM",
                 u"Convert configuration files into a unique csv file")
103
104
105

    contact_types = set(MapFile.types).union(
        set(CONTACT_FILE_PARSERS))
106
    default_confile = "conf/config.ini"
fabrice's avatar
fabrice committed
107
108

    def __init__(self, custom_logging=None):
109
        # Def Argument pdbparser
fabrice's avatar
fabrice committed
110
111
112
        parser = self._create_argparser()
        # parse args
        self.args = parser.parse_args()
113
        # Update LOG with outdir
fabrice's avatar
fabrice committed
114
115
116
        self._update_logger(custom_logging)

    def _update_logger(self, log):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
117
        """
118
        
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
119
120
121
122
123
124
125
126
127
128
129

        Parameters
        ----------
        log :
            

        Returns
        -------

        
        """
fabrice's avatar
fabrice committed
130
        if log and hasattr(self.args, "output_directory"):
fabrice's avatar
fabrice committed
131
132
133
            if not self.args.nolog:
                # Don't generate log files
                # TODO: get handler list from json file or customlogging object
134
135
136
                LOG.removeHandler("info_file_handler")
                LOG.removeHandler("error_file_handler")
                LOG.removeHandler("debug_file_handler")
fabrice's avatar
fabrice committed
137
                log.set_outdir(self.args.output_directory)
fabrice's avatar
fabrice committed
138
139
140
            log.update_msg(self.args.command)

    def _create_argparser(self):
141
142
143
        parser = argp.ArgumentParser(
            description=__doc__,
            formatter_class=argp.ArgumentDefaultsHelpFormatter)
fabrice's avatar
fabrice committed
144
        parser.add_argument("-o", "--output", dest="output_directory",
145
                            type=str, help="Output directory", required=True)
146
147
        parser.add_argument("-c", "--conf", action=ReadableFile,
                            dest="conf_file",
fabrice's avatar
fabrice committed
148
                            default=None, help="configuration file")
fabrice's avatar
fabrice committed
149
150
        parser.add_argument("--nolog", action="store_true",
                            default=False, help="Don't generate log files")
151
        parser.add_argument("-d", "--debug", dest="verbose", default=False,
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
152
153
                            action='store_true',
                            help="Increase output verbosity")
fabrice's avatar
fabrice committed
154
155
156
157
158
        # Create subcommands
        self._create_subparsers(parser.add_subparsers(dest="command"))
        return parser

    def _create_subparsers(self, parser):
159
160
        """
        Generate subcommands
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
161
162
163
164
165
166
167
168
169
170

        Parameters
        ----------
        parser :
            argparser object

        Returns
        -------

        
fabrice's avatar
fabrice committed
171
172
173
        """
        for index, command in enumerate(self.command_list):
            # Create subparser defined in command list
174
            subcommand = getattr(self, "_" + command + "_argparser")(
175
                desc=self.desc_list[index])
fabrice's avatar
fabrice committed
176
177
            parser.add_parser(command, parents=[subcommand])

178
    def _setup_argparser(self, desc=None):
179
180
        """
        setup opt & args
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
181
182
183
184
185
186
187
188
189
190

        Parameters
        ----------
        desc :
            command descriptor (Default value = None)

        Returns
        -------

        
fabrice's avatar
fabrice committed
191
192
193
194
195
196
197
198
        """
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
        # Options
        # Args
        group = parser.add_argument_group('required arguments')
        group.add_argument("seq", action=ReadableFile,
                           help="sequence file [FASTA]")
Fabrice Allain's avatar
Fabrice Allain committed
199
200
        # group.add_argument("sspred", action=ReadableFile,
        #                    help="secondary structure prediction file")
201
        group.add_argument("infiles", nargs="*", metavar="infile",
fabrice's avatar
fabrice committed
202
203
204
205
206
207
208
209
210
                           action=ReadableFile,
                           help="contact or pdb file(s) used to build aria "
                                "distance restraints")
        group.add_argument("-d", "--distfile", dest="distfile",
                           help="Pdb or distance matrix iif distance_type "
                                "set  to   distfile in conf  file,  "
                                "use distances in the  given file as "
                                "target  distance to build  distance "
                                "restraints")
Fabrice Allain's avatar
Fabrice Allain committed
211
212
213
214
        group.add_argument("-s", "--ssfile", dest="sspred", action=ReadableFile,
                           help="secondary structure prediction file")
        group.add_argument("-p", "--ariaproject", dest="ariaproject",
                           action=ReadableFile,
215
216
                           help="ARIA project file used to initialize a new "
                                "project with contact map data.")
217
218
        group.add_argument("-t", "--type",
                           nargs="*", dest="contact_types",
fabrice's avatar
fabrice committed
219
220
                           choices=self.contact_types, help="Infile(s) contact "
                                                            "type(s)")
221
222
223
224
225
        group.add_argument("-r", "--range", dest="seqrange", default=(1, -1),
                           help="Index range if we don't want tu use the whole "
                                "sequence and map",
                           type=seqrange_type)
        group.add_argument("-n", "--native", dest="ref",
fabrice's avatar
fabrice committed
226
227
228
229
230
                           help="Native pdb. Allow TP/FP detection.")
        group.add_argument("--hb", dest="hb",
                           help="H-bonds contact file (eg: metapsicov.hb)")
        group.add_argument("--ssidx", dest="ssidx", action="store_true",
                           default=False, help="Use secondary structure index")
231
232
        group.add_argument("--no-filter", dest="no_filter", action="store_true",
                           default=False, help="Do not filter contact map.")
Fabrice Allain's avatar
Fabrice Allain committed
233
        group.add_argument("--extract-all", dest="extractall", action="store_true",
234
                           default=False, help="Extract data or all data and "
Fabrice Allain's avatar
Fabrice Allain committed
235
236
                                               "parameters if an ARIA project"
                                               "is defined with -p option")
fabrice's avatar
fabrice committed
237
238
        return parser

239
    def _bbconv_argparser(self, desc=None):
240
241
        """
        bbconv opt & args
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
242
243
244
245
246
247
248
249
250
251

        Parameters
        ----------
        desc :
            command descriptor (Default value = None)

        Returns
        -------

        
fabrice's avatar
fabrice committed
252
253
254
255
256
257
258
259
260
261
262
        """
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
        # args
        parser.add_argument("contactfile", help="contacts file (pconsc, plm)",
                            action=ReadableFile)
        parser.add_argument("sspred", help="psipred file",
                            action=ReadableFile)
        parser.add_argument("seq", help="sequence file [FASTA]",
                            action=ReadableFile)
        parser.add_argument("msa", nargs='?',
Fabrice Allain's avatar
Fabrice Allain committed
263
                            help="MSA [FASTA] used to compute diversityvalue ")
fabrice's avatar
fabrice committed
264
265
266
267
268
        parser.add_argument("-t", "--type", required=True, dest="contact_type",
                            choices=self.contact_types, help="Infile contact "
                                                             "type")
        return parser

269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
    @staticmethod
    def _iniconv_argparser(desc=None):
        """
        iniconv opt & args

        Parameters
        ----------
        desc :
            command descriptor (Default value = None)

        Returns
        -------


        """
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
        # args
        parser.add_argument("confiles", nargs='+',
                            type=str, help="config files")
        return parser

291
    def _maplot_argparser(self, desc=None):
292
293
        """
        maplot opt & args
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
294
295
296
297
298
299
300
301
302
303

        Parameters
        ----------
        desc :
            command descriptor (Default value = None)

        Returns
        -------

        
fabrice's avatar
fabrice committed
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
        """
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
        parser.add_argument("seq", action=ReadableFile,
                            help="sequence file [FASTA]")
        parser.add_argument("sspred", action=ReadableFile,
                            help="secondary structure prediction file")
        parser.add_argument("infiles", nargs="+", metavar="infile",
                            action=ReadableFile,
                            help="contact or pdb file(s) used to build aria "
                                 "distance restraints")
        parser.add_argument("-t", "--type", required=True,
                            nargs="+", dest="contact_types",
                            choices=self.contact_types, help="Infile(s) "
                                                             "contact "
                                                             "type(s)")
fabrice's avatar
fabrice committed
320
321
322
        parser.add_argument("--merge", nargs="+", dest="merge",
                            choices=self.contact_types,
                            help="Merge given contact types with other maps")
323
        parser.add_argument("--filter", dest="filter", action="store_true",
324
325
                            default=False, help="Use contact list filter "
                                                "and top n contacts selection")
fabrice's avatar
fabrice committed
326
327
328
        parser.add_argument("--onlyreport", dest="onlyreport",
                            action="store_true",
                            default=False, help="Generate only report file")
Fabrice Allain's avatar
Fabrice Allain committed
329
330
        parser.add_argument("--no-filter", dest="no_filter", action="store_true",
                            default=False, help="Do not filter contact map.")
fabrice's avatar
fabrice committed
331
332
333
        parser.add_argument("--ssidx", dest="ssidx", action="store_true",
                            default=False,
                            help="Use secondary structure index")
Fabrice Allain's avatar
Fabrice Allain committed
334
335
336
337
338
339
        parser.add_argument("--prefix", dest="prefix", action="store_true",
                            default="",
                            help="Generate prefix for file names")
        parser.add_argument("--prefixname", dest="prefixname",
                            default="",
                            help="Prefix name for file names")
fabrice's avatar
fabrice committed
340
341
        return parser

Fabrice Allain's avatar
Fabrice Allain committed
342
    @staticmethod
343
    def _pdbqual_argparser(desc=None):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
344
        """
345
        
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
346
347
348
349
350
351
352
353
354
355
356

        Parameters
        ----------
        desc :
            (Default value = None)

        Returns
        -------

        
        """
Fabrice Allain's avatar
Fabrice Allain committed
357
358
359
360
361
362
363
364
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
        parser.add_argument("infiles", nargs="+", metavar="infile",
                            action=ReadableFile,
                            help="PDB file(s) used to run quality tools with "
                                 "aria API")
        return parser

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
365
    @staticmethod
366
    def _analysis_argparser(desc=None):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
367
        """
368
        
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
369
370
371
372
373
374
375
376
377
378
379

        Parameters
        ----------
        desc :
            (Default value = None)

        Returns
        -------

        
        """
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
380
381
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
382
383
384
        parser.add_argument("project", action=ReadableFile,
                            help="ARIA project file [XML]")
        parser.add_argument("iteration", metavar="iteration_path",
385
                            action=ReadableFile,
386
                            help="Iteration path used to run violation analysis")
387
388
389
        parser.add_argument(
            "listname", metavar="list_name",
            help="Name of restraint list analyzed in the tbl file")
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
390
391
        parser.add_argument("-r", "--ref", dest="ref",
                            help="Native pdb. Allow TP/FP detection.")
392
393
394
395
        parser.add_argument("-d", dest="restraint", default=None,
                            help="Distance restraint file (XML) used for "
                                 "violation analysis. Otherwise, use restraints"
                                 " of the current iteration")
396
397
398
        parser.add_argument("-p", "--prefixname", dest="prefixname",
                            default=None,
                            help="Prefix name for file names")
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
399
400
        return parser

401
402
    @staticmethod
    def _tbl2xml_argparser(desc=None):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
403
        """
404
        
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
405
406
407
408
409
410
411
412
413
414
415

        Parameters
        ----------
        desc :
            (Default value = None)

        Returns
        -------

        
        """
416
417
418
419
420
421
422
423
424
425
426
427
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
        parser.add_argument(
            "molecule", metavar="molecule.xml", action=ReadableFile,
            help="ARIA XML molecule file")
        parser.add_argument("listname", metavar="list_name",
                            help="Restraint list name in the tbl file")
        parser.add_argument("infiles", nargs="+", metavar="infile.tbl",
                            action=ReadableFile,
                            help="TBL distance restraint file(s)")
        return parser

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
428
429
    @staticmethod
    def _pdbdist_argparser(desc=None):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
430
        """
431
        
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
432
433
434
435
436
437
438
439
440
441
442

        Parameters
        ----------
        desc :
            (Default value = None)

        Returns
        -------

        
        """
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
443
444
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
445
        # TODO: find a way to list all cullpdb file in package ressources
446
447
448
449
        # Maybe move this args to the config file

        # Culled pdb list are actually saved in data/cullpdb folder with yymmdd
        # pattern as naming convention
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
450
        parser.add_argument(
451
            "--cullist", dest="cullpdbs", default='',
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
452
            metavar="CULLED_PDB_LIST", action=ReadableFile,
453
454
455
            help="Culled list of pdb files from PISCES server ["
                 "G. Wang and R. L. Dunbrack, Jr. PISCES: a protein sequence "
                 "culling server. Bioinformatics, 19:1589-1591, 2003.]")
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
456
        parser.add_argument(
457
            "--pdbdir", dest="pdbdir", default='',
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
458
459
460
461
            metavar="PDB_FOLDER",
            help="Folder containing pdb file entries")
        return parser

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
    @staticmethod
    def _pdbstat_argparser(desc=None):
        """


        Parameters
        ----------
        desc :
            (Default value = None)

        Returns
        -------


        """
        parser = argp.ArgumentParser(description=desc,
                                     add_help=False)
        # TODO: find a way to list all cullpdb file in package ressources
        # Maybe move this args to the config file

        # Culled pdb list are actually saved in data/cullpdb folder with yymmdd
        # pattern as naming convention
        parser.add_argument(
            "pdbdists", action=ReadableFile,
            help="PDB distance file in csv format")
487
        parser.add_argument(
488
489
490
            "-j", dest="njobs", default=None, metavar="N_JOBS",
            help="Number of cpus used to run mixture in parallel. By default,"
                 " use max of available cpus."
491
        )
492
493
494
495
        parser.add_argument(
            "--min", dest="minflag", action="store_true", default=False,
            help="Compute stats only on a minimized list of atom (CA, CB and 1 "
                 "SC)")
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
496
497
        return parser

fabrice's avatar
fabrice committed
498
    def create_settings(self):
499
500
        """Create settings relative to args.command"""

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
501
        if self.args.verbose:
Fabrice Allain's avatar
Fabrice Allain committed
502
503
            LOG.info("Toggle on debug mode")
            logging.getLogger().setLevel(logging.DEBUG)
504
        LOG.info("Initialize settings")
505
        settings = AriaEcSettings(self.args.command)
506
        LOG.debug("Loading default config file")
fabrice's avatar
fabrice committed
507
        if self.args.conf_file:
508
            LOG.info("Updating settings according to config file")
fabrice's avatar
fabrice committed
509
510
            settings.load_config(self.args.conf_file)
        # Update settings associated to command section
511
        LOG.debug("Updating %s args settings", self.args.command)
512
        LOG.debug(self.args.__dict__)
513
514
        getattr(settings, self.args.command).args.update(format_dict(self.args.__dict__))
        LOG.debug(getattr(settings, self.args.command).args)
fabrice's avatar
fabrice committed
515
        if self.args.output_directory:
516
            LOG.debug("Output directory: %s", self.args.output_directory)
fabrice's avatar
fabrice committed
517
518
519
520
            settings.infra = self.args.output_directory
        return settings

    def run(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
521
        """call method relative to args.command"""
522
        LOG.debug("Run %s command", self.args.command)
fabrice's avatar
fabrice committed
523
524
525
        getattr(self, self.args.command)()

    def setup(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
526
        """Setup call"""
fabrice's avatar
fabrice committed
527
528
529
530
        setup_inst = AriaEcSetup(self.create_settings())
        setup_inst.run()

    def bbconv(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
531
        """bbcontacts converter call"""
fabrice's avatar
fabrice committed
532
533
534
        bbconverter = AriaEcBbConverter(self.create_settings())
        bbconverter.run()

535
    def maplot(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
536
        """instantiate AriaEcContactmap with AriaSettings"""
fabrice's avatar
fabrice committed
537
538
539
        econtactmap = AriaEcContactMap(self.create_settings())
        econtactmap.run()

Fabrice Allain's avatar
Fabrice Allain committed
540
    def pdbqual(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
541
        """Quality run subcommand"""
Fabrice Allain's avatar
Fabrice Allain committed
542
543
544
        qualprot = AriaEcPdbqual(self.create_settings())
        qualprot.run()

545
    def tbl2xml(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
546
        """tbl2xml command"""
547
548
        tblconverter = AriaEcXMLConverter(self.create_settings())
        tblconverter.run_tbl2xml()
fabrice's avatar
fabrice committed
549

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
550
    def pdbdist(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
551
        """Extract pdb distance distributions"""
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
552
553
554
        inst = PDBDist(self.create_settings())
        inst.run()

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
555
556
557
558
559
    def pdbstat(self):
        """Analyse pdb distance distribution"""
        inst = PDBStat(self.create_settings())
        inst.run()

560
    def analysis(self):
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
561
        """Extended ensemble analysis of distance restraints"""
562
        inst = EnsembleAnalysis(self.create_settings())
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
563
564
        inst.run()

565
566
567
568
    def iniconv(self):
        inst = AriaEcConfigConverter(self.create_settings())
        inst.run()

569

570
def main():
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
571
    """Launch ariaec command interface"""
572

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
573
    mylog = CustomLogging(desc=__doc__)
574

575
    command = AriaEcCommands(custom_logging=mylog)
576
577
578
579

    command.run()


fabrice's avatar
fabrice committed
580
581
582
if __name__ == "__main__":
    # Test AriaEcCommand object
    logging.basicConfig(level=logging.DEBUG)
583
    LOG = logging.getLogger("IO")
584
    AriaEcCommands()