Skip to content

Commit

Permalink
Delete codvid. i
Browse files Browse the repository at this point in the history
old commit
  • Loading branch information
forrestbicker committed Jan 10, 2024
1 parent ef754d3 commit f34ae4a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": "Python: Current File",
"type": "python",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "C:\\Users\\bicke\\anaconda3\\envs\\csi\\python.exe"
}
24 changes: 24 additions & 0 deletions src/identify_dihedrals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import sys
import MDAnalysis as mda
from MDAnalysis.topology.guessers import guess_bonds, guess_angles, guess_dihedrals

if len(sys.argv) != 2:
print("Usage: python identify_dihedrals.py <topology>")
sys.exit(1)
else:
u = mda.Universe(sys.argv[1])

n_bonds = len(u.bonds)
print(f'{len(u.bonds)} bonds specified in original file')

u.add_TopologyAttr('bonds', guess_bonds(u.atoms, u.atoms.positions)) # add additional bonds using same bond guessing algoritm as VMD
print(f'{len(u.bonds) - n_bonds} additional bonds guessed')
u.add_TopologyAttr('angles', guess_angles(u.bonds)) # add angles in order to be able to calculate dihedrals
u.add_TopologyAttr('dihedrals', guess_dihedrals(u.angles)) # add dihedrals

print(f'{len(u.dihedrals)} dihedrals found. Outputting atom IDs:')

# print id of all atoms in every dihedral
for i, dihedral in enumerate(u.dihedrals):
ids = [str(a.id) for a in dihedral]
print(' ' + ' '.join(ids))
7 changes: 4 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@


# ================= User Input ================= #
topology = 'inputs/pkA_run3.psf'
trajectory = 'inputs/pkA_run3.dcd'
topology = 'inputs/new/step3_input.psf'
trajectory = 'inputs/new/pkka_run6_skip2.dcd'

residue_list = ['ALA', 'DGLU', 'DLYS'] # list of ammino acids to be CoarseGrained
residue_list = ['ALA', 'DALA', 'LYS', 'DGLU', 'GLU', 'DLYS'] # list of ammino acids to be CoarseGrained
# residue_list = ['ALA']
# residue_list = ['DA', 'DT', 'DG', 'DC', 'PHOSPHATE', 'RIBOSE']


# ================= Execution ================= #
u = generate_universe(topology, trajectory)
sim_name = get_file_name(topology)

u_cg = coarse_grain(u, residue_list, simulation_name=sim_name, export=True)
measurement_dict = parametize(u_cg, export=True)
startup_manual_refining(measurement_dict, u_cg)
Expand Down

0 comments on commit f34ae4a

Please sign in to comment.