Skip to content

Instantly share code, notes, and snippets.

@bougui505
bougui505 / dock_footprints.in
Created April 4, 2014 09:47
dock input file to generate footprints
ligand_atom_file LIG
limit_max_ligands no
skip_molecule no
read_mol_solvation no
calculate_rmsd no
use_database_filter no
orient_ligand no
use_internal_energy no
flexible_ligand no
bump_filter no
@bougui505
bougui505 / README.rst
Last active August 29, 2015 13:59
inadyn.conf file for Freedns (afraid.org). Location in /etc/inadyn.conf

Open the url:

http://freedns.afraid.org/dynamic/

Login with your account

Select the link Direct URL beside <your_host>.ignorelist.com

Copy everything from the right of the ? in the address bar (alphanumeric string)

@bougui505
bougui505 / polarplot.py
Created April 22, 2014 10:38
polar plot with python
def cartesian_to_spherical(xyz):
ptsnew = np.zeros(xyz.shape)
xy = xyz[:,0]**2 + xyz[:,1]**2
ptsnew[:,0] = np.sqrt(xy + xyz[:,2]**2)
ptsnew[:,1] = np.arctan2(np.sqrt(xy), xyz[:,2]) # for elevation angle defined from Z-axis down
#ptsnew[:,4] = np.arctan2(xyz[:,2], np.sqrt(xy)) # for elevation angle defined from XY-plane up
ptsnew[:,2] = np.arctan2(xyz[:,1], xyz[:,0])
return ptsnew
def polar_projection(coords, center, rid=1, color=None, c=None, alpha=1, rows=1, columns=1, linewidth=1, s=25, threed=True, cmap=cm.jet):
@bougui505
bougui505 / pdb_to_png.py
Created April 29, 2014 14:00
Create a png image from a pdb using pymol
#!/usr/bin/env python
# -*- coding: UTF8 -*-
"""
author: Guillaume Bouvier
email: guillaume.bouvier@ens-cachan.org
creation date: 2014 04 29
license: GNU GPL
Please feel free to use and modify this, but keep the above information.
Thanks!
"""
@bougui505
bougui505 / beamer_transparency.tex
Last active August 29, 2015 14:00
To manage transparency with latex beamer and acrobat reader
\pdfpageattr{/Group <</S /Transparency /I true /CS /DeviceRGB>>} %To manage transparency with latex beamer and acrobat reader
@bougui505
bougui505 / dockprep.py
Last active November 27, 2017 11:37
run dock prep from command line with: chimera --nogui file.pdb dockprep.py outfilename.mol2
import chimera
from DockPrep import prep
models = chimera.openModels.list(modelTypes=[chimera.Molecule])
prep(models)
from WriteMol2 import writeMol2
writeMol2(models, "dp.mol2")
@bougui505
bougui505 / ssh_config
Last active August 29, 2015 14:01
ssh ProxyCommand. Replace distant_hostname by the hostname of the distant machine to connect, ssh_server by the server accessible from your local machine and distant_machine by the machine you want to connect through ssh_server. File must be placed in ~/.ssh/config.
Host distant_hostname
User your_username
ProxyCommand ssh user@ssh_server exec nc distant_machine 22
@bougui505
bougui505 / splitpdb.sh
Last active August 29, 2015 14:01
split a pdb file with awk
awk '$0 ~ /ATOM 1/ {i++} {print >> "pdbs/smap_"i".pdb"} {fflush("pdbs/smap_"i".pdb")}' smap.pdb
@bougui505
bougui505 / file_monitor.sh
Last active August 29, 2015 14:01
Real time plot with gnuplot. Usage: ./file_monitor.sh dms/smap_\*_no_H.dms
#!/bin/bash
# -*- coding: UTF8 -*-
infile="$1"
outfile=/dev/shm/nfiles.txt
t_0=$(date +"%s")
for i in $(seq 1 10)
do
t=$(date +"%s")
delta_t=$(($t-$t_0))
nfiles=$(echo $infile | wc -w)
@bougui505
bougui505 / strip_hydrogens.py
Created May 20, 2014 10:54
Remove hydrogens from a pdb or mol2 file
#!/usr/bin/env python
# -*- coding: UTF8 -*-
"""
author: Guillaume Bouvier
email: guillaume.bouvier@ens-cachan.org
creation date: 2014 05 20
license: GNU GPL
Please feel free to use and modify this, but keep the above information.
Thanks!
"""