@@ -0,0 +1,1268 @@
+%22%22%22%0AA script for checking data integrity of the Rfam-miRBase sync.%0A%22%22%22%0A%0Afrom utils import db_utils as db%0A%0A%0Adef verify_thresholds():%0A    %22%22%22%0A    Manually export a file with manually assigned thresholds for each family,%0A    then compare with the thresholds of microRNA families in the database.%0A    Example data:%0A    60%09RF00253%0A    52%09RF00658%0A    57%09RF00664%0A    70%09RF00666%0A    %22%22%22%0A    data = %7B%7D%0A    with open('rfam-microrna-manual-thresholds.tsv') as f:%0A        for line in f:%0A            if not 'RF' in line:%0A                continue%0A            parts = line.strip().split('%5Ct')%0A            data%5Bparts%5B1%5D%5D = float(parts%5B0%5D)%0A    print('Found %7B%7D manual thresholds'.format(len(data.keys())))%0A    rfam_data_temp = db.fetch_mirna_families()%0A    rfam_data = %7B%7D%0A    for entry in rfam_data_temp:%0A        rfam_data%5Bentry%5B'rfam_acc'%5D%5D = entry%5B'gathering_cutoff'%5D%0A    matches = 0%0A    for rfam_acc in data.keys():%0A        if rfam_acc == 'RF00273':%0A            continue%0A        if data%5Brfam_acc%5D != rfam_data%5Brfam_acc%5D:%0A            print('%7B%7D: %7B%7D does not match %7B%7D'.format(rfam_acc, data%5Brfam_acc%5D, rfam_data%5Brfam_acc%5D))%0A        else:%0A            matches += 1%0A    print('Found %7B%7D matches'.format(matches))%0A%0A%0Adef main():%0A    verify_thresholds()%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add a new script for checking data integrity