ModifySDFilesDataFields.pl - Modify data fields in SDFile(s)
ModifySDFilesDataFields.pl SDFile(s)...
ModifySDFilesDataFields.pl [-d, --detail infolevel] [--datafieldscommon newfieldlabel, newfieldvalue, [newfieldlabel, newfieldvalue,...]] [--datafieldsmap newfieldlabel, oldfieldlabel, [oldfieldlabel,...]; [newfieldlabel, oldfieldlabel, [oldfieldlabel,...]]] [--datafieldsmapfile filename] [--datafieldURL URLDataFieldLabel, CGIScriptPath, CGIParamName, CmpdIDFieldLabel] [-h, --help] [-k, --keepolddatafields all | unmappedonly | none] [-m, --mode molname | datafields | both] [--molnamemode datafield | labelprefix] [--molname datafieldname or prefixstring] [--molnamereplace always | empty] [-o, --overwrite] [-r, --root rootname] [-w, --workingdir dirname] SDFile(s)...
Modify molname line and data fields in SDFile(s). Molname line can be replaced by a data field value or assigned a sequential ID prefixed with a specific string. For data fields and modification of their values, these types of options are supported: replace data field labels by another set of labels; combine values of multiple data fields and assign a new label; add specific set of data field labels and values to all compound records; and others.
The file names are separated by space.The valid file extensions are .sdf and .sd. All other file names are ignored. All the SD files in a current directory can be specified either by *.sdf or the current directory name.
Level of information to print about compound records being ignored. Default: 1. Possible values: 1, 2 or 3.
Specify data field labels and values for addition to each compound record. It's a comma delimited list of data field label and values pair. Default: none.
Examples:
Specify how various data field labels and values are combined to generate a new data field labels and their values. All the comma delimited data fields, with in a semicolon delimited set, are mapped to the first new data field label along with the data field values joined via new line character. Default: none.
Examples:
Filename containing mapping of data fields. Format of data fields line in this file corresponds to --datafieldsmap option. Example:
Specify how to generate a URL for retrieving compound data from a web server and add it to each compound record. URLDataFieldLabel is used as the data field label for URL value which is created by combining CGIScriptPath,CGIParamName,CmpdIDFieldLabel values: CGIScriptPath?CGIParamName=CmpdIDFieldLabelValue. Default: none.
Example:
Print this help message.
Specify how to transfer old data fields from input SDFile(s) to new SDFile(s) during datafields | both value of -m, --mode option: keep all old data fields; write out the ones not mapped to new fields as specified by --datafieldsmap or <--datafieldsmapfile> options; or ignore all old data field labels. For molname -m --mode, old datafields are always kept. Possible values: all | unmappedonly | none. Default: none.
Specify how to modify SDFile(s): molname - change molname line by another datafield or value; datafield - modify data field labels and values by replacing one label by another, combining multiple data field labels and values, adding specific set of data field labels and values to all compound, or inserting an URL for compound retrieval to each record; both - change molname line and datafields simultaneously. Possible values: molname | datafields | both. Default: molname
Specify how to change molname line for -m --mode option values of molname | both: use a datafield label value or assign a sequential ID prefixed with labelprefix. Possible values: datafield | labelprefix. Default: labelprefix.
Molname generation method. For datafield value of --molnamemode option, it corresponds to datafield label name whose value is used for molname; otherwise, it's a prefix string used for generating compound IDs like labelprefixstring<Number>. Default value, Cmpd, generates compound IDs like Cmpd<Number> for molname.
Specify when to replace molname line for -m --mode option values of molname | both: always replace the molname line using --molname option or only when it's empty. Possible values: always | empty. Default: empty.
Overwrite existing files.
New SD file name is generated using the root: <Root>.<Ext>. Default new file name: <InitialSDFileName>ModifiedDataFields.<Ext>. This option is ignored for multiple input files.
Location of working directory. Default: current directory.
To replace empty molname lines by Cmpd<CmpdNumber> and generate a new SD file NewSample1.sdf, type:
To replace all molname lines by Mol_ID data field generate a new SD file NewSample1.sdf, type:
To replace all molname lines by Mol_ID data field, map Name and CompoundName to a new datafield Synonym, and generate a new SD file NewSample1.sdf, type:
To replace all molname lines by Mol_ID data field, map Name and CompoundName to a new datafield Synonym, add common fields ReleaseDate and Source, and generate a new SD file NewSample1.sdf without keeping any old SD data fields, type:
Preparing SD files PubChem deposition:
Consider a SD file with these fields: Mol_ID, Name, Synonyms and Systematic_Name. And Mol_ID data field uniquely identifies your compound.
To prepare a new SD file CmpdDataForPubChem.sdf containing only required PUBCHEM_EXT_DATASOURCE_REGID field, type:
To prepare a new SD file CmpdDataForPubChem.sdf containing only required PUBCHEM_EXT_DATASOURCE_REGID field and replace molname line with Mol_ID, type:
In addition to required PubChem data field, you can also add optional PubChem data fields.
To map your Name, Synonyms and Systematic_Name data fields to optional PUBCHEM_SUBSTANCE_SYNONYM data field along with required ID field, type:
To add your <domain.org> as PUBCHEM_EXT_SUBSTANCE_URL and link substance retrieval to your CGI script <http://www.yourdomain.org/GetCmpd.pl,Reg_ID,Mol_ID> via PUBCHEM_EXT_DATASOURCE_REGID field along with optional and required data fields, type:
And to add a publication date and request a release data using PUBCHEM_PUBLICATION_DATE and PUBCHEM_DEPOSITOR_RECORD_DATE data fields along with all the data fields in earlier examples, type: optional fields, type:
InfoSDFiles.pl, JoinSDFiles.pl, MergeTextFilesWithSD.pl, SplitSDFiles.pl
Copyright (C) 2024 Manish Sud. All rights reserved.
This file is part of MayaChemTools.
MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.