{"id":15347381,"url":"https://github.com/vtlim/dihedral-scan","last_synced_at":"2025-10-25T10:06:07.890Z","repository":{"id":182914670,"uuid":"161549525","full_name":"vtlim/dihedral-scan","owner":"vtlim","description":"Compute dihedral scan in some molecule, such as to compare an MM force field to QM results.","archived":false,"fork":false,"pushed_at":"2020-01-23T01:07:25.000Z","size":3187,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-22T17:07:34.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vtlim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-12-12T21:50:37.000Z","updated_at":"2022-11-03T14:47:35.000Z","dependencies_parsed_at":"2023-07-22T04:10:02.340Z","dependency_job_id":null,"html_url":"https://github.com/vtlim/dihedral-scan","commit_stats":null,"previous_names":["vtlim/dihedral-scan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vtlim/dihedral-scan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtlim%2Fdihedral-scan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtlim%2Fdihedral-scan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtlim%2Fdihedral-scan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtlim%2Fdihedral-scan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vtlim","download_url":"https://codeload.github.com/vtlim/dihedral-scan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtlim%2Fdihedral-scan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280936404,"owners_count":26416553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T11:33:04.375Z","updated_at":"2025-10-25T10:06:07.863Z","avatar_url":"https://github.com/vtlim.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Light validation of small molecule force field\nLast updated: Mar 07 2019  \nThis instructions list subdirectory names for each step for easier locating of relevant files.\n\n## Contents\nBrief high-level overview of contents in this repository.\n```\n.\n├── 01_setup\n│   ├── 01_setup-dihedrals.tcl\n│   ├── 02_pdbPsiInput.sh\n│   ├── 03_NAMDinput.sh\n│   ├── minimize.inp\n│   └── psfgen\n│       ├── psfgen-02\n│       ├── psfgen-03\n│       └── psfgen.tcl\n├── 02_analysis\n│   ├── 01_atom-labels\n│   ├── 02_parse-diheds\n│   └── view_namd_scan.tcl\n├── dihed_namd\n│   ├── 0\n│   └── 5\n├── dihed_psi4\n│   ├── 0\n│   │   ├── dihed-0.pdb\n│   │   └── mp2-631Gd\n│   └── 5\n│       ├── dihed-5.pdb\n│       └── mp2-631Gd\n├── init_namd\n├── init_psi4\n├── LICENSE\n├── psf_from_charmm\n├── README.md\n└── slurm_scripts\n\n19 directories, 65 files\n```\n\n## I. Force field generation\n\n1. Drew structure in MarvinSketch.\n    * Saved as Tripos mol2 for CGenFF.\n\n2. [`./cgenff`] Uploaded to [CGenFF](https://cgenff.umaryland.edu/), and downloaded resulting .str file.\n    * Unchecked \"Guess bond orders from connectivity\"\n    * Unchecked \"Include parameters that are already in CGenFF\"\n    * Unchecked \"Use CGenFF legacy v1.0\"\n    * Edited the name after `RESI` to `GBIN` (use the resname code you want)\n    * NOTE: CGenFF website summary page says current FF version is 3.0.1 but this is NOT correct according to str header and Mackerell website.\n\n3. [`./cgenff/`] Generate PDB file for NAMD.\n    * [convertExtension.py](https://github.com/vtlim/off_psi4/blob/master/tools/convertExtension.py)\n    * `python convertExtension.py -i gbi-neutral-cgenff.mol2 -o gbi-neutral-cgenff.pdb`\n    * Checked out the structure in VMD. Marvin did not generate a very good starting structure.\n    * Edited PDB to have resname and segname of `GBIN`.\n\n4. [`./01_setup/psfgen/`] Generate PSF file for NAMD.\n    * Command: `vmd -dispdev none gbi-neutral-cgenff.pdb -e psfgen.tcl \u003e psfgen.out`\n    * NOTE: See `psf_from_charmm` directory in this repo for an alternate approach.\n\n5. [`./02_analysis/01_atom-labels/`] Label atom numbers in VMD. Generate image to refer to later when altering atom types or choosing atoms for dihedral scan.\n    * Modify displayed label at Graphics \u003e Labels \u003e Properties \u003e Format to `%a::%t`\n    * Did this one by one but probably could write Tcl script if larger ligand, based on `label textformat Atoms 15 { %a::%t  }`\n    * Do not render as (Tachyon, Postscript) since messes up label location. Cluster super slow, so I just screenshotted.\n\n## II. Comparison of QM and MM minimum energy structures\nNOTE: This section walks through NAMD minimization before QM minimization.\nIf you want QM calcns on your input structure to CGenFF, the `init_psi4/opt_mmff.py` script may be helpful. \nIt uses the Quanformer package: \u003chttps://github.com/MobleyLab/quanformer\u003e.\nHowever, instead of installing the package, you can download the relevant modules from Github and call similar to [here](https://github.com/vtlim/off_psi4/blob/master/examples/frozen_atoms/example.py).\n\n6. [`./init_namd/`] Minimize in NAMD. \n    * Do this prior to full scan bc starting Marvin coordinates are garbage.\n\n7. Analyze minimized MM structure in VMD. This will be used as input for QM.\n    * Load the `.psf` file and minimized `.coor` file.\n    * If structure needs manual rearrangement (e.g., if not planar when you know it should be, or if you want to consider additional conformations)\n        * VMD move atom: press `5`, click atom, move atom with mouse.\n        * VMD move group of atoms: create new representation (`Graphics` \u003e `Representations`) with selected atoms, press `9`, rotate/translate with mouse.\n        * [VMD manual](https://www.ks.uiuc.edu/Research/vmd/current/ug/node33.html)\n    * For each structure, `File` \u003e `Save coordinates` \u003e select `all` atoms. Save as `.pdb` or `.xyz` format.\n\n8. [`./init_psi4/`] Geometry minimize with QM using Psi4.\n    * Directly lifted coordinates from previous step for Psi4 input file. \n\n9. Compare minimized structures from steps 6 and 8 in VMD.\n    * Based on agreement of minima structures, you may need to change atom types. In that case, remember to regenerate the psf file (step 4).\n    * When I added improper terms in str file, it wasn't recognized by psfgen. So I modified the generated PSF directly.\n        * In the `2 !NIMPHI: impropers` subheading, I added the atom numbers for new impropers (4 atoms/improper).\n        * Also incremented subheader value next to NIMPHI by number of impropers added.\n        * See example in `01_setup/psfgen/` comparing the PSF in `psfgen-02` and `psfgen-03` .\n    * Also had to fix some of the atom name columns in the last column of generated PDB file bc some were missing.\n\n## III. Comparison of QM and MM dihedral scan profiles\n\n10. Analyze molecule to prepare for dihedral scan.\n    * Identify atoms to be rotated.\n        * Example: H9, N5, C8, N4, H8, H7, H6, not N3\n    * Identify PDB numbers corresponding to above.\n        * Example: 22 13 11 12 21 20 19\n    * Determine which atoms will define dihedral angle.\n        * Example: N2 C7 N3 C8 (8 9 10 11)\n\n11. [`./01_setup/`] Generate structures for dihedral scan.\n    * Subtract 1 from PDB numbers for use in Tcl script with VMD, and for NAMD\n    * But use the PDB numbers as in when restraining in Psi4\n    * Edit and run `01_setup-dihedrals.tcl`\n        * Name of input PDB\n        * Where output PDBs are written\n        * Atom numbers of whole group to be rotated\n        * Atom numbers of the four atoms to define dihedral. \n            * NOTE: Order matters. Atoms should be listed in order, with central atoms in middle. If [A B C D] does not work, try [D C B A].\n    * Edit and run `02_pdbPsiInput.sh`\n        * Main directory location\n        * Name of theory subdirectory\n        * Atom numbers to be frozen\n        * Method and basis set used\n        * Any other desired QM parameters\n    * Edit and run `03_NAMDinput.sh`\n        * Main directory location\n        * Name of reference input file\n        * Atom numbers of the dihedral for restraint\n\n12. Run the QM and MM jobs.\n\n13. [`./02_analysis/02_parse-diheds`] Analyze scans.\n    * Get NAMD dihedral output angle from .coor files.\n        * `vmdt -e ../12_analysis/get_namd_diheds.tcl -args /DFS-B/DATA/mobley/limvt/3_neutral/11_setup-namd/psfgen-03/gbin_psfgen.psf 7 8 9 10`\n        * May want to sort resulting dat file (in vim: `:sort n`).\n    * Compute/draw the profiles.\n        * `python dihed_parser.py --qdir /path/to/qm_results/ --qfile output.dat --mdir /path/to/mm_results/ --mfile minimize.out --show --save`\n\n14. [`./02_analysis/03_view`] View results.\n    * TODO: add view scripts\n\n\n## Notes to VTL\n\nSources of example materials:\n * PSF: `/DFS-B/DATA/mobley/limvt/3_neutral/11_setup-namd/psfgen-03/gbin_psfgen.psf`\n * PDB: `/DFS-B/DATA/mobley/limvt/3_neutral/init_namd2/03_point-out/final.pdb`\n * init NAMD input: `/DFS-B/DATA/mobley/limvt/3_neutral/init_namd2/minimize.inp`\n * init Psi4 input: `/DFS-B/DATA/mobley/limvt/3_neutral/init_psi4/01_mp2-631Gd/input.dat`\n * dihed NAMD input: `/DFS-B/DATA/mobley/limvt/3_neutral/dihed_namd`\n * dihed Psi4 input: `/DFS-B/DATA/mobley/limvt/3_neutral/dihed_psi4`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtlim%2Fdihedral-scan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvtlim%2Fdihedral-scan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtlim%2Fdihedral-scan/lists"}