Skip to content

Instantly share code, notes, and snippets.

View terrycojones's full-sized avatar

Terry Jones terrycojones

View GitHub Profile
def filter(self, **kwargs):
"""
Update self so that __iter__ returns a generator that yields a filtered
set of C{ReadAlignments}.
See self._filter for details of arguments.
@return: C{self}.
"""
iterator = self._filter(selfIterator=self.__iter__, **kwargs)
#!/usr/bin/env python
class A(object):
def __iter__(self):
yield 'i'
yield 'am'
yield 'A'
def fiddleIter(self):
def newIter(_):
{
"metadata": {
"name": "",
"signature": "sha256:f0a834ef9d96ce829d767f79f4b978af01edc070f7b45f1595ce8fb6604a74b7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
Title: Using the new new code
Date: 2014-08-13 16:08
Category: Tools
Tags: iPython notebook, ipython
Summary: Using the newest code base
readStartInSubject readEndInSubject
| |
| subjectStart subjectEnd |
| | | |
Subject: .................ACGTAAAGGCTTAGGT.................
Read: ....ACGTAAAGGCTT-GGT............
| |
| |
readStart readEnd
def walkHSP(self, hsp):
"""
Provide information about exactly how a read matches a subject, as
specified by C{hsp}.
@return: A generator that yields (offset, residue, inMatch) tuples.
The offset is the offset into the matched subject. The residue is
the base in the read (which might be '-' to indicate a gap in the
read was aligned with the subject at this offset). inMatch will be
C{True} for residues that are part of the HSP match, and C{False}
Phylogenetic studies indicate that eukaryotic DNA polymerases and some
viral DNA polymerases have a common origin. These studies are not easy to
interpret because only a few of the polymerase domains are conserved and
phylogenetic trees have all been unrooted, so the direction of evolution
cannot be determined. The gene flow between viruses and eukaryotic cells
could have been in either direction. Takemura suggested that
α-polymerases (priming polymerases in eukaryotes) originated from a
pox-like virus. Unlike most other DNA viruses, poxviruses replicate in the
cytoplasm of their hosts, completely independent of the host nucleus.
Vaccinia virus, a well studied poxvirus, encodes protein kinases and
class ScannedReadDatabase(object):
"""
Maintain a collection of reads and provide for database (index, search)
operations on them.
@param landmarkFinderClasses: A C{list} of landmark classes.
@param trigPointFinderClasses: A C{list} of trig point classes.
"""
def __init__(self, landmarkFinderClasses, trigPointFinderClasses):
self.landmarkFinderClasses = landmarkFinderClasses
python -m cProfile -o /tmp/new.prof bin/find-matches.py --database light.db --fastaFile query.fa > query.out
#!/usr/bin/env python
import sys
from pstats import Stats
p = Stats(sys.argv[1])
#p.strip_dirs().sort_stats('cumulative').print_stats()
p.sort_stats('cumulative').print_stats()
#!/usr/bin/env python
import sys
from collections import defaultdict
seen = defaultdict(list)
for lineNumber, line in enumerate(sys.stdin):
if lineNumber:
fields = line.split('|')