Skip to content
Snippets Groups Projects
Commit b3b09da2 authored by Lucy McNeill's avatar Lucy McNeill
Browse files

replace instaces of file with img_file in get_pachytene

parent 66ebcaa0
No related branches found
No related tags found
No related merge requests found
......@@ -36,13 +36,13 @@ get_pachytene <- function(img_path, species_num = 20, offset = 0.2,ecc_thresh =
dir.create(paste0(img_path_new,"/pachytene"))
file_list <- list.files(img_path_new)
## for each image that is *-dna.jpeg,
for (file in file_list){
file_base = file
filename_path_test = paste0(img_path,"/crops/", file)
file = filename_path_test
for (img_file in file_list){
file_base = img_file
filename_path_test = paste0(img_path,"/crops/", img_file)
img_file = filename_path_test
#if(grepl("*SYCP3.jpeg", file)){
if(grepl(paste0('*',channel2_string,'.',file_ext,'$'), file)){
file_dna = file
if(grepl(paste0('*',channel2_string,'.',file_ext,'$'), img_file)){
file_dna = img_file
file_base_dna = file_base
image_count <- image_count +1
image <- readImage(file_dna)
......@@ -50,9 +50,9 @@ get_pachytene <- function(img_path, species_num = 20, offset = 0.2,ecc_thresh =
antibody1_store <- 1
}
#if(grepl("*MLH3.jpeg", file)){
if(grepl(paste0('*',channel1_string,'.',file_ext,'$'), file)){
if(grepl(paste0('*',channel1_string,'.',file_ext,'$'), img_file)){
file_base_foci = file_base
file_foci = file
file_foci = img_file
#print(file_foci)
image <- readImage(file_foci)
img_orig_foci <- channel(image, "gray")
......@@ -77,10 +77,10 @@ get_pachytene <- function(img_path, species_num = 20, offset = 0.2,ecc_thresh =
cell_count <- cell_count + 1
### identified a good image. count foci
### data frame stuff
if(grepl( WT_str, file, fixed = TRUE) == TRUE){
if(grepl( WT_str, img_file, fixed = TRUE) == TRUE){
genotype <- WT_out
}
if(grepl( KO_str, file, fixed = TRUE) == TRUE){
if(grepl( KO_str, img_file, fixed = TRUE) == TRUE){
genotype <- KO_out
}
image_mat <- as.matrix(new_img)
......@@ -108,7 +108,7 @@ get_pachytene <- function(img_path, species_num = 20, offset = 0.2,ecc_thresh =
if(mean_ecc > ecc_thresh){
if(px_fraction > area_thresh){
stage_classification <- "pachytene"
df_cells <- rbind(df_cells,t(c(file,cell_count,genotype,px_mask, px_total,px_fraction, mean_ecc,mean_ratio,skew,sd_bright_px,stage_classification)))
df_cells <- rbind(df_cells,t(c(img_file,cell_count,genotype,px_mask, px_total,px_fraction, mean_ecc,mean_ratio,skew,sd_bright_px,stage_classification)))
pachytene_count <- pachytene_count + 1
file_dna <- tools::file_path_sans_ext(file_base_dna)
filename_crop = paste0(img_path_new,"/pachytene/", file_dna,".jpeg")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment