config.R 3.43 KB
Newer Older
Robin Engler's avatar
Robin Engler committed
1
2
3
4
5
# Global variables and function sourcing.
# Note: in principle the assignment of global variables "<<-" is not really necessary since the
# declaration is made at the top level.

# Set application version.
6
POSTINFORM_VERSION <<- '0.2.2'
Robin Engler's avatar
Robin Engler committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# Define default parameter values.
DEFAULT_CELL_COMPARTMENT = 'nucleus'
DEFAULT_PHENOTYPE_CONFIDENCE_THRESHOLD = 40

# Define authorized values in input data.
NOTISSUE                 <<- 'missing'
NOTISSUES_SYNONYMS       <<- c('other', 'nothing', 'none', 'no tissue', '')
AUTHORIZED_TISSUES       <<- c('stroma', 'tumor', 'dermis', 'epidermis', 'melanocyte', 'necrosis',
                               NOTISSUE)

AUTHORIZED_COMPARTMENTS  <<- c('nucleus', 'membrane', 'cytoplasm', 'entire_cell')
AUTHORIZED_STROMA_VALUES <<- c('DAPI', 'stroma', 'other')
AUTHORIZED_TUMOR_VALUES  <<- c('CK', 'tumor')
21
AUTHORIZED_MARKERS       <<- c('CAL', 'CD3', 'CD4', 'CD8', 'CD11c', 'CD15', 'CD20', 'CD56', 'CD68',
Robin Engler's avatar
Robin Engler committed
22
                               'CD103', 'CD163', 'CD206', 'FOXP3', 'GB', 'gH2AX', 'gH2AXN', 'IDO',
23
                               'IL10R', 'Keratin', 'KI67', 'PD1', 'PDL1', 'PERFORIN', 'SOX10',
24
                               'WT1', 'CK', 'VISTA')
Robin Engler's avatar
Robin Engler committed
25
IGNORED_PHENOTYPES       <<- c('DAPIp', 'MISSING')
Robin Engler's avatar
Robin Engler committed
26
27
NO_PHENOTYPE             <<- 'MISSING'
NO_PHENOTYPE_SYNONYMS    <<- c('ARTEFACT', 'ARTEFACTS', 'OTHER')
Robin Engler's avatar
Robin Engler committed
28
29
30
31
32
33
34
35
36
37
38
39

DATAREDUCE_SCRIPT      <<- file.path(dirname(dirname(sys.frame(1)$ofile)),
                                     'inst/bash/reduce_file_size.sh')
CELL_FILES_EXTENSION   <<- '_cell_seg_data.txt'
TISSUE_FILES_EXTENSION <<- '_tissue_seg_data_summary.txt'
PARAMETERS_FILE        <<- 'parameters.txt'
THRESHOLDS_FILE        <<- 'thresholds.txt'
SAMPLE_RENAME_FILE     <<- 'sample_rename.txt'
SEGMENTATION_DATA_DIR  <<- 'seg_data'
SUMMARY_OUTPUT_DIR     <<- 'summary_statistics'
LOG_FILE_NAME          <<- 'log.txt'

40
41
42
43
44
45
46
# Individual marker files merging thresholds.
# These parameters are the thresholds above which a warning is displayed when merging individual
# files. They have no impact on the actual output, only on the display of warning messages.
#  * MARKER_INTENSITY_THRESHOLD: difference in marker intensity values (between individual files)
#    above which a warning is shown.
#  * FILE_LOSS_PERCENTAGE_THRESHOLD: threshold (as a percentage) above which a warning is
#    displayed during file merging.
47
48
49
50
51
52
53
54
55
56
#  * SHOW_TISSUE_CATEGORY_MISMATCH_WARNING: if TRUE, the warning "Tissue_category values differ
#     across files" is shown. Otherwise the warning is skipped.
#  * TISSUE_CATEGORY_MISMATCH_THRESHOLD: when there are Tissue Category mismatches between
#      individual marker files that cannot be resolved by majority ruling, the offending lines are
#      deleted and a warning is displayed to the user. If the percentage of cells (lines) deleted
#      is > TISSUE_CATEGORY_MISMATCH_THRESHOLD then an error is generated. As long as the number of
#      deleted cells remains <= the threshold, only a warning is show. The threshold value is
#      a percentage (e.g. 5 = 5%).
MARKER_INTENSITY_THRESHOLD            <<- 0.01
FILE_LOSS_PERCENTAGE_THRESHOLD        <<- 5
57
SHOW_TISSUE_CATEGORY_MISMATCH_WARNING <<- TRUE
58
TISSUE_CATEGORY_MISMATCH_THRESHOLD    <<- 5
59

Robin Engler's avatar
Robin Engler committed
60
61
62
63
64
65
66
67
68
69
70
71
# InForm version data formats supported.
SUPPORTED_INFORM_VERSIONS <<- c(2.2, 2.4)

# Load source code.
source('postinform.R')
source('input_check.R')
source('load_data.R')
source('data_reduction.R')
source('individual_markers.R')
source('rename_samples.R')
source('functions.R')
source('legacy_functions.R')