Mercurial > repos > mheinzl > hd
comparison hd.py @ 6:e76e404c1719 draft
planemo upload for repository https://github.com/monikaheinzl/galaxyProject/tree/master/tools/hd commit 66a55754a269d4cfaee98b113f05154ae9dc80fe
author | mheinzl |
---|---|
date | Tue, 15 May 2018 11:01:31 -0400 |
parents | 445442a6aeb0 |
children | 6f124cc95838 |
comparison
equal
deleted
inserted
replaced
5:445442a6aeb0 | 6:e76e404c1719 |
---|---|
455 #ham2 = [] | 455 #ham2 = [] |
456 #min_valueList = [] | 456 #min_valueList = [] |
457 #min_tagsList = [] | 457 #min_tagsList = [] |
458 #diff11_zeros = [] | 458 #diff11_zeros = [] |
459 #min_tagsList_zeros = [] | 459 #min_tagsList_zeros = [] |
460 c = 0 # counter, only used to see how many HDs of tags were already calculated | 460 counter = 0 # counter, only used to see how many HDs of tags were already calculated |
461 if mate_b is False: # HD calculation for all a's | 461 if mate_b is False: # HD calculation for all a's |
462 half1_mate1 = array1_half | 462 half1_mate1 = array1_half |
463 half2_mate1 = array1_half2 | 463 half2_mate1 = array1_half2 |
464 half1_mate2 = array2_half | 464 half1_mate2 = array2_half |
465 half2_mate2 = array2_half2 | 465 half2_mate2 = array2_half2 |
494 d = d_2 | 494 d = d_2 |
495 d2 = d_1 | 495 d2 = d_1 |
496 else: # half1, corrects the variable of the HD from both halfs if it is a or b | 496 else: # half1, corrects the variable of the HD from both halfs if it is a or b |
497 d = d_1 | 497 d = d_1 |
498 d2 = d_2 | 498 d2 = d_2 |
499 min_valueList[c] = d + d2 | 499 min_valueList[counter] = d + d2 |
500 min_tagsList[c] = tag | 500 min_tagsList[counter] = tag |
501 ham1.append[c] = d | 501 ham1.append[counter] = d |
502 ham2.append[c] = d2 | 502 ham2.append[counter] = d2 |
503 difference1 = abs(d - d2) | 503 difference1 = abs(d - d2) |
504 diff11[c] = difference1 | 504 diff11[counter] = difference1 |
505 rel_difference = round(float(difference1) / (d + d2), 1) | 505 rel_difference = round(float(difference1) / (d + d2), 1) |
506 relativeDiffList[c] = rel_difference | 506 relativeDiffList[counter] = rel_difference |
507 | 507 |
508 #### tags which have identical parts: | 508 #### tags which have identical parts: |
509 if d == 0 or d2 == 0: | 509 if d == 0 or d2 == 0: |
510 min_tagsList_zeros[c] = tag | 510 min_tagsList_zeros[counter] = tag |
511 difference1_zeros = abs(d - d2) | 511 difference1_zeros = abs(d - d2) |
512 diff11_zeros[c] = difference1_zeros | 512 diff11_zeros[counter] = difference1_zeros |
513 c += 1 | 513 counter += 1 |
514 | 514 |
515 #print(i) | 515 #print(i) |
516 diff11 = [st for st in diff11 if st != 999] | 516 diff11 = [st for st in diff11 if st != 999] |
517 ham1 = [st for st in ham1 if st != 999] | 517 ham1 = [st for st in ham1 if st != 999] |
518 ham2 = [st for st in ham2 if st != 999] | 518 ham2 = [st for st in ham2 if st != 999] |