Skip to content

Commit

Permalink
QC dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Precancer committed Oct 26, 2023
1 parent 5b5cb50 commit e85ac90
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
19 changes: 11 additions & 8 deletions bin/plot_overlays.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,24 @@ legend("left", fill = cellTypeColors, legend = names(cellTypeColors),
pch = 21, box.lty = 0, title = "Cell subtypes", cex = 1)
dev.off()


maskDirs=Sys.glob(args$maskDir)

for(imagename in imagenames) {

print(imagename)
dataFlt = data[data$imagename == imagename, ]

if(args$mccs) {
if(dir.exists(file.path(args$maskDir, "consensus_cell_segmentation"))) {
outlineImg = list.files(file.path(args$maskDir, "consensus_cell_segmentation"),
if(any(dir.exists(file.path(maskDirs, "consensus_cell_segmentation")))) {
outlineImg = list.files(file.path(maskDirs, "consensus_cell_segmentation"),
pattern = "total_cells_mask.tiff", recursive = T, full.name = T)
} else {
outlineImg = list.files(file.path(args$maskDir, "segmentation"),
outlineImg = list.files(file.path(maskDirs, "segmentation"),
pattern = "total_cells_mask.tiff", recursive = T, full.name = T)
}
} else {
outlineImg = list.files(file.path(args$maskDir, "simple_segmentation/"),
outlineImg = list.files(file.path(maskDirs, "simple_segmentation/"),
pattern = '.*nuclear_mask_nuclear_dilation.tiff',
full.name = T, recursive = T)
}
Expand Down Expand Up @@ -128,15 +131,15 @@ if(file.size(args$posFile)) {
dataFlt = data[data$imagename == imagename, ]

if(args$mccs) {
if(dir.exists(file.path(args$maskDir, "consensus_cell_segmentation"))) {
outlineImg = list.files(file.path(args$maskDir, "consensus_cell_segmentation"),
if(any(dir.exists(file.path(maskDirs, "consensus_cell_segmentation")))) {
outlineImg = list.files(file.path(maskDirs, "consensus_cell_segmentation"),
pattern = "total_cells_mask.tiff", recursive = T, full.name = T)
} else {
outlineImg = list.files(file.path(args$maskDir, "segmentation"),
outlineImg = list.files(file.path(maskDirs, "segmentation"),
pattern = "total_cells_mask.tiff", recursive = T, full.name = T)
}
} else {
outlineImg = list.files(file.path(args$maskDir, "simple_segmentation/"),
outlineImg = list.files(file.path(maskDirs, "simple_segmentation/"),
pattern = '.*nuclear_mask_nuclear_dilation.tiff',
full.name = T, recursive = T)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ process qc_overlay {
plot_overlays.R \
--rawDir ${params.output_dir}/summary/${subset}_${ref_markers}_${method}/overlays/ \
--maskDir ${params.input_dir} --mccs ${params.cellprofiler} \
--maskDir \"${params.input_dir}\" --mccs ${params.cellprofiler} \
--inDir ${params.output_dir}/summary/${subset}_${ref_markers}_${method}/tables/ \
--outDir "${params.output_dir}/summary/${subset}_${ref_markers}_${method}/" \
--posFile ${params.output_dir}/summary/${subset}_${ref_markers}_${method}/overlays/overlay_examples.txt \
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ params {
input_table = '${baseDir}/data/cell_objects.tracerx.txt' // input when deep-imcyto has not been used
output_dir = "$baseDir/results/TYPEx/${params.release}/"
params_config = "${baseDir}/conf/typing_params.json"
annotation_config = "${baseDir}/conf/cell_type_annotation.p1.json"
annotation_config = "${baseDir}/data/cell_type_annotation.testdata.json"
color_config = "${baseDir}/conf/celltype_colors.json"

// TISSUE SEGMENTATION
Expand Down
2 changes: 1 addition & 1 deletion test.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ params {
input_table = '${baseDir}/data/cell_objects.tracerx.txt' // input when deep-imcyto has not been used
output_dir = "$baseDir/results/TYPEx/${params.release}/"
params_config = "${baseDir}/conf/typing_params.json"
annotation_config = "${baseDir}/conf/cell_type_annotation.p1.json"
annotation_config = "${baseDir}/conf/cell_type_annotation.testdata.json"
color_config = "${baseDir}/conf/celltype_colors.json"

// TISSUE SEGMENTATION
Expand Down
4 changes: 2 additions & 2 deletions workflows/qcw.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ workflow QC {
method
main:

if(file(params.image_dir).isDirectory()) {
//if(file(params.image_dir).isDirectory()) {
qc_select_images(
markers,
subset,
Expand All @@ -28,7 +28,7 @@ workflow QC {
method,
qc_create_single_channel_images.out
)
}
//}
qc_intensity_heatmap(
markers,
subset,
Expand Down

0 comments on commit e85ac90

Please sign in to comment.