예제 #1
0
def query_not_base_sequences():
    length = 16569
    cursor = SequenceDocument.objects(length__ne=length)
    records = []
    for r in cursor:
        records.append(r)
    del cursor
    return records
예제 #2
0
def query_normal_length():
    length = 377
    cursor = SequenceDocument.objects(length=length)
    records = []
    for r in cursor:
        records.append(r)
    del cursor
    return records
예제 #3
0
def save_stats_db(sequence):
    rcrs_base_sequence = query_base_sequence('NC_012920')
    rsrs_base_sequence = query_base_sequence('RSRS')
    doc = SequenceDocument.objects(version=sequence.version)
    rcrs_distance = count_distance(sequence.sequence, rcrs_base_sequence.sequence[16023:16400])
    doc.update(distance_to_rCRS=rcrs_distance)
    rsrs_distance = count_distance(sequence.sequence, rsrs_base_sequence.sequence[16023:16400])
    doc.update(distance_to_RSRS=rsrs_distance)
예제 #4
0
def query_base_sequence(name):
    return SequenceDocument.objects(name=name)[0]
예제 #5
0
def reset_sequence_documents_regions():
    for seq_document in SequenceDocument.objects(length=377):
        seq_document.delete()
예제 #6
0
def get_sequences_by_region(region):
    return SequenceDocument.objects(region__contains=region).only('sequence')