Skip to content

Instantly share code, notes, and snippets.

View fomightez's full-sized avatar

Wayne's Bioinformatics Code Portal fomightez

View GitHub Profile
@ehazlett
ehazlett / pub_med.py
Created July 25, 2011 16:27
Search PubMed with BioPython
#!/usr/bin/env python
# numpy and biopython are required -- pip install numpy biopython
from Bio import Entrez
from Bio import Medline
MAX_COUNT = 10
TERM = 'Tuberculosis'
print('Getting {0} publications containing {1}...'.format(MAX_COUNT, TERM))
@smukkejohan
smukkejohan / chaossearh.py
Created February 20, 2012 22:26
Python port of Paul Bourke's random strange attractor generator using lyapunov exponents
# Python port of Paul Bourke's http://local.wasp.uwa.edu.au/~pbourke/fractals/lyapunov/gen.c
# By Johan Bichel Lindegaard - http://johan.cc
import math
import random
from PIL import Image, ImageDraw
import argparse
import os
parser = argparse.ArgumentParser(description='Search for chaos.')
@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active January 22, 2024 11:18
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@fomightez
fomightez / compositioncalc1.py
Last active December 20, 2015 05:09
compositioncalc1.py from Practical Computing for Biologists by Steven H. D. Haddock and Casey W. Dunn. Posted as a Gist by Wayne Decatur (fomightez) with full credit and reference to the original authors and specifying where they freely share the code online. You can see a static IPython Notebook version at http://nbviewer.ipython.org/6077226
# code by Steven H. D. Haddock and Casey W. Dunn as described in:
# Practical Computing for Biologists
# Steven H. D. Haddock and Casey W. Dunn
# Published in 2011 by Sinauer Associates.
# ISBN 978-0-87893-391-4
# http://www.sinauer.com/practical-computing-for-biologists.html
# see practicalcomputing.org
#
#scripts freely available by the original authors at practicalcomputing.org
#DIRECT LINK: http://practicalcomputing.org/files/pcfb_examples.zip
@fomightez
fomightez / compositioncalc1.ipynb
Last active December 20, 2015 05:19
compositioncalc1.py from Practical Computing for Biologists by Steven H. D. Haddock and Casey W. Dunn AS A STATIC IPYTHON Notebook. Posted as a Gist by Wayne Decatur (fomightez) with full credit and reference to the original authors and note where the freely share the code online. You can see an interactive IPython gist of this at https://www.py…
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / compositioncalc2.py
Last active December 20, 2015 07:59
compositioncalc2.py from Practical Computing for Biologists by Steven H. D. Haddock and Casey W. Dunn. Posted as a Gist by Wayne Decatur (fomightez) with full credit and reference to the original authors and specifying where they freely share the code online. You can see a static IPython Notebook version at http://nbviewer.ipython.org/6102154
# code by Steven H. D. Haddock and Casey W. Dunn as described in:
# Practical Computing for Biologists
# Steven H. D. Haddock and Casey W. Dunn
# Published in 2011 by Sinauer Associates.
# ISBN 978-0-87893-391-4
# http://www.sinauer.com/practical-computing-for-biologists.html
# see practicalcomputing.org
#
#scripts freely available by the original authors at practicalcomputing.org
#DIRECT LINK: http://practicalcomputing.org/files/pcfb_examples.zip
@fomightez
fomightez / compositioncalc2.ipynb
Last active December 20, 2015 08:39
compositioncalc2.py from Practical Computing for Biologists by Steven H. D. Haddock and Casey W. Dunn AS A STATIC IPYTHON Notebook. Posted as a Gist by Wayne Decatur (fomightez) with full credit and reference to the original authors and note where the freely share the code online. You can see an interactive IPython gist of this at https://www.py…
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@minrk
minrk / nbstripout
Last active June 6, 2023 06:23
git pre-commit hook for stripping output from IPython notebooks
#!/usr/bin/env python
"""strip outputs from an IPython Notebook
Opens a notebook, strips its output, and writes the outputless version to the original file.
Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS.
This does mostly the same thing as the `Clear All Output` command in the notebook UI.
LICENSE: Public Domain
@sloria
sloria / bobp-python.md
Last active May 1, 2024 08:37
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@langner
langner / pubmed_search.py
Last active January 29, 2022 14:52
A class that searches Pubmed for a list of PMIDs via the BioPython Entrez module and returns the results in a simpler dictionary format.
"""Tools for searching Pubmed for a list of PMIDs.
The goal here is to search for many PMIDs at once, since searching
sequentially can take a long time. Using the the BioPython Entrez module
is super convenient to this end.
The results results are returned in a simple dictionary format.
"""