![]() |
PathLengthFingerprints.pl - Generate atom path length based fingerprints for SD files
PathLengthFingerprints.pl SDFile(s)...
PathLengthFingerprints.pl [-a, --AtomIdentifierType AtomicInvariantsAtomTypes] [--AtomicInvariantsToUse ''AtomicInvariant1,AtomicInvariant2...''] [--FunctionalClassesToUse ''FunctionalClass1,FunctionalClass2...''] [--BitsOrder Ascending | Descending] [-b, --BitStringFormat BinaryString | HexadecimalString] [--CompoundID DataFieldName or LabelPrefixString] [--CompoundIDLabel text] [--CompoundIDMode DataField | MolName | LabelPrefix | MolNameOrLabelPrefix] [--DataFields ''FieldLabel1,FieldLabel2,... ''] [-d, --DataFieldsMode All | Common | Specify | CompoundID] [--DetectAromaticity Yes | No] [-f, --Filter Yes | No] [--FingerprintsLabel text] [--fold Yes | No] [--FoldedSize number] [-h, --help] [-i, --IgnoreHydrogens Yes | No] [-k, --KeepLargestComponent Yes | No] [-m, --mode PathLengthBits | PathLengthCount] [--MinPathLength number] [--MaxPathLength number] [-n, --NumOfBitsToSetPerPath number] [--OutDelim comma | tab | semicolon] [--output SD | text | both] [-q, --quote Yes | No] [-r, --root RootName] [-p, --PathMode AtomPathsWithoutRings | AtomPathsWithRings | AllAtomPathsWithoutRings | AllAtomPathsWithRings] [-s, --size number] [-u, --UseBondSymbols Yes | No] [--UseUniquePaths Yes | No] [-q, --quote Yes | No] [-r, --root RootName] [-v, --VectorStringFormat IDsAndValuesString | IDsAndValuesPairsString | ValuesAndIDsString | ValuesAndIDsPairsString] [-w, --WorkingDir dirname] SDFile(s)...
Generate atom path length fingerprints for SDFile(s) and create appropriate SD or CSV/TSV text file(s) containing fingerprints bit-vector or vector strings corresponding to molecular fingerprints.
Multiple SDFile names are separated by spaces. 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.
The current release of MayaChemTools supports generation of path length fingerprints corresponding to following -a, --AtomIdentifierTypes:
Based on the values specified for -p, --PathMode, --MinPathLength and --MaxPathLength, all appropriate atom paths are generated for each atom in the molecule and collected in a list and the list is filtered to remove any structurally duplicate paths as indicated by the value of --UseUniquePaths option.
For each atom path in the filtered atom paths list, an atom path string is created using value of -a, --AtomIdentifierType and specified values to use for a particular atom identifier type. Value of -u, --UseBondSymbols controls whether bond order symbols are used during generation of atom path string. For each atom path, only lexicographically smaller atom path strings are kept.
For PathLengthBits value of -m, --mode option, each atom path is hashed to a 32 bit unsigned integer key using TextUtil::HashCode function. Using the hash key as a seed for a random number generator, a random integer value between 0 and --Size is used to set corresponding bits in the fingerprint bit-vector string. Value of --NumOfBitsToSetPerPaths option controls the number of time a random number is generated to set corresponding bits.
For PathLengthCount value of -m, --mode option, the number of times an atom path appears is tracked and a fingerprints count-string corresponding to count of atom paths is generated.
The current release of MayaChemTools generates the following types of path length fingerprints bit-vector and vector strings:
Possible values for atomic invariants are: AS, X, BO, LBO, SB, DB, TB, H, Ar, RA, FC, MN, SM. Default value: AS.
The atomic invariants abbreviations correspond to:
Atom type generated by AtomTypes::AtomicInvariantsAtomTypes class corresponds to:
Except for AS which is a required atomic invariant in atom types, all other atomic invariants are optional. Atom type specification doesn't include atomic invariants with zero or undefined values.
In addition to usage of abbreviations for specifying atomic invariants, the following descriptive words are also allowed:
Examples:
Benzene: Using value of AS for --AtomicInvariantsToUse, Yes for UseBondSymbols, and AllAtomPathsWithRings for -p, --PathMode, atom path strings generated are:
And using AS,X,BO for --AtomicInvariantsToUse generates following atom path strings:
Urea: Using value of AS for --AtomicInvariantsToUse, Yes for UseBondSymbols, and AllAtomPathsWithRings for -p, --PathMode, atom path strings are:
And using AS,X,BO for --AtomicInvariantsToUse generates following atom path strings:
Possible values for atom functional classes are: Ar, CA, H, HBA, HBD, Hal, NI, PI, RA. Default value [ Ref 24 ]: HBD,HBA,PI,NI,Ar,Hal.
The functional class abbreviations correspond to:
AtomTypes::FunctionalClassAtomTypes module is used to assign functional class atom types. It uses following definitions [ Ref 60-61, Ref 65-66 ]:
Ascending bit order which corresponds to first bit in each byte as the lowest bit as opposed to the highest bit.
Internally, bits are stored in Ascending order using Perl vec function. Regardless of machine order, big-endian or little-endian, vec function always considers first string byte as the lowest byte and first bit within each byte as the lowest bit.
BinaryString corresponds to an ASCII string containing 1s and 0s. HexadecimalString contains bit values in ASCII hexadecimal format.
Examples:
For DataField value of --CompoundIDMode option, it corresponds to datafield label name whose value is used as compound ID; otherwise, it's a prefix string used for generating compound IDs like LabelPrefixString<Number>. Default value, Cmpd, generates compound IDs which look like Cmpd<Number>.
Examples for DataField value of --CompoundIDMode:
Examples for LabelPrefix or MolNameOrLabelPrefix value of --CompoundIDMode:
The value specified above generates compound IDs which correspond to Compound<Number> instead of default value of Cmpd<Number>.
Possible values: DataField | MolName | LabelPrefix | MolNameOrLabelPrefix. Default: LabelPrefix.
For MolNameAndLabelPrefix value of --CompoundIDMode, molname line in SDFile(s) takes precedence over sequential compound IDs generated using LabelPrefix and only empty molname values are replaced with sequential compound IDs.
This is only used for CompoundID value of --DataFieldsMode option.
This is only used for Specify value of --DataFieldsMode option.
Examples:
No --DetectAromaticity forces usage of atom and bond aromaticity values from SDFile(s) and skips the step which detects and assigns aromaticity.
No --DetectAromaticity value is only allowed uring AtomicInvariantsAtomTypes value of -a, --AtomIdentifierType options; for all possible values -a, --AtomIdentifierType values, it must be Yes.
By default, compound data is checked before calculating fingerprints and compounds containing atom data corresponding to non-element symbols or no atom data are ignored.
Examples:
For yes value of -i, --IgnoreHydrogens, any explicit hydrogens are also used for generation of atoms path lengths and fingerprints; implicit hydrogens are still ignored.
For molecules containing multiple connected components, fingerprints can be generated in two different ways: use all connected components or just the largest connected component. By default, all atoms except for the largest connected component are deleted before generation of fingerprints.
For PathLengthBits value of -m, --mode option, a fingerprint bit-vector string containing zeros and ones is generated and for PathLengthCount value, a fingerprint vector string corresponding to number of atom paths is generated.
For molecules with no rings, first two and last two options are equivalent and generate same set of atom paths starting from each atom with length between --MinPathLength and --MaxPathLength. However, all these four options can result in the same set of final atom paths for molecules containing fused, bridged or spiro rings.
For molecules containing rings, atom paths starting from each atom can be traversed in four different ways:
AtomPathsWithoutRings - Atom paths containing no rings and without sharing of bonds in traversed paths.
AtomPathsWithRings - Atom paths containing rings and without any sharing of bonds in traversed paths.
AllAtomPathsWithoutRings - All possible atom paths containing no rings and without any sharing of bonds in traversed paths.
AllAtomPathsWithRings - All possible atom paths containing rings and with sharing of bonds in traversed paths.
Atom path traversal is terminated at the ring atom.
Based on values specified for for -p, --PathMode, --MinPathLength and --MaxPathLength, all appropriate atom paths are generated for each atom in the molecule and collected in a list.
For each atom path in the filtered atom paths list, an atom path string is created using value of -a, --AtomIdentifierType and specified values to use for a particular atom identifier type. Value of -u, --UseBondSymbols controls whether bond order symbols are used during generation of atom path string. Atom symbol corresponds to element symbol and characters used to represent bond order are: 1 - None; 2 - '='; 3 - '#'; 1.5 or aromatic - ':'; others: bond order value. By default, bond symbols are included in atom path strings. Exclusion of bond symbols in atom path strings results in fingerprints which correspond purely to atom paths without considering bonds.
UseUniquePaths controls the removal of structurally duplicate atom path strings are removed from the list.
For PathLengthBits value of -m, --mode option, each atom path is hashed to a 32 bit unsigned integer key using TextUtil::HashCode function. Using the hash key as a seed for a random number generator, a random integer value between 0 and --Size is used to set corresponding bits in the fingerprint bit-vector string. Value of --NumOfBitsToSetPerPaths option controls the number of time a random number is generated to set corresponding bits.
For PathLengthCount value of -m, --mode option, the number of times an atom path appears is tracked and a fingerprints count-string corresponding to count of atom paths is generated.
For molecule containing rings, combination of -p, --PathMode and --UseBondSymbols allows generation of up to 8 different types of atom path length strings:
Default atom path length fingerprints generation for molecules containing rings with AllAtomPathsWithRings value for -p, --PathMode, Yes value for --UseBondSymbols, 2 value for --MinPathLength and 8 value for --MaxPathLength is the most time consuming. Combinations of other options can substantially speed up fingerprint generation for molecules containing complex ring systems.
Additionally, value for option -a, --AtomIdentifierType in conjunction with corresponding specified values for atom types changes the nature of atom path length strings and the fingerprints.
Examples:
No value option for -u, --UseBondSymbols allows the generation of fingerprints corresponding purely to atoms disregarding all bonds.
No value option for --UseUniquePaths allows usage of all atom paths generated by -p, --PathMode option value for generation of atom path strings leading to duplicate path count during PathLengthCount value of -m, --mode option. It doesn't change fingerprint string generated during PathLengthBits value of -m, --mode.
For example, during AllAtomPathsWithRings value of -p, --PathMode option, benzene has 12 linear paths of length 2 and 12 cyclic paths length of 7, but only 6 linear paths of length 2 and 1 cyclic path of length 7 are structurally unique.
Examples:
To generate path length fingerprints corresponding to all unique paths from length 1 through 8 in hexadecimal bit-vector string format of size 1024 and create a SamplePLFPHex.csv file containing sequential compound IDs along with fingerprints bit-vector strings data, type:
To generate path length fingerprints corresponding to all unique paths from length 1 through 8 in hexadecimal bit-vector string format of size 1024 and create both SamplePLFPHex.csv and SamplePLFPHex.sdf files containing sequential compound IDs in CSV file along with fingerprints bit-vector strings data, type:
To generate path length fingerprints corresponding to all unique paths from length 1 through 8 in binary bit-vector string format of size 1024 and create a SamplePLFPBin.csv file containing sequential compound IDs along with fingerprints bit-vector strings data, type:
To generate path length fingerprints corresponding to count of all unique paths from length 1 through 8 in IDsAndValuesString format and create a SamplePLFPCount.csv file containing sequential compound IDs along with fingerprints vector strings data, type:
To generate path length fingerprints corresponding to count of all unique paths from length 1 through 8 in IDsAndValuesString format using E-state atom types and create a SamplePLFPCount.csv file containing sequential compound IDs along with fingerprints vector strings data, type:
To generate path length fingerprints corresponding to count of all unique paths from length 1 through 8 in IDsAndValuesString format using SLogP atom types and create a SamplePLFPCount.csv file containing sequential compound IDs along with fingerprints vector strings data, type:
To generate path length fingerprints corresponding to count of all unique paths from length 1 through 8 in IDsAndValuesString format and create a SamplePLFPCount.csv file containing sequential compound IDs along with fingerprints vector strings data, type:
To generate path length fingerprints corresponding to count of all unique paths from length 1 through 8 in IDsAndValuesString format using AS,X,BO as atomic invariants and create a SamplePLFPCount.csv file containing sequential compound IDs along with fingerprints vector strings data, type:
To generate path length fingerprints corresponding to count of all paths from length 1 through 8 in IDsAndValuesString format and create a SamplePLFPCount.csv file containing compound IDs from MolName line along with fingerprints vector strings data, type:
To generate path length fingerprints corresponding to all unique paths from length 1 through 8 in hexadecimal bit-vector string format of size 512 after folding and create both SamplePLFPHex.csv and SamplePLFPHex.sdf files containing sequential compound IDs along with fingerprints bit-vector strings data, type:
To generate path length fingerprints corresponding to all unique paths from length 1 through 8 containing no rings and without sharing of bonds in hexadecimal bit-vector string format of size 1024 and create a SamplePLFPHex.csv file containing sequential compound IDs along with fingerprints bit-vector strings data and all data fields, type:
To generate path length fingerprints corresponding to all unique paths from length 1 through 8 containing rings and without sharing of bonds in hexadecimal bit-vector string format of size 1024 and create a SamplePLFPHex.tsv file containing compound IDs derived from combination of molecule name line and an explicit compound prefix along with fingerprints bit-vector strings data and all data fields, type:
To generate path length fingerprints corresponding to count of all unique paths from length 1 through 8 in IDsAndValuesString format and create a SamplePLFPCount.csv file containing sequential compound IDs along with fingerprints vector strings data using aromaticity specified in SD file, type:
To generate path length fingerprints corresponding to all unique paths from length 2 through 6 in hexadecimal bit-vector string format of size 1024 and create a SamplePLFPHex.csv file containing sequential compound IDs along with fingerprints bit-vector strings data, type:
InfoFingerprintsSDFiles.pl, InfoFingerprintsTextFiles.pl,  SimilarityMatrixSDFiles.pl, SimilarityMatrixTextFiles.pl, AtomNeighborhoodsFingerprints.pl,  ExtendedConnectivityFingerprints.pl, MACCSKeysFingerprints.pl,  TopologicalAtomPairsFingerprints.pl, TopologicalAtomTorsionsFingerprints.pl,  TopologicalPharmacophoreAtomPairsFingerprints.pl, TopologicalPharmacophoreAtomTripletsFingerprints.pl
Copyright (C) 2004-2010 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.