Beispiel #1
0
def gwConvolve(genome, seq):
    seq_hits = 0
    for chrom in genome.seq_names:
        if chrom == 'chrM': continue # ignore mitochondria
        num = len(list(genome.nongeneIter(chrom)))
        for bp_seq, record in genome.nongeneIter(chrom):
            score_deque = deque()
            max_score = convolveSubsequence(seq, bp_seq, score_deque)
            while score_deque:
                seq_hits += 1
                pos,score = score_deque.pop()
    return seq_hits, seq
Beispiel #2
0
def gwConvolveTrack(genome, seq):
    seq_hits = 0
    X = {}
    Y = {}
    P = {}
    for chrom in genome.seq_names:
        if chrom == 'chrM': continue # ignore mitochondria
        X[chrom] = [0.0]
        Y[chrom] = [0.0]
        P[chrom] = []
        num = len(list(genome.nongeneIter(chrom)))
        for bp_seq, record in genome.nongeneIter(chrom):
            score_deque = deque()
            max_score = convolveSubsequence(seq, bp_seq, score_deque)
            while score_deque:
                seq_hits += 1
                pos,score = score_deque.pop()
                pos += record.start # locate on chromasome
                X[chrom].extend((pos,pos,pos))
                Y[chrom].extend((0.0,1.2,0.0))
                P[chrom].append(pos)
    return X,Y,P