diff --git a/visualize.py b/visualize.py index 9ad4e1c..6b6c973 100644 --- a/visualize.py +++ b/visualize.py @@ -100,7 +100,6 @@ def make_box_plot(groups_files_names, groups_genes_of_interest, output_directory sorted_genes_of_interest = sorted(genes_of_interest, key = lambda x: np.mean(genes_of_interest[x])) for gene in sorted_genes_of_interest: - print(genes_of_interest[gene]) group_data.extend(genes_of_interest[gene]) data.append(group_data) @@ -165,18 +164,20 @@ def read_correlation(correlation_file, groups, variable): if len(genes_family) != 0: logger.info("working with the gene " + gene_name) + #the score is in [3], the tsl is in [2] + for genes_line in re.split(r'\n', genes_family): genes_array = re.split(r'\t', genes_line) if genes_array[0] == gene_name: #this is a perfect match <3 - genes_to_show[gene_name].append(float(genes_array[2])) #append score to the array + genes_to_show[gene_name].append(float(genes_array[3])) #append score to the array elif genes_array[0].startswith(gene_name) and len(genes_array[0]) <= len(gene_name) + variable: #the found gene is by default 1 char longer than the gene name if genes_array[0] in genes_to_show.keys(): - genes_to_show[genes_array[0]].append(float(genes_array[2])) + genes_to_show[genes_array[0]].append(float(genes_array[3])) else: #this gene is not yet saved #make a new place in the dictionary for this gene genes_to_show[genes_array[0]] = genes_to_show.get(genes_array[0], []) - genes_to_show[genes_array[0]].append(float(genes_array[2])) + genes_to_show[genes_array[0]].append(float(genes_array[3])) else: logger.info("no similar genes to " + gene_name + " were found")