Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sobolevnrm on github.
  • I am sobolevnrm (https://keybase.io/sobolevnrm) on keybase.
  • I have a public key ASDSulnHmWBMl1ElCpaE8N8q4jdIuCeT0a2LP6DvMgAh-wo

To claim this, I am signing this object:

@sobolevnrm
sobolevnrm / WHATIF2AMBER.sed
Created December 23, 2020 02:33
Convert WHATIF-style atom names to AMBER
# Convert all bases to ribo form (i.e., not deoxy)
s/ U / RU /g
s/ G / RG /g
s/ C / RC /g
s/ A / RA /g
# Convert U 'H5' to H5''
s/ 'H5' RU / H5'' RU /g
s/ 'HO2 RU / H2'' RU /g
@sobolevnrm
sobolevnrm / weiner86-param.dat
Created December 23, 2020 02:27
Additional PDB2PQR forcefield information
ACE DUMM 0.00000 0 0 0.000
ACE DUMM 0.00000 0 0 1.000
ACE DUMM 0.00000 0 0 1.000
ACE H1 0.01000 0 0 1.000
ACE CH3 -0.14200 0 0 1.090
ACE H2 0.01000 0 0 1.090
ACE H3 0.01000 0 0 1.090
ACE C 0.61600 0 0 1.530
ACE O -0.50400 0 0 1.229
ALA DUMM 0.00000 0 0 0.000
@sobolevnrm
sobolevnrm / c-alpha.dat
Created December 23, 2020 02:03
C-alpha force field for PDB2PQR
! C-alpha parameters for residues. 4.8 Å radius chosen based on work by
! D. Sept and A. Elcock
ALA CA 0.0000 0.000 0.000 4.8000
ARG CA 1.0000 0.000 0.000 4.8000
ASN CA 0.0000 0.000 0.000 4.8000
ASP CA -1.0000 0.000 0.000 4.8000
CYS CA 0.0000 0.000 0.000 4.8000
GLN CA 0.0000 0.000 0.000 4.8000
GLU CA -1.0000 0.000 0.000 4.8000
GLY CA 0.0000 0.000 0.000 4.8000
@sobolevnrm
sobolevnrm / amber-param.dat
Created December 23, 2020 01:58
AMBER parameters for APBS
CHARMM23
! all-atom charges and radii from amber94 parameter set
! note that polar hydrogens are given radius 1A here
!
! Converted to UHBD format by A. Elcock
! Ribo and URA params added in from AMBER data by N. Baker
!
resi atom chrg epsi sigm radi end
!
TE TE 1.00 0.000 0.000 0.000
@sobolevnrm
sobolevnrm / ris.py
Created August 21, 2016 02:07
A very simple RIS file parser
""" Process RIS format following the standard at",
http://referencemanager.com/sites/rm/files/m/direct_export_ris.pdf """
import re
ALLOWED_TAGS = {"TY" : "Record start",
"ER" : "Record end",
"A2" : "Secondary author",
"A3" : "Tertiary Author",
"A4" : "Subsidiary Author",
"AB" : "Abstract",
@sobolevnrm
sobolevnrm / pdb-query.xml
Created December 23, 2015 23:37
Find PDB structures which are good candidates for pKa calculations.
<orgPdbCompositeQuery version="1.0">
<resultCount>45981</resultCount>
<queryId>A646F4B6</queryId>
<queryRefinement>
<queryRefinementLevel>0</queryRefinementLevel>
<orgPdbQuery>
<version>head</version>
<queryType>org.pdb.query.simple.NumberOfChainsQuery</queryType>
<description>Number of Chains Search : Min Number of Chains=1 Max Number of Chains=1</description>
<queryId>14430407</queryId>
@sobolevnrm
sobolevnrm / generic_ctor.py
Created November 24, 2015 18:35
I am trying to create the object of a class when I have only the string of the class name avoiding a bunch of conditionals
# I have lots of classes with very similar constructors. I'd like to avoid a huge if elseif ... statement
# This works when all classes are specified in the global scope but breaks across modules -- it also doesn't seem very safe
class Foo:
def __init__(self):
self.bar = "FOOBAR"
class_name = "Foo"
ctor = globals()[class_name]
obj = ctor()
print(obj.bar)
"""
Transform exported data from OmniFocus into RememberTheMilk Smart Add file. Fields from
OmniFocus are expected to be:
Task ID,Type,Name,Status,Project,Context,Start Date,Due Date,Completion Date,Duration,Flagged,Notes
"""
import csv
import sys
from datetime import datetime
@sobolevnrm
sobolevnrm / Things extractor.scpt
Created October 25, 2015 01:54
Applescript to extract tasks from Things.app
tell application "Things"
set todo_output to "
"
repeat with the_list in lists
set list_name to name of the_list
set list_todos to to dos of the_list
repeat with the_todo in list_todos
if status of the_todo is open then
set todo_name to name of the_todo
set todo_due to due date of the_todo