Skip to content

Instantly share code, notes, and snippets.

View leelasd's full-sized avatar
🏠
Working from home

Leela S. Dodda leelasd

🏠
Working from home
View GitHub Profile
@leelasd
leelasd / center.sh
Created April 1, 2017 12:33 — forked from cstein/center.sh
How to center a molecule from an MD-simulation in Gromacs
#!/usr/bin/env bash
TRAJIN=traj.xtc
TRAJOUT=trajfin.xtc
# delete the trajectory so gromacs wont display silly backup messages
if [ -e $TRAJOUT ]
then
rm -f $TRAJOUT
fi
@leelasd
leelasd / center.sh
Created April 1, 2017 12:33 — forked from cstein/center.sh
How to center a molecule from an MD-simulation in Gromacs
#!/usr/bin/env bash
TRAJIN=traj.xtc
TRAJOUT=trajfin.xtc
# delete the trajectory so gromacs wont display silly backup messages
if [ -e $TRAJOUT ]
then
rm -f $TRAJOUT
fi
@leelasd
leelasd / run_md-npt.sh
Created November 6, 2017 16:02 — forked from kmtu/run_md-npt.sh
Produce a cpt file every 1 ns for NPT run (for Gromacs ver. 4)
#PBS -l nodes=2:ppn=12
#PBS -N JobName
cd ${PBS_O_WORKDIR}
NPROCS=`wc -l <$PBS_NODEFILE`
MPIRUN="mpirun -machinefile $PBS_NODEFILE -n $NPROC"
export GMX_MAXBACKUP=1000 # max number of gro backup
GMDIR=/home/kmtu/local/gromacs-4.6.6/bin
@leelasd
leelasd / atom_pair_distances.py
Created April 22, 2018 02:06 — forked from kyleabeauchamp/atom_pair_distances.py
Calculate specific atom pair distances with MDTraj
import itertools
import mdtraj, mdtraj.geometry
import pandas as pd
traj = mdtraj.load("./traj.xtc", top="native.pdb")
top, bonds = traj.top.to_dataframe()
atoms = np.array(["H", "HA", "N", "CA", "C", "CB"])
@leelasd
leelasd / split_complex_v2.py
Created November 29, 2018 19:23 — forked from PatWalters/split_complex_v2.py
An improved script to extract a ligand from a protein-ligand complex and assign bond orders
#!/usr/bin/env python
import sys
from prody import *
from rdkit import Chem
from rdkit.Chem import AllChem
from io import StringIO
import pypdb
@leelasd
leelasd / dupe.py
Created July 3, 2020 19:03 — forked from PatWalters/dupe.py
Compare two SMILES or SD files to identify duplicate structures. Duplicates are identified by comparing InChI keys
#!/usr/bin/env python
import sys
import os
from rdkit import Chem
def molecule_supplier_from_name(input_file_name):
ext = os.path.splitext(input_file_name)[-1]
if ext == ".smi":
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leelasd
leelasd / run_md.py
Created August 10, 2020 20:44 — forked from dwhswenson/run_md.py
Simple OpenMM-based MD from Gromacs files
#!/usr/bin/env python
# coding: utf-8
##########################################################################
# this script was generated by openmm-builder. to customize it further,
# you can save the file to disk and edit it with your favorite editor.
##########################################################################
# REQUIRES:
# * OpenMM (core dynamics)
@leelasd
leelasd / bio_align.py
Created September 30, 2020 18:25 — forked from JoaoRodrigues/bio_align.py
Sequence-based structure alignment of protein structures with Biopython
#!/usr/bin/env python
"""Sequence-based structural alignment of two proteins."""
import argparse
import pathlib
from Bio.PDB import FastMMCIFParser, MMCIFIO, PDBParser, PDBIO, Superimposer
from Bio.PDB.Polypeptide import is_aa
@leelasd
leelasd / hydrophobic_moment.py
Created September 30, 2020 18:26 — forked from JoaoRodrigues/hydrophobic_moment.md
Peptide/Protein Hydrophobic Moment Calculator
#!/usr/bin/env python
"""
Calculates a set of properties from a protein sequence:
- hydrophobicity (according to a particular scale)
- mean hydrophobic dipole moment assuming it is an alpha-helix.
- total charge (at pH 7.4)
- amino acid composition
- discimination factor according to Rob Keller (IJMS, 2011)