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
import re | |
units = { | |
'day': 'd', | |
'hour': 'h', | |
'minute': 'm', | |
'second': 's', | |
} | |
# Matches only valid data (I hope) |
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
float_t = r"[+-]?(\d*\.\d+|\d+\.?)(e{1,2}[+-]?\d+)?" |
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
""" | |
This is located inside a fake numpy, and could allow "import numpy" | |
to work invisibly on both Python and PyPy. | |
Not quite sure how to get files to find it. | |
In any case, NumPyPy is only a partial implementation of NumPy, | |
so it's probably not ready for unintended/untested/automatic use. | |
""" | |
import sys | |
# Delete current directory from module search path |
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 Variant(object): | |
"""This is the top level class for genomic variants""" | |
def __init__(self, filename, filetype=None, gvfreader=None, vcfreader=None): | |
""" | |
Uses the default parser Wrappers unless otherwise specified. | |
Currently supported arguments to filetype are "vcf" and "gvf". | |
If filetype is not specified, guessed from file extension. | |
""" | |
self.filename = filename | |
if filetype is not None: |
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 _AltRecord(object): | |
def __init__(self, alt_type, **kwargs): | |
print "_AltRecord" | |
super(_AltRecord, self).__init__(**kwargs) | |
self.alt_type = alt_type | |
class _Substitution(_AltRecord): | |
def __init__(self, sequence, **kwargs): | |
print "_Substitution" | |
if len(sequence) == 1: |
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/python | |
import sys | |
import time | |
spinner = ["-", "\\", "|", "/"] | |
print "This is the header row" | |
try: | |
for i in range(10): |
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
# CoordinateMapper -- map between genomic, cds, and protein coordinates | |
# AUTHOR: Reece Hart <[email protected]> | |
# Modifications: Lenna X. Peterson <[email protected]> | |
# LICENSE: BioPython | |
# Examples: | |
# AB026906.1:g.7872G>T | |
# AB026906.1:c.274G>T | |
# BA...:p.Asp92Tyr | |
# |
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 | |
from __future__ import division | |
import argparse | |
import glob | |
import inspect | |
import logging | |
import os |
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
-- More than one chain is possible for each code | |
CREATE TABLE IF NOT EXISTS smallest | |
( | |
id INTEGER PRIMARY KEY NOT NULL, | |
code TEXT NOT NULL, | |
chain TEXT NOT NULL, | |
timestamp TEXT NOT NULL | |
); | |
CREATE TABLE IF NOT EXISTS ligands |
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
# Copyright 2012-2014 Lenna X. Peterson | |
# [email protected] | |
# The first step to using the mapper is to get the exons from a GenBank or similar file. | |
# The mapper will accept exons as a sequence of pairs, a SeqRecord with a CDS feature, or a CDS SeqFeature. | |
# The file used in this example is located in the Tests directory of the Biopython source code. | |
from Bio.SeqUtils.Mapper import CoordinateMapper | |
from Bio import SeqIO | |
OlderNewer