Quick and dirty charge filtering

From DISI
Jump to navigation Jump to search

Filtering a list of SMILES by charge requires more steps than expected prima facie. No software tool (to my knowledge) calculates both major microspecies and charge. Thus, run the following on our cluster (cluster2) if you want to filter a larger set of molecules by formal charge:

 /nfs/home/zdingman/scripts/utilities/tranche_charges/tranche_charges.sh [input.smi] [output_prefix]

The following files are generated:

- [output_prefix].charges -- a TSV file containing the input smiles, the compound name, and the major microspecies at physiological pH

- [output_prefix]_#.smi -- a series of files where # corresponds to the major microspecies charge. Each file is in standard smi format.

- [output_prefix]_skipped.tsv -- in the event that an output from cxcalc cannot be parsed, it will be written back out as a tsv.

Known shortcomings

- I don't institute cxcalc logging. Theoretically could, in practice simpler to just print a warning to stdout, and capture that in a slurm output file

- I don't handle zwitterions. Should be fairly easy to add, but would slow the code down b/c we need to iterate over every atom and check its charge. Can add if necessary.

- The file names are kind of ugly for anions (ex. output_-2.smi) and I find that aesthetically displeasing. C'est la vie.