https://github.com/JoaoRodrigues/sc-teaching/tree/master/intermediate-python-2020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import decimal | |
def frange(start, stop, step, include_stop=True): | |
"""Range-like function that accepts decimal step values.""" | |
# To avoid rounding issues | |
# We cast the floats to string and then to decimals | |
# see: docs on Decimal(0.1) != Decimal('0.1') | |
dstep = decimal.Decimal(str(step)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Script to benchmark Bio.PDB PDBParser on a collection | |
of PDB files. | |
""" | |
import argparse | |
import gzip | |
import pathlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Python script to reimage/unwrap an MD simulation trajectory | |
ran on the Anton2 supercomputer. | |
Expects a topology file in .dms format and the trajectory | |
folder '.dtr'. | |
Requires: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2019 João Pedro Rodrigues | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import absolute_import, print_function | |
import collections | |
import re | |
import numpy as np | |
import warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Queries Uniprot database and retrieves (canonical) sequences. | |
""" | |
import argparse | |
import sys | |
import urllib.request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bio import Entrez | |
Entrez.email = None # change this! | |
assert Entrez.email is not None | |
# Read ids from file to a list | |
id_list = [ ... ] | |
results = {} | |
handle = Entrez.efetch(db="protein", id=id_list, retmode="xml") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REMARK 200 Generated with PyMOL and psico | |
ATOM 1 CY MET A 1 -57.588 1.993 21.439 1.00 0.00 C | |
ATOM 2 OY MET A 1 -58.412 1.073 21.529 1.00 0.00 O | |
ATOM 3 CAY MET A 1 -57.792 3.297 22.180 1.00 0.00 C | |
ATOM 4 N MET A 1 -56.540 1.838 20.704 1.00 0.00 N | |
ATOM 5 CA MET A 1 -56.332 0.585 19.985 1.00 0.00 C | |
ATOM 6 C MET A 1 -54.885 0.158 20.046 1.00 0.00 C | |
ATOM 7 O MET A 1 -54.053 0.864 20.614 1.00 0.00 O | |
ATOM 8 CB MET A 1 -56.802 0.738 18.512 1.00 0.00 C | |
ATOM 9 CG MET A 1 -58.316 0.961 18.308 1.00 0.00 C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PSF CMAP | |
7 !NTITLE | |
REMARKS original generated structure x-plor psf file | |
REMARKS 2 patches were applied to the molecule. | |
REMARKS topology C:/Users/joaor/Downloads/toppar/top_all36_prot.rtf | |
REMARKS topology C:/Users/joaor/Downloads/toppar/top_all22_prot.rtf | |
REMARKS segment A { first ACE; last CT3; auto angles dihedrals } | |
REMARKS patch CT3 A:27 | |
REMARKS patch ACE A:1 |
NewerOlder