Skip to content

Instantly share code, notes, and snippets.

@matthen
matthen / hello_world.py
Last active July 1, 2024 05:08
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List
@GeauxEric
GeauxEric / dockedpose.py
Last active February 7, 2022 03:46 — forked from baoilleach/dockedpose.py
Using Open Babel to calculate the symmetry-corrected RMSD of a docked pose from a crystal structure
import math
import pybel
def squared_distance(coordsA, coordsB):
"""Find the squared distance between two 3-tuples"""
sqrdist = sum((a - b)**2 for a, b in zip(coordsA, coordsB))
return sqrdist
@platinhom
platinhom / 0-AmberScripts.md
Last active February 8, 2024 02:24
Some scripts for Amber

This gist contains some scripts for Amber.

  • anteligand.sh: Use antechamber to prepare a ligand for Amber
  • complex_tleap.sh: Use tleap to prepare a ligand-protein complex input parameter file (Amber14)
  • checkPDBID_MDprep.sh: After running many preparation jobs for PDB ligand-protein complexes, you should check whether the preparation is done.
  • rename_water.py: rename water to HOH O,H1,H2 for PDB/PQR

Maybe need some other tools installed, such as pdb2pqr and g09 and so on.

@scientificprotocols
scientificprotocols / protocol.md
Last active February 7, 2022 03:44
Isothermal titration calorimetry to determine the association constants for a ligand bound simultaneously to two specific protein binding sites with different affinities
Authors: Giorgio Pochetti & Roberta Montanari

Abstract

It could be very useful in drug development to determine the relative affinities of a ligand that can bind to a protein with two (or more) different and specific binding sites. X-ray crystallography is a very powerful technique to determine the locations and describe the features of each binding site but it is unuseful to establish their relative affinities. Moreover, the stoichiometry of binding observed in the crystal structure of a complex could be an artifact of the crystallization conditions.

On the contrary, isothermal titration calorimetry (ITC) can be used to assign the correct stoichiometry of the association, depending on the initial and final concentration ratio between ligand and protein, and to establish the affinity for each specific binding site, if combined with structural information from X-ray crystallography.

@andersx
andersx / pbconstraint.py
Created December 4, 2013 09:33
Constraint optimization in Python with Open Babel
import openbabel as ob
# Standard openbabel molecule load
conv = ob.OBConversion()
conv.SetInAndOutFormats('xyz','xyz')
mol = obOBMol()
conv.ReadFile(mol,'my_mol.xyz')
# Define constraints
constraints = ob.OBFFConstraints()
@rmcgibbo
rmcgibbo / neb.py
Created January 30, 2013 03:51
Nudged Elastic Band in Python
from __future__ import division
import numpy as np
import IPython as ip
import matplotlib.pyplot as pp
import warnings
from collections import namedtuple
import scipy.optimize
#symbolic algebra
import theano
import math
import pybel
def sqr_dist(a, b):
ac = a.coords
bc = b.coords
return (ac[0]-bc[0])**2 + (ac[1]-bc[1])**2 + (ac[2]-bc[2])**2
# Definitions taken from
# http://baoilleach.blogspot.com/2007/07/pybel-hack-that-sd-file.html