Showing
2 changed files
with
7 additions
and
8 deletions
... | @@ -28,7 +28,7 @@ Import data | ... | @@ -28,7 +28,7 @@ Import data |
28 | ''' | 28 | ''' |
29 | 29 | ||
30 | def import_ncRNA(path): | 30 | def import_ncRNA(path): |
31 | - file_order = ["CB.txt","ORF.txt","KMER3.txt","KMER4.txt","KMER5.txt"]#,"KMER6.txt"] | 31 | + file_order = ["CB.txt","ORF.txt","KMER3.txt","KMER4.txt","KMER5.txt"] |
32 | df_raw = [] | 32 | df_raw = [] |
33 | with ThreadPoolExecutor(max_workers=5) as tp: | 33 | with ThreadPoolExecutor(max_workers=5) as tp: |
34 | for x in file_order: | 34 | for x in file_order: |
... | @@ -88,7 +88,6 @@ def combination(vector_values): | ... | @@ -88,7 +88,6 @@ def combination(vector_values): |
88 | idx_values[i] = 0 if idx_values[i] == nb_values[i] else idx_values[i] | 88 | idx_values[i] = 0 if idx_values[i] == nb_values[i] else idx_values[i] |
89 | 89 | ||
90 | NUC_ORDER = ["A","C","T","G"] | 90 | NUC_ORDER = ["A","C","T","G"] |
91 | - | ||
92 | def plot_weights(units,m,n,name): | 91 | def plot_weights(units,m,n,name): |
93 | features = [ | 92 | features = [ |
94 | ["Position "+x for x in NUC_ORDER]+["Composition "+x for x in NUC_ORDER] + ["GC composition"], | 93 | ["Position "+x for x in NUC_ORDER]+["Composition "+x for x in NUC_ORDER] + ["GC composition"], |
... | @@ -108,18 +107,18 @@ def plot_weights(units,m,n,name): | ... | @@ -108,18 +107,18 @@ def plot_weights(units,m,n,name): |
108 | dico.append({"x":i,"y":j,"x2": k, "y2": units[idx,features_pos[l][k]],"Name":features[l][k]}) | 107 | dico.append({"x":i,"y":j,"x2": k, "y2": units[idx,features_pos[l][k]],"Name":features[l][k]}) |
109 | df = pd.DataFrame(dico) | 108 | df = pd.DataFrame(dico) |
110 | p = ggplot(df,aes(x="x2",y="y2")) | 109 | p = ggplot(df,aes(x="x2",y="y2")) |
111 | - p += geom_point(aes(color="Name")) | ||
112 | p += geom_line() | 110 | p += geom_line() |
111 | + p += geom_point(aes(color="Name"),size=2.0) | ||
113 | p += facet_grid("x ~ y ") | 112 | p += facet_grid("x ~ y ") |
114 | p += xlab("") | 113 | p += xlab("") |
115 | p += ylab("") | 114 | p += ylab("") |
116 | p += guides(color=guide_legend(override_aes={"size":4})) | 115 | p += guides(color=guide_legend(override_aes={"size":4})) |
117 | p += theme( | 116 | p += theme( |
118 | - legend_text=element_text(size=20), | 117 | + legend_text=element_text(size=10), |
119 | - legend_title=element_text(size=20), | 118 | + legend_title=element_text(size=12), |
120 | - axis_text_x = element_blank() | 119 | + axis_text_x = element_blank(), |
120 | + legend_position="top" | ||
121 | ) | 121 | ) |
122 | - check_dir_file(name) | ||
123 | p.save(name+features_names[l]+".png",width=15, height=10) | 122 | p.save(name+features_names[l]+".png",width=15, height=10) |
124 | 123 | ||
125 | def plot_density(y, proba,name): | 124 | def plot_density(y, proba,name): | ... | ... |
... | @@ -37,7 +37,7 @@ def main(): | ... | @@ -37,7 +37,7 @@ def main(): |
37 | map_size_n = int(arguments["--dim1"]) if not arguments["--dim0"] is None else 10 | 37 | map_size_n = int(arguments["--dim1"]) if not arguments["--dim0"] is None else 10 |
38 | batch_size = int(arguments["--batch_size"]) if not arguments["--batch_size"] is None else 100 | 38 | batch_size = int(arguments["--batch_size"]) if not arguments["--batch_size"] is None else 100 |
39 | penality = float(arguments["--penality"]) if not arguments["--penality"] is None else 0.001 | 39 | penality = float(arguments["--penality"]) if not arguments["--penality"] is None else 0.001 |
40 | - alpha = float(argument["--alpha"]) if not argument["--alpha"] is None else 0.5 | 40 | + alpha = float(arguments["--alpha"]) if not arguments["--alpha"] is None else 0.5 |
41 | verbose = arguments["--verbose"] | 41 | verbose = arguments["--verbose"] |
42 | 42 | ||
43 | #Compute features | 43 | #Compute features | ... | ... |
-
Please register or login to post a comment