Skip to content

Instantly share code, notes, and snippets.

View laserson's full-sized avatar

Uri Laserson laserson

View GitHub Profile
diff --git a/Bio/GenBank/Scanner.py b/Bio/GenBank/Scanner.py
index cc72e7f..18d2551 100644
--- a/Bio/GenBank/Scanner.py
+++ b/Bio/GenBank/Scanner.py
@@ -161,9 +161,17 @@ class InsdcScanner:
while line[:self.FEATURE_QUALIFIER_INDENT] == self.FEATURE_QUALIFIER_SPACER:
line = self.handle.readline()
else:
- #Build up a list of the lines making up this feature:
- feature_key = line[2:self.FEATURE_QUALIFIER_INDENT].strip()
diff --git a/Bio/GenBank/Scanner.py b/Bio/GenBank/Scanner.py
index cc72e7f..dd9d7f0 100644
--- a/Bio/GenBank/Scanner.py
+++ b/Bio/GenBank/Scanner.py
@@ -1183,7 +1183,69 @@ class GenBankScanner(InsdcScanner):
return
except StopIteration:
raise ValueError("Problem in misc lines before sequence")
+
+class ImgtScanner(EmblScanner):
import sys
import re
rev_gr_re = re.compile(r'([0-9]+)>{1}')
correct = lambda s: rev_gr_re.sub(r'>\1',s) + '\n'
if len(sys.argv) == 3:
ip = open(sys.argv[1],'r')
op = open(sys.argv[2],'w')
else:
ar: adding 50 object files to build/temp.macosx-10.4-x86_64-2.7/libarpack.a
/usr/bin/ranlib: archive member: build/temp.macosx-10.4-x86_64-2.7/libarpack.a(cgetv0.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: build/temp.macosx-10.4-x86_64-2.7/libarpack.a(cnaitr.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: build/temp.macosx-10.4-x86_64-2.7/libarpack.a(cnapps.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: build/temp.macosx-10.4-x86_64-2.7/libarpack.a(cnaup2.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: build/temp.macosx-10.4-x86_64-2.7/libarpack.a(cnaupd.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archiv
@laserson
laserson / gist:735337
Created December 9, 2010 21:04
matplotlib make.osx patch to fix libpng urls
diff --git a/make.osx b/make.osx
index d3093a7..42a4852 100644
--- a/make.osx
+++ b/make.osx
@@ -1,10 +1,11 @@
# build mpl into a local install dir with
# PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install
MPLVERSION=1.0rc1
-PYVERSION=2.6
+PYVERSION=2.7
@laserson
laserson / gist:741050
Created December 14, 2010 20:33
multinomial sample generator
import numpy as np
def multinomial_sample(n,p):
"""Return sample variates from multinomial.
In contrast with `numpy`'s multinomial sampler, this will return the actual
samples, rather than the summed results. In other words, the result of
`numpy`'s sampler is the same length as `p`, while the result of this
sampler is of length `n`.
@laserson
laserson / qiime_cluster_jobs_LSF.py
Created January 7, 2011 04:35
Qiime parallel job submission script for LSF queuing system
#! /usr/bin/env python
import os
import datetime
import optparse
import lsf
option_parser = optparse.OptionParser()
option_parser.add_option('-m','--make_jobs',action='store_true')
@laserson
laserson / exonerate.rb
Created January 11, 2011 16:22
exonerate homebrew formula
require 'formula'
class Exonerate <Formula
url 'http://www.ebi.ac.uk/~guy/exonerate/exonerate-2.2.0.tar.gz'
homepage 'http://www.ebi.ac.uk/~guy/exonerate/'
md5 'ad3f7fc413376201c4631687b2e0ae89'
depends_on 'glib'
def install
ENV.j1
@laserson
laserson / gist:774661
Created January 11, 2011 16:25
Broken output from homebrew build
laserson@hobbes:~$ brew install -v exonerate
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -march=core2 -w -pipe
CXXFLAGS: -O3 -march=core2 -w -pipe
MACOSX_DEPLOYMENT_TARGET: 10.6
MAKEFLAGS: -j2
==> Downloading http://www.ebi.ac.uk/~guy/exonerate/exonerate-2.2.0.tar.gz
@laserson
laserson / streamgraph.py
Created January 15, 2011 07:12
Implement streamgraph plotting functionality using matplotlib
# Based on http://code.activestate.com/recipes/576633/
# which is based on:
# Reference: 'Stacked graphs- geometry & aesthetics' by Byron and Wattenberg
# http://www.leebyron.com/else/streamgraph/download.php?file=stackedgraphs_byron_wattenberg.pdf
import numpy as np
import matplotlib as mpl
# mpl.use('Agg')
import matplotlib.pyplot as plt