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
def query_normal_length(): length = 377 cursor = SequenceDocument.objects(length=length) records = [] for r in cursor: records.append(r) del cursor return records
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)
def query_base_sequence(name): return SequenceDocument.objects(name=name)[0]
def reset_sequence_documents_regions(): for seq_document in SequenceDocument.objects(length=377): seq_document.delete()
def get_sequences_by_region(region): return SequenceDocument.objects(region__contains=region).only('sequence')