예제 #1
0
def primers():
    primers = [
        Primer.create(seq="ATGC", fg_freq=1, bg_freq=2, ratio=1.0, active=True),
        Primer.create(seq="GGCC", fg_freq=1, bg_freq=3, ratio=0.5, active=True),
        Primer.create(seq="CCTA", fg_freq=2, bg_freq=0, ratio=float('inf'), active=True)
    ]
    return primers
예제 #2
0
파일: test_db.py 프로젝트: pombredanne/swga
 def test_create_tables(self):
     database.db.init(":memory:")
     database.create_tables()
     p = Primer.create(seq="ATGC")
     s = Set.create(_id=1, score=1)
     s.primers.add(p)
     database.db.close()
예제 #3
0
def test_linearize_binding_sites(kmer, initdb, fastafile):
    p = Primer.create(seq=kmer)
    p._update_locations(fastafile)
    chr_ends = swga.locate.chromosome_ends(fastafile)
    linear_bind_sites = swga.locate.linearize_binding_sites([p], chr_ends)
    # (number of sites + (2*number of chromosomes) - (any overlaps))
    assert len(linear_bind_sites) == 10
    for record, ends in chr_ends.iteritems():
        start, end = ends
        assert start in linear_bind_sites
        assert end in linear_bind_sites
        for site in p.locations()[record]:
            assert site in linear_bind_sites
예제 #4
0
 def primers(self, initdb):
     primers = [
         # reference primer
         Primer.create(_id=0, seq="ATGCTC"),
         # rev. complement has 4 bases overlapping
         Primer.create(_id=1, seq="CAGCAT"),
         # rev. complement has 3 bases overlapping
         Primer.create(_id=2, seq="GAGGTA"),
         Primer.create(_id=3, seq="ATCGAG"),
         # rev. complement has one base overlapping
         Primer.create(_id=4, seq="TTCCAC"),
         # substring of reference primer
         Primer.create(_id=5, seq="ATGC")
     ]
     return primers
예제 #5
0
def tprimers(seqs):
    return [Primer.create(seq=seq) for seq in seqs]