This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
class A(object): | |
def __iter__(self): | |
yield 'i' | |
yield 'am' | |
yield 'A' | |
def fiddleIter(self): | |
def newIter(_): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:f0a834ef9d96ce829d767f79f4b978af01edc070f7b45f1595ce8fb6604a74b7" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Title: Using the new new code | |
Date: 2014-08-13 16:08 | |
Category: Tools | |
Tags: iPython notebook, ipython | |
Summary: Using the newest code base | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readStartInSubject readEndInSubject | |
| | | |
| subjectStart subjectEnd | | |
| | | | | |
Subject: .................ACGTAAAGGCTTAGGT................. | |
Read: ....ACGTAAAGGCTT-GGT............ | |
| | | |
| | | |
readStart readEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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('|') |