Skip to content

Instantly share code, notes, and snippets.

import numpy
import mrcfile
def read_mrc(mrcfilename):
"""
Read a mrc file and return the xyz and density values at the given level
if given
"""
print "Reading mrc file ..."
xyz = []
import numpy
import mrcfile
def save_density(data, grid_spacing, outfilename, origin=None):
"""
Save the density to an mrc file. The origin of the grid will be (0,0,0)
• outfilename: the mrc file name for the output
"""
print "Saving mrc file ..."
data = data.astype('float32')
#!/usr/bin/env sh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2019-03-28 10:17:12 (UTC+0100)
fzf_preview () {
if [ -d $1 ]; then
ls --color='always' $1
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-11-19 16:26:10 (UTC+0100)
import __main__
__main__.pymol_argv = [ 'pymol', '-cqi' ]
import pymol
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-11-19 16:26:10 (UTC+0100)
import __main__
__main__.pymol_argv = [ 'pymol', '-cqi' ]
import pymol
#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-09-07 09:08:56 (UTC+0200)
# read a passwdcard to get a password
PASSWDCARD="$HOME/.20180514_passwdcard.txt"
#!/usr/bin/env python
# -*- coding: UTF8 -*-
from pymol import cmd
from pymol import stored
import struct
def save2traj (selection,name,format="dcd"):
#Author: Sean Law
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-11-19 16:26:10 (UTC+0100)
import __main__
__main__.pymol_argv = [ 'pymol', '-cqi' ]
import pymol
#!/usr/bin/env python3
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-11-19 16:26:10 (UTC+0100)
from pymol import cmd
import sys
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-11-19 16:26:10 (UTC+0100)
import __main__
__main__.pymol_argv = [ 'pymol', '-cqi' ]
import pymol