Commit d924e594 authored by Jorge Navarro Muñoz's avatar Jorge Navarro Muñoz
Browse files

minor cleanup in variable naming

parent 6358cac0
...@@ -102,9 +102,9 @@ def check_overlap(pfd_matrix, overlap_cutoff): ...@@ -102,9 +102,9 @@ def check_overlap(pfd_matrix, overlap_cutoff):
if row1[-1] == row2[-1]: if row1[-1] == row2[-1]:
#check if there is overlap between the domains #check if there is overlap between the domains
if no_overlap(int(row1[3]), int(row1[4]), int(row2[3]), int(row2[4])) == False: if no_overlap(int(row1[3]), int(row1[4]), int(row2[3]), int(row2[4])) == False:
overlapping_nucleotides = overlap(int(row1[3]), int(row1[4]), int(row2[3]), int(row2[4])) overlapping_aminoacids = overlap(int(row1[3]), int(row1[4]), int(row2[3]), int(row2[4]))
overlap_perc_loc1 = overlap_perc(overlapping_nucleotides, int(row1[4])-int(row1[3])) overlap_perc_loc1 = overlap_perc(overlapping_aminoacids, int(row1[4])-int(row1[3]))
overlap_perc_loc2 = overlap_perc(overlapping_nucleotides, int(row2[4])-int(row2[3])) overlap_perc_loc2 = overlap_perc(overlapping_aminoacids, int(row2[4])-int(row2[3]))
#check if the amount of overlap is significant #check if the amount of overlap is significant
if overlap_perc_loc1 > overlap_cutoff or overlap_perc_loc2 > overlap_cutoff: if overlap_perc_loc1 > overlap_cutoff or overlap_perc_loc2 > overlap_cutoff:
if float(row1[1]) >= float(row2[1]): #see which has a better score if float(row1[1]) >= float(row2[1]): #see which has a better score
...@@ -133,6 +133,8 @@ def check_overlap(pfd_matrix, overlap_cutoff): ...@@ -133,6 +133,8 @@ def check_overlap(pfd_matrix, overlap_cutoff):
loci_end = int(row[8]) loci_end = int(row[8])
domain_start = int(row[3]) domain_start = int(row[3])
domain_end = int(row[4]) domain_end = int(row[4])
# uses nucleotide coordinates for sorting
width = 3*(domain_end - domain_start) width = 3*(domain_end - domain_start)
strand = row[9].split(":")[-1] strand = row[9].split(":")[-1]
if strand == "+": if strand == "+":
...@@ -569,4 +571,4 @@ def get_composite_bgc_similarities(bgcs_1, bgcs_2, sim_matrix): ...@@ -569,4 +571,4 @@ def get_composite_bgc_similarities(bgcs_1, bgcs_2, sim_matrix):
if (sim > max_sim[0]): if (sim > max_sim[0]):
max_sim = (sim, bgc_1, bgc_2) if (bgc_2 > bgc_1) else (sim, bgc_2, bgc_1) max_sim = (sim, bgc_1, bgc_2) if (bgc_2 > bgc_1) else (sim, bgc_2, bgc_1)
num_pairs += 1 num_pairs += 1
return ((sum_sim / num_pairs), min_sim, max_sim) # let it throw infinite division error by itself return ((sum_sim / num_pairs), min_sim, max_sim) # let it throw infinite division error by itself
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment