Skip to content

Instantly share code, notes, and snippets.

View padix-key's full-sized avatar

Patrick Kunzmann padix-key

View GitHub Profile
@padix-key
padix-key / uff.ff
Created April 20, 2021 12:53
UFF force field parameters
# Values are taken from
# Rappe et al.
# "UFF, a Full Periodic Table Force Field
# for Molecular Mechanics and Molecular Dynamics Simulations"
# J Am Chem Soc, 114, 10024-10035 (1992)
# https://doi.org/10.1021/ja00051a040
#
# valence nonbond
# ------------ --------------------------
# type bond angle distance energy scale charge
@padix-key
padix-key / conf.py
Created June 10, 2021 11:28
sphinxcontrib-bibtex #253
#### General ####
extensions = ["sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinxcontrib.bibtex"]
templates_path = ["templates"]
@padix-key
padix-key / cysteine_sasa.py
Created June 20, 2021 14:56
Solvent accessible surface area of cysteine residues
import numpy as np
import biotite.structure as struc
import biotite.structure.io.pdbx as pdbx
import biotite.database.rcsb as rcsb
path = rcsb.fetch("1aki", "pdbx", ".")
pdbx_file = pdbx.PDBxFile.read(path)
atoms = pdbx.get_structure(pdbx_file, model=1)
sasa_per_atom = struc.sasa(atoms)
sasa_per_residue = struc.apply_residue_wise(atoms, sasa_per_atom, np.nansum)
@padix-key
padix-key / download_protein_family.py
Last active April 19, 2022 08:37
This script downloads a number of random protein structures with a given structural classification and writes the relevant protein chain into a mmCIF file.
from os.path import join, isdir
from os import mkdir
import numpy as np
import biotite.structure as struc
import biotite.structure.io.pdb as pdb
import biotite.structure.io.pdbx as pdbx
import biotite.database.rcsb as rcsb
# The structural classifier
@padix-key
padix-key / combined_plots.py
Created April 28, 2022 14:11
Example script that demonstrates how to combine different multi-row plots
# Code source: Patrick Kunzmann
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import biotite
import biotite.sequence as seq
import biotite.sequence.graphics as graphics
import biotite.sequence.io.genbank as gb
@padix-key
padix-key / plot_alignment.py
Created June 30, 2022 15:11
Coloring MSA based on associated value
import numpy as np
import matplotlib.pyplot as plt
import biotite.sequence as seq
import biotite.sequence.align as align
import biotite.sequence.graphics as graphics
sequences = [
seq.ProteinSequence(seq_str) for seq_str
in ("BIQTITE", "TITANITE", "BISMITE", "IQLITE")
]
@padix-key
padix-key / removal.py
Created September 27, 2022 10:56
Removal of incomplete residues
import numpy as np
import biotite.structure as struc
import biotite.structure.io.mmtf as mmtf
import biotite.structure.info as info
import biotite.database.rcsb as rcsb
def remove_incomplete_residues(atoms):
include_mask = np.zeros(atoms.array_length(), dtype=bool)
residue_starts = struc.get_residue_starts(atoms, add_exclusive_stop=True)