Skip to content

Instantly share code, notes, and snippets.

View cvdelannoy's full-sized avatar

Carlos de Lannoy cvdelannoy

View GitHub Profile
import numpy as np
import prody as pr
from geometricus import MomentInvariants, SplitType
import plotly as py
import plotly.graph_objs as go
def make_atom_group(atom_list):
out_group = pr.atomgroup.AtomGroup('Protein')
out_group.addCoordset(atom_list)
@cvdelannoy
cvdelannoy / dssp_biopython_minimal_example.py
Created July 25, 2019 15:05
Assess accessible surface area for each amino acid in a pdb file
from Bio.PDB import PDBParser, PDBList
from Bio.PDB.DSSP import DSSP
# !! set path to mkdssp binary !! Install: https://github.com/cmbi/xssp (use docker or check dockerfile for install tips)
mkdssp_path = '/home/carlos/Downloads/xssp-3.0.8/mkdssp'
pdb_downloader = PDBList()
# Retrieve an example pdb file (for alpha-synuclein here) and load
pdb_fn = PDBList().retrieve_pdb_file('1xq8', file_format='pdb')
@cvdelannoy
cvdelannoy / multiprocessing_example.py
Created June 11, 2019 13:26
One way to use python multiprocessing module
import multiprocessing as mp
def square(x, out_queue):
out_queue.put(x ** 2)
out_list = []
out_queue = mp.Queue()
processes = [mp.Process(target=square, args=(x, out_queue)) for x in range(8)]
for p in processes: p.start()