Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucy McNeill
synapsis
Commits
c5dcb893
Commit
c5dcb893
authored
Jul 12, 2021
by
Lucy McNeill
Browse files
replace instaces of file with img_file in count_foci
parent
b3b09da2
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/count_foci.R
View file @
c5dcb893
...
...
@@ -46,26 +46,26 @@ count_foci <- function(img_path, stage = "none", offset_px = 0.2, offset_factor
colnames
(
df_cells
)
<-
df_cols
## for each image that is *-dna.jpeg,
for
(
file
in
file_list
){
for
(
img_
file
in
file_list
){
if
(
stage
==
"pachytene"
){
filename_path_test
=
paste0
(
img_path
,
"/crops/"
,
stage
,
"/"
,
file
)
filename_path_test
=
paste0
(
img_path
,
"/crops/"
,
stage
,
"/"
,
img_
file
)
}
else
{
filename_path_test
=
paste0
(
img_path
,
"/crops/"
,
file
)
filename_path_test
=
paste0
(
img_path
,
"/crops/"
,
img_
file
)
}
file
=
filename_path_test
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
image_count
<-
image_count
+1
image
<-
readImage
(
file_dna
)
img_orig
<-
channel
(
2
*
image
,
"grey"
)
antibody1_store
<-
1
}
#if(grepl("*MLH3.jpeg", file)){
if
(
grepl
(
paste0
(
'*'
,
channel1_string
,
'.'
,
file_ext
,
'$'
),
file
)){
file_foci
=
file
if
(
grepl
(
paste0
(
'*'
,
channel1_string
,
'.'
,
file_ext
,
'$'
),
img_
file
)){
file_foci
=
img_
file
image
<-
readImage
(
file_foci
)
img_orig_foci
<-
channel
(
image
,
"gray"
)
# call functions: get
...
...
@@ -131,7 +131,7 @@ count_foci <- function(img_path, stage = "none", offset_px = 0.2, offset_factor
### multiply strands by foci_label
if
(
annotation
==
"on"
){
print
(
"at file"
)
print
(
file
)
print
(
img_
file
)
print
(
"cell counter is"
)
print
(
cell_count
)
print
(
"original images"
)
...
...
@@ -192,15 +192,15 @@ count_foci <- function(img_path, stage = "none", offset_px = 0.2, offset_factor
}
tryCatch
({
### 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
}
### data frame stuff ends
df_cells
<-
rbind
(
df_cells
,
t
(
c
(
file
,
cell_count
,
genotype
,
stage
,
foci_per_cell
,
sd
(
foci_areas
),
mean
(
foci_areas
),
median
(
foci_areas
),
mean
(
image_mat
),
median
(
image_mat
),
percent_px
,
sd
(
image_mat
),
alone_foci
)))
df_cells
<-
rbind
(
df_cells
,
t
(
c
(
img_
file
,
cell_count
,
genotype
,
stage
,
foci_per_cell
,
sd
(
foci_areas
),
mean
(
foci_areas
),
median
(
foci_areas
),
mean
(
image_mat
),
median
(
image_mat
),
percent_px
,
sd
(
image_mat
),
alone_foci
)))
},
error
=
function
(
e
)
{
#what should be done in case of exception?
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment