Skip to content

Instantly share code, notes, and snippets.

View leelasd's full-sized avatar
🏠
Working from home

Leela S. Dodda leelasd

🏠
Working from home
View GitHub Profile
This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown)
using [knitr](http://yihui.name/knitr/) in Rstudio 0.96.
This combination of tools provides an exciting improvement in usability for
[reproducible analysis](http://stats.stackexchange.com/a/15006/183).
Specifically, this post
(1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96;
(2) provides a basic example of producing console output and plots using R Markdown;
(3) highlights several code chunk options such as caching and controlling how input and output is displayed;
(4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and
(5) discusses the implications of R Markdown.
#!/usr/bin/env ruby
#
# This script is a wrapper around pandoc that uses pandoc's
# builtin citeproc support to generate a markdown bibliography
# from bibtex.
#
# Inspired by Jacob Barney's [bib2mkd][] script.
#
# [bib2mkd]: http://jmbarney.dyndns.org/?/linux/bib2mkd/
#
@leelasd
leelasd / github-pages.md
Last active August 29, 2015 14:26 — forked from mattnorris/github-pages.md
How to create a GitHub page using Jekyll and Bootstrap

Creating Whispernote's GitHub Project Page

Jekyll, GitHub's static site generator, and Bootstrap were used to create Whispernote's GitHub Project Page. This document shows how.

Project Goals

I wanted a stylish "brand" page for my project, and I wanted to reuse the README file I had created without a lot of copy/pasting. GitHub's Jekyll allowed me to essentially embed the file as a partial. What I got was really an enhanced README file (thanks to some jQuery and Bootstrap), which is exactly what I wanted.

gh-pages

@leelasd
leelasd / contacts.py
Created January 2, 2016 02:00 — forked from bougui505/contacts.py
compute h-bonds with chimera. Launch it with chimera --nogui --script 'contacts.py structure.pdb'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# for chimera 1.4
from chimera import runCommand
import sys
rec_file = sys.argv[1]
basename = rec_file.split('/')[-1].split('.')[0]
#runCommand("open 0 receptor.pdb")
runCommand("open 0 %s"%rec_file)
runCommand("hbonds intramodel true distSlop 0.65 angleSlop 80 saveFile output/%s_hbonds.txt namingStyle serial"%basename)
@leelasd
leelasd / chimera_cli.py
Created January 2, 2016 02:07 — forked from jaimergp/chimera_cli.py
Use UCSF Chimera IDLE directly in terminal, no GUI
"""
Experimental wrapper to use Chimera's Python directly from console.
You can `import chimera` with no errors!
Usage
=====
1. Alias your /path/to/chimera/bin/python binary to something more user-friendly, like `chimerapy`.
2. Download these two files and put them together
3. Run `chimerapy -i chimera_cli.py`. (Tip: Realias `chimerapy` to this command).
@leelasd
leelasd / dcdreporter.py
Created February 9, 2016 04:56
Hacked DCDReporter for OpenMM allowing unwrapped coordinates
"""
dcdreporter.py: Outputs simulation trajectories in DCD format
This is part of the OpenMM molecular simulation toolkit originating from
Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2012 Stanford University and the Authors.
Authors: Peter Eastman
from __future__ import print_function
from simtk.openmm import app
import simtk.openmm as mm
from simtk import unit
from sys import stdout
pdb = app.PDBFile('water256_bulk_tip5p.pdb')
#pdb = app.PDBFile('a.pdb')
#pdb = app.PDBFile('water14_cluster.pdb')
boxDim = 19.3996888399961804/10.
@leelasd
leelasd / recap.py
Created January 19, 2017 21:12 — forked from anonymous/recap.py
import openbabel
# Copyright 2009 TJ O'Donnell
class recap:
# RECAP-Retrosynthetic Combinatorial Analysis Procedure
# J. Chem. Inf. Comput. Sci. 1998, 38, 511-522
def __init__(self, mol, minsize=5):
self.mol = mol;
# minimum allowed size (atom count) of fragment
self.minsize = minsize;
# bonded atom pairs populated by the apply method,
@leelasd
leelasd / conf_gen.py
Created March 3, 2017 18:37 — forked from tdudgeon/conf_gen.py
Conformer generation using RDKit
import sys
from rdkit import Chem
from rdkit.Chem import AllChem, TorsionFingerprints
from rdkit.ML.Cluster import Butina
def gen_conformers(mol, numConfs=100, maxAttempts=1000, pruneRmsThresh=0.1, useExpTorsionAnglePrefs=True, useBasicKnowledge=True, enforceChirality=True):
ids = AllChem.EmbedMultipleConfs(mol, numConfs=numConfs, maxAttempts=maxAttempts, pruneRmsThresh=pruneRmsThresh, useExpTorsionAnglePrefs=useExpTorsionAnglePrefs, useBasicKnowledge=useBasicKnowledge, enforceChirality=enforceChirality, numThreads=0)
return list(ids)
@leelasd
leelasd / RecapAndBricsTutorial.ipynb
Created March 17, 2017 16:31 — forked from greglandrum/RecapAndBricsTutorial.ipynb
RDKit BRICS and RECAP Tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.