Lib CLI

Operations shared by client interfaces.

class idpconfgen.libs.libcli.AllParam(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Convert list of arguments in tuple.

class idpconfgen.libs.libcli.ArgsToTuple(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Convert list of arguments in tuple.

class idpconfgen.libs.libcli.CSV2Tuple(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Convert list of arguments in tuple.

idpconfgen.libs.libcli.CheckExt(extensions)[source]

Check extension for arguments in argument parser.

class idpconfgen.libs.libcli.CustomParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]

Custom Parser class.

error(message)[source]

Present error message.

class idpconfgen.libs.libcli.FolderOrTar(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Controls if input is folder, files or tar.

class idpconfgen.libs.libcli.ListOfIntsPositiveSum(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Convert list of str to list of ints.

class idpconfgen.libs.libcli.ListOfPositiveInts(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Create list of positive integers from input string.

Raises error if non-positive integers are given.

class idpconfgen.libs.libcli.ParamsToDict(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Convert command-line parameters in an argument to a dictionary.

Adapted from https://github.com/joaomcteixeira/taurenmd

Example

Where -x is an optional argument of the command-line client interface.

>>> par1=1 par2='my name' par3=[1,2,3]
>>> {'par1': 1, 'par2': 'my name', 'par3': [1, 2, 3]}
class idpconfgen.libs.libcli.ReadDictionary(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Read to a dictionary.

class idpconfgen.libs.libcli.SeqOrFasta(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Read sequence of FASTA file.

idpconfgen.libs.libcli.add_argument_chunks(parser)[source]

Add fragments argument.

For those routines that are split into operative fragments.

idpconfgen.libs.libcli.add_argument_cif(parser)[source]

Add command to prioritize downloading CIF parser.

idpconfgen.libs.libcli.add_argument_cmd(parser)[source]

Add the command for the external executable.

idpconfgen.libs.libcli.add_argument_dany(parser)[source]

Add argument –dany.

idpconfgen.libs.libcli.add_argument_db(parser)[source]

Add argument to store path from database.

idpconfgen.libs.libcli.add_argument_decimals(parser)[source]

Add decimals to parser.

idpconfgen.libs.libcli.add_argument_degrees(parser)[source]

Add degree argument to parser.

idpconfgen.libs.libcli.add_argument_destination_folder(parser)[source]

Add destination folder argument.

Accepts also a TAR file path.

Parameters:

parser (argparse.ArgumentParser object)

idpconfgen.libs.libcli.add_argument_dhelix(parser)[source]

Add argument –dhelix.

idpconfgen.libs.libcli.add_argument_dloopoff(parser)[source]

Add argument –dloop-off.

idpconfgen.libs.libcli.add_argument_dstrand(parser)[source]

Add argument –dstrand.

idpconfgen.libs.libcli.add_argument_duser(parser)[source]

Add argument –duser.

idpconfgen.libs.libcli.add_argument_idb(parser)[source]

Add argument for input database.

idpconfgen.libs.libcli.add_argument_minimum(parser)[source]

Add argument for minimum size of fragments.

idpconfgen.libs.libcli.add_argument_ncores(parser)[source]

Add argument for number of cores to use.

idpconfgen.libs.libcli.add_argument_nohnterm(parser)[source]

Add boolean flag to H in N-terminal.

idpconfgen.libs.libcli.add_argument_output(parser)[source]

Add argument for general output string.

idpconfgen.libs.libcli.add_argument_output_folder(parser)[source]

Add argument for general output string.

idpconfgen.libs.libcli.add_argument_pdb_files(parser)[source]

Add PDBs Files entry to argument parser.

Parameters:

parser (argparse.ArgumentParser object)

idpconfgen.libs.libcli.add_argument_pdbids(parser)[source]

Add arguments for PDBIDs.

This differs from add_parser_pdbs() that expects paths to files.

idpconfgen.libs.libcli.add_argument_plot(parser)[source]

Add argument for plotting parameters.

Plot kwargs that will be passed to the plotting function. If given, plot results. Additional arguments can be given to specify the plot parameters.

Adapted from: https://github.com/joaomcteixeira/taurenmd/blob/6bf4cf5f01df206e9663bd2552343fe397ae8b8f/src/taurenmd/libs/libcli.py#L539-L570

Defined by --plot.

idpconfgen.libs.libcli.add_argument_random_seed(parser)[source]

Add argument to select a random seed number.

idpconfgen.libs.libcli.add_argument_record(parser)[source]

Add argument to select PDB RECORD identifier.

idpconfgen.libs.libcli.add_argument_reduced(parser)[source]

Add reduced argument.

idpconfgen.libs.libcli.add_argument_replace(parser)[source]

Add argument replace.

idpconfgen.libs.libcli.add_argument_seq(parser)[source]

Add argument for input sequence.

idpconfgen.libs.libcli.add_argument_source(parser)[source]

Add source argument to parser.

idpconfgen.libs.libcli.add_argument_update(parser)[source]

Add update argument to argument parser.

idpconfgen.libs.libcli.add_argument_vdWb(parser)[source]

Add argument for vdW bonds apart criteria.

Further read:

https://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/findclash/findclash.html

idpconfgen.libs.libcli.add_argument_vdWr(parser)[source]

Add argument for vdW radii set selection.

idpconfgen.libs.libcli.add_argument_vdWt(parser)[source]

Add argument for vdW tolerance.

idpconfgen.libs.libcli.add_general_arg(parser, *args, **kwargs)[source]

Add a general argument with args and kwargs.

idpconfgen.libs.libcli.add_subparser(parser, module)[source]

Add a subcommand to a parser.

Parameters:
  • parser (argparse.add_suparsers object) – The parser to add the subcommand to.

  • module – A python module containing the characteristics of a taurenmd client interface. Client interface modules require the following attributes: __doc__ which feeds the description argument of add_parser, _help which feeds help, ap which is an ArgumentParser, and a main function, which executes the main logic of the interface.

idpconfgen.libs.libcli.add_version(parser)[source]

Add version -v option to parser.

Displays a message informing the current version. Also accessible via --version.

Parameters:

parser (argparse.ArgumentParser) – The argument parser to add the version argument.

idpconfgen.libs.libcli.load_args(ap)[source]

Load argparse commands.

idpconfgen.libs.libcli.maincli(ap, main)[source]

Command-line interface entry point.

idpconfgen.libs.libcli.minimum_value(minimum)[source]

Define a minimum value for action.

idpconfgen.libs.libcli.parse_doc_params(docstring)[source]

Parse client docstrings.

Separates PROG, DESCRIPTION and USAGE from client main docstring.

Parameters:

docstring (str) – The module docstring.

Returns:

tuple – (prog, description, usage)