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
Vital-IT
post-inForm
Commits
36fe98b0
Commit
36fe98b0
authored
Jan 25, 2021
by
Robin Engler
Browse files
Fix bug in threshold.txt file checking
parent
325ce288
Changes
3
Hide whitespace changes
Inline
Side-by-side
R/config.R
View file @
36fe98b0
...
...
@@ -20,7 +20,7 @@ AUTHORIZED_STROMA_VALUES <<- c('DAPI', 'stroma', 'other')
AUTHORIZED_TUMOR_VALUES
<<-
c
(
'CK'
,
'tumor'
)
AUTHORIZED_MARKERS
<<-
c
(
'CAL'
,
'CD3'
,
'CD4'
,
'CD8'
,
'CD11c'
,
'CD15'
,
'CD20'
,
'CD56'
,
'CD68'
,
'CD103'
,
'CD163'
,
'CD206'
,
'FOXP3'
,
'GB'
,
'gH2AX'
,
'gH2AXN'
,
'IDO'
,
'IL10R'
,
'Keratin'
,
'K
i
67'
,
'PD1'
,
'PDL1'
,
'PERFORIN'
,
'SOX10'
,
'IL10R'
,
'Keratin'
,
'K
I
67'
,
'PD1'
,
'PDL1'
,
'PERFORIN'
,
'SOX10'
,
'WT1'
,
'CK'
,
'VISTA'
)
IGNORED_PHENOTYPES
<<-
c
(
'DAPIp'
,
'MISSING'
)
NO_PHENOTYPE
<<-
'MISSING'
...
...
R/input_check.R
View file @
36fe98b0
...
...
@@ -144,6 +144,15 @@ standardize_and_split_cell_data <- function(input_file,
file_name
=
input_file
)
# Remove any duplicated rows in the input data. Note that for computing speed reasons, we
# first check on a subset of the input table whether there are potentially any duplicates,
# before expanding the search to the entire data. Since duplicates are rare, this will save
# time in most cases.
if
(
any
(
duplicated
(
input_table
[,
c
(
'cell_id'
,
'cell_x_position'
,
'cell_y_position'
)]))){
input_table
=
input_table
[
!
duplicated
(
input_table
),]
}
# Extract sample names and filter to keep only rows matching samples names present in the
# input parameters.
sample_names
=
extract_sample_name
(
input_table
[,
'sample_name'
],
input_file
=
input_file
)
...
...
@@ -259,6 +268,9 @@ standardize_and_split_tissue_data <- function(input_file,
actual_columns
=
colnames
(
input_table
),
file_name
=
input_file
)
# Remove any duplicated rows in the input data.
if
(
any
(
duplicated
(
input_table
)))
input_table
=
input_table
[
!
duplicated
(
input_table
),]
# Extract sample name and "image ID" values.
# *****************************************
...
...
R/load_data.R
View file @
36fe98b0
...
...
@@ -279,7 +279,7 @@ load_thresholds_file <- function(input_file,
if
(
col_names
[
1
]
!=
'sample_name'
)
raise_error
(
msg
=
"The first column of the threshold file must be 'sample_name'."
,
file
=
input_file
)
if
(
'tissue_type'
%in%
col_names
&
col_names
[
2
]
!=
'
sample_nam
e'
)
raise_error
(
if
(
'tissue_type'
%in%
col_names
&
col_names
[
2
]
!=
'
tissue_typ
e'
)
raise_error
(
msg
=
"If present, the 'tissue_type' column must be the second column of the file."
,
file
=
input_file
)
...
...
Write
Preview
Markdown
is supported
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