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.
- 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_destination_folder(parser)[source]¶
Add destination folder argument.
Accepts also a TAR file path.
- Parameters:
parser (argparse.ArgumentParser object)
- 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_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_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_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 amain
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.