| MetaSite user manual | ||
|---|---|---|
| <<< Previous | ||
Chapter 5. Command-line interface
MetaSite command-line execution is controlled by script files written in a simple declarative language. The desired program workflow is this way represented by the sequential execution of command statements. Although very simple, this language is intended to provide a level of flexibility similar to the one implemented by the graphical interface: scripts may open/save and operate on MetaSite3 document files so that command-line and GUI execution may alternate freely (user may for example import object and perform calculations from the command-line and then use the GUI to browse results).
5.1. Invocation
MetaSite command-line execution is started by the metasite-cli command:
metasite-cli [-h] [-q] [-v level ] [-l log_file ] {COMMAND_FILE}
The -h (help) option produces some versioning and basic usage informations.
The -q (quiet) option suppresses the output on the console. It overrides option -v, but it doesn't affect log to file (option -l).
-v (verbosity) controls the level of detail in the information produced on the console (level must be in range 1 to 3).
The -l option activates logging to file. log_file can be any writable file path.
COMMAND_FILE is the only mandatory argument and represents the path to the script file that will control MetaSite execution.
5.2. Command file reference
A legal MetaSite script file consists in a sequence of command statements. Each statement is terminated by a semicolon (;) and may be freely formatted. Comments begin with a dash (#) character and extend up to the end of the line. Blank lines (either empty or only containing spacing characters) are ignored.
5.2.1. Settings statements
This group of statements operates on program settings and preferences.
5.2.1.1. Set temporary files directory
set temp directory {"path"};
Specify the directory MetaSite will use to store temporary files. Notice: path must be enclosed in double quotes.
5.2.1.2. Set system enzymes library path
set system library {"path"};
Specify system library file locations. Notice: path must be enclosed in double quotes.
5.2.1.3. Set user's enzymes library path
set user library {NO | "path"};
Specify if MetaSite has to use an additional custom library, and in case, the path where the corresponding library file is located. Notice: path must be enclosed in double quotes.
5.2.1.4. Conformers generation settings
set conformers {NO | max_number };
Specify if conformational sampling is to be performed as part of the processing of imported structures, and in case it is, the maximum number of generated conformers.
5.2.1.5. Set protonation policy
set protonation {AS_IS | NEUTRALIZE | NORMALIZE {pH}};
Specify if structures are to be imported in the original protonation state, if a neutral form is to be enforced or if protonation is to be determined by the provided pH value.
5.2.1.6. Set minimum mass of generated metabolites
set metabolite minimum mass {mass_value};
Instructs the metabolites generation engine to discard metabolites below a threshold mass value. A null minimum mass disables this filtering option.
5.2.1.7. Set metabolites redundancy policy
set metabolite ignore redundant {NO | mass_fraction};
Some metabolic reaction mechanisms imply the cleavage of specific bonds (e.g dealkylation). In these cases the same reaction may take to the generation of more than one single metabolite. Sometimes, when one of the produced metabolites is much smaller than the other, its presence is not considered significant and the associated information is therefore considered as redundant. This command allows the user to set a threshold value for the metabolite mass percentage respect to the original substrate mass. When this filtering is activated and a group of metabolites is formed from the same reaction, metabolites with a mass fraction below the given the threshold are considered as redundant and discarded.
5.2.1.8. Set metabolites stereochemistry options
set metabolite ignore stereo {YES | NO};
During metabolites generation user has a choice to take tethrahedral stereochemistry into account or not.
5.2.1.9. Enable/disable reaction mechanisms in metabolites generation
set metabolite enable reaction {"reaction1","reaction2",...} {YES | NO};
Specify a list of reactions and whether they should enabled or not during the metabolites generation procedure. All reaction mechanisms are by default enabled, so this command is mostly useful in case the user wants to switch-off a specific subset of metabolit pathways.
Names of reaction mechanism are to be enclosed in double quotes. This is the list of names currently implemented and recognized.
"Aliphatic Hydroxylation"
"Aliphatic Hydroxylation"
"Aromatic Hydroxylation"
"Acetylenic Hydroxylation (t)"
"Alkyne Oxidation"
"Alkyne Hydroxylation"
"Aldehydic Hydroxylation"
"Desulphuration"
"Alcoholic Oxidation"
"Olefinic Epoxidation"
"N-Dealkylation"
"O-Dealkylation"
"S-Dealkylation"
"Epoxidic S-Oxidation"
"Thiolic Hydroxylation"
"Thioetheric S-Oxidation"
"Sulphoxidic S-Oxidation"
"Aliphatic N-Oxidation"
"Aliphatic N-Hydroxylation"
"Anilinic Hydroxylation"
"Aromatic N-Oxidation"
"Conjugated N-Hydroxylation"
"Amine Dehydrogenation"
5.2.2. File statements
This group of statements allows the CLI to manipulate MetaSite document files.
5.2.2.1. New
new;
Creates a new empty document, discarding any eventually unsaved data present in current document.
5.2.2.2. Open
open {"path"};
Opens an existing MetaSite document file. Full path to the file must be specified. Unsaved data eventually present in the current document will be discarded.
5.2.2.3. Save
save [as {"path"} ];
Save current document. If keyword "as" followed by a path to a MetaSite document file is specified, current document will be saved under the given file path. If a file with the same name already exists it will be overwritten. If the "as" clause is omitted, the document will be saved under the current file path; please notice that a current file path only exists only if "save as" or "open" were previously called. A save statement, not followed by an "as" clause, has no effect if a current file path is not defined.
5.2.3. Import statements
Statements in this group execute the import of substrate structures from different formats.
5.2.3.1. Import of MOL2 files
import MOL2 {"path"} [name by [UID | FILE_NAME | STRUCTURE_NAME] ];
Import structures contained in a mol2 or multimol2 file. The path to the file has to be enclosed in double quotes. A policy for object name assignment can be optionally specified; if none is specified, names are based on a unique identified (UID).
5.2.3.2. Import of SDF files
import SDF {"path"} [name by [UID | FILE_NAME | STRUCTURE_NAME | TAG {"tag_name"}] ];
Import structures contained in a mol2 or multimol2 file. The path to the file has to be enclosed in double quotes. A policy for object name assignment can be optionally specified; if none is specified defaults to by UID. If TAG is specified, the exact name of the SD tag must be provided. If any of the structures contained in SDF lacks such tag, the naming procedure for those structures falls back to UID.
5.2.3.3. Import of a SMILES string
import SMILES {"smiles_string"} [name by [UID | string {"name"}] ];
Imports the passed SMILES string. The SMILES string has to be enclosed in double quotes. A policy for object name assignment can be optionally specified; if none is specified defaults to by UID.
5.2.3.4. Import of a SMILES list file
import SMILES list {"path"}format [SMILES | SMILES_NAME | NAME_SMILES];
Import a text file containing a list of SMILES strings; this list must have one of these formats:
One smiles per line
Each line contains smiles string and smiles name separated by blanks.
Each line contains smiles name and smiles string separated by blanks.
5.2.4. Compute statements
Command statements in this group control the excution of the prediction procedures implemented by MetaSite.
5.2.4.1. Compute Site of Metabolism predictions
compute som {LIVER | SKIN | BRAIN | "cypname1","cypname2",};
Performs a site of metabolism prediction on all of the objects in the current dataset. User can specify one of the avaiable consensus models or a list of CYPs.
5.2.4.2. Run metabolites identification
compute metabolite {LIVER | SKIN | BRAIN | "cypname1","cypname2",};
Performs a metabolites identification on all the objects in the current dataset. User can specify one of the avaiable consensus models or a list of CYPs.
5.2.4.3. Run prediction of the MBI character
compute mbi {"cypname1","cypname2",...};
Performs a prediction of the MBI character of all the objects in the current dataset. User should specify the names for one or more CYP models.
5.2.5. Export statements
Statements in this group allow the user to export the produced data to different file formats.
5.2.5.1. Export Site of Metabolism predictions
export som as SDF = {"file_path"};
Exports site of metabolism predictions as an SDF file. User must provide the path to a writable output file. In case a file with the same name already exists it is overwritten.
5.2.5.2. Export Metabolite ID data
export metabolite {LIVER | SKIN | BRAIN | "cypname"}as CSV = {"file_path"};
Exports the Metabolite ID results for all of the objects in the current dataset and the given enzyme model. User must provide the path to a writable output file. In case a file with the same name already exists it is overwritten.
5.2.5.3. Export MBI predictions
export mbi as {CSV | SDF}= {"file_path"};
Exports MBI predictions results as either a CSV or an SDF file. User must provide the path to a writable output file. In case a file with the same name already exists it is overwritten.
5.3. Examples
The following script illustrates the import of input objects from different file formats and how to run a site of metabolism prediction. Finally, the processed data is saved into a document file.
# examples/example1.txt
#
# This example shows how to import structures in various formats and how to
# compute Site of Metabolism predictions.
# set parameters
# NOTICE: at this stage database file wasn't already created, so if you want
# to specify a custom working (i.e. writeable) location in the filesystem,
# this is the right moment
set temp directory "/tmp";
set system library "../../dist/data/system.mel";
# import some structures in different formats
import MOL2 "../test/test.mol2" name by STRUCTURE_NAME;
import SDF "../test/test.sdf" name by TAG "NAME";
import SMILES list "../test/list2.smi" format SMILES_NAME;
# perform Site of Metabolism prediciton for CYP2C9
# NOTICE: som computations are performed on all structures in dataset
compute som "CYP2C9";
# perform a consensus Site of Metabolism prediction for LIVER system
compute som "LIVER";
# last, save our work in a .ms3 file
save as "example1.ms3";
|
The document file created by the previous script may be opened and explored from the MetaSite GUI or it may be subject further processing by the next sample script:
# examples/example2.txt
#
# This example shows how to open existing .ms3 files and perform Metabolites
# Identification selecting a subset of avaiable reactions.
# set generic parameters
set temp directory "/tmp";
set system library "../../dist/data/system.mel";
# set spefific parameters for metabolites generation
#
# do not ignore redundant metabolites
set metabolite ignore redundant NO;
# ignore metabolites stereochemistry
set metabolite ignore stereo YES;
# disable certain reactions during metabolites generation
set metabolite enable reaction
"ACETYLENIC_HYDROXYLATION_T",
"ALKYNE_OXIDATION",
"ALKYNE_HYDROXYLATION"
NO;
# open file created by running example1.txt
open "example1.ms3";
# run metabolites identification with liver consensus prediction
compute metabolite LIVER;
# save results in the same file, example1.ms3
save;
|
Next script shows how MBI prediction is invoked:
# examples/example3.txt
#
# This example shows how to perform MBI.
# set generic parameters
set temp directory "/tmp";
set system library "../../dist/data/system.mel";
# import some structures from a SMILES list file
import SMILES list "../test/list3.smi" format SMILES_NAME;
# compute mbi for a series of CYPs
compute mbi "CYP3A4", "CYP3A4-m";
# save results into a new file, example3.ms3
save as "example3.ms3";
|
| <<< Previous | Home | |
| Using the MetaSite GUI |