2152 |
2152 |
common_nuc_results, ##<< Common wp nuc maps
|
2153 |
2153 |
config=NULL ##<< GLOBAL config variable
|
2154 |
2154 |
) {
|
2155 |
|
print(roi_index)
|
|
2155 |
# print(roi_index)
|
2156 |
2156 |
|
2157 |
2157 |
tmp_combi_key = paste(combi[1], combi[2], sep="_")
|
2158 |
2158 |
tmp_common_nucs = common_nuc_results[[tmp_combi_key]]
|
2159 |
2159 |
tmp_common_nucs = tmp_common_nucs[tmp_common_nucs$roi_index == roi_index, ]
|
2160 |
2160 |
|
2161 |
|
print(paste("Dealing with unr from", combi[1]))
|
|
2161 |
# print(paste("Dealing with unr from", combi[1]))
|
2162 |
2162 |
tmp_fuzzy = fuzzy_maps[[combi[1]]]
|
2163 |
2163 |
tmp_fuzzy = tmp_fuzzy[tmp_fuzzy$roi_index == roi_index, ]
|
2164 |
2164 |
tmp_wp = wp_maps[[combi[1]]]
|
... | ... | |
2181 |
2181 |
if (length(tmp_unr_nucs_1[,1]) == 0) {return(NULL)}
|
2182 |
2182 |
agg_unr_1 = tmp_unr_nucs_1
|
2183 |
2183 |
|
2184 |
|
print(paste("Dealing with unr from ", combi[2]))
|
|
2184 |
# print(paste("Dealing with unr from ", combi[2]))
|
2185 |
2185 |
tmp_fuzzy = fuzzy_maps[[combi[2]]]
|
2186 |
2186 |
tmp_fuzzy = tmp_fuzzy[tmp_fuzzy$roi_index == roi_index, ]
|
2187 |
2187 |
tmp_wp = wp_maps[[combi[2]]]
|
... | ... | |
2206 |
2206 |
tr_agg_unr_2 = translate_regions(agg_unr_2, combi, roi_index, roi=roi, config=config)
|
2207 |
2207 |
tr_agg_unr_2 = union_regions(tr_agg_unr_2)
|
2208 |
2208 |
|
2209 |
|
print("Dealing with unr from both...")
|
|
2209 |
# print("Dealing with unr from both...")
|
2210 |
2210 |
all_unr = union_regions(rbind(agg_unr_1, tr_agg_unr_2))
|
2211 |
2211 |
|
2212 |
|
print(paste("Dealing with wp from", combi[1]))
|
|
2212 |
# print(paste("Dealing with wp from", combi[1]))
|
2213 |
2213 |
tmp_wp = wp_maps[[combi[1]]]
|
2214 |
2214 |
tmp_wp = tmp_wp[tmp_wp$wp==1,]
|
2215 |
2215 |
tmp_wp = tmp_wp[tmp_wp$roi_index == roi_index, ]
|
... | ... | |
2223 |
2223 |
}))
|
2224 |
2224 |
wp_nucs_1 = tmp_wp[tmp_wp$index_nuc %in% tmp_index, ]
|
2225 |
2225 |
|
2226 |
|
print(paste("Dealing with wp from", combi[2]))
|
|
2226 |
# print(paste("Dealing with wp from", combi[2]))
|
2227 |
2227 |
tmp_wp = wp_maps[[combi[2]]]
|
2228 |
2228 |
tmp_wp = tmp_wp[tmp_wp$wp==1,]
|
2229 |
2229 |
tmp_wp = tmp_wp[tmp_wp$roi_index == roi_index, ]
|
... | ... | |
2243 |
2243 |
tr_wp_nucs_2 = translate_regions(wp_nucs_2, combi, roi_index, roi=roi, config=config)
|
2244 |
2244 |
}
|
2245 |
2245 |
|
2246 |
|
print("Dealing with wp from both...")
|
|
2246 |
# print("Dealing with wp from both...")
|
2247 |
2247 |
all_wp = union_regions(rbind(wp_nucs_1[,1:4], tr_wp_nucs_2))
|
2248 |
2248 |
|
2249 |
|
print("Dealing with unr and wp...")
|
|
2249 |
# print("Dealing with unr and wp...")
|
2250 |
2250 |
non_inter_unr = substract_region(all_unr, all_wp)
|
2251 |
2251 |
non_inter_unr = crop_fuzzy(non_inter_unr, roi, combi[1], config)
|
2252 |
2252 |
if (is.null(non_inter_unr)) { return(NULL) }
|