annotate src/lib/Constants.R @ 0:e0b5980139d9

maaslin
author george-weingart
date Tue, 13 May 2014 22:00:40 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
1 #####################################################################################
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
2 #Copyright (C) <2012>
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
3 #
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
4 #Permission is hereby granted, free of charge, to any person obtaining a copy of
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
5 #this software and associated documentation files (the "Software"), to deal in the
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
6 #Software without restriction, including without limitation the rights to use, copy,
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
7 #modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
8 #and to permit persons to whom the Software is furnished to do so, subject to
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
9 #the following conditions:
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
10 #
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
11 #The above copyright notice and this permission notice shall be included in all copies
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
12 #or substantial portions of the Software.
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
13 #
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
14 #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
15 #INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
16 #PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
17 #HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
18 #OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
19 #SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
20 #
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
21 # This file is a component of the MaAsLin (Multivariate Associations Using Linear Models),
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
22 # authored by the Huttenhower lab at the Harvard School of Public Health
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
23 # (contact Timothy Tickle, ttickle@hsph.harvard.edu).
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
24 #####################################################################################
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
25
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
26 inlinedocs <- function(
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
27 ##author<< Curtis Huttenhower <chuttenh@hsph.harvard.edu> and Timothy Tickle <ttickle@hsph.harvard.edu>
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
28 ##description<< Global project constants.
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
29 ) { return( pArgs ) }
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
30
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
31 #General
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
32 c_COMMA = ","
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
33 c_DASH = "-"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
34
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
35 #For reading IO
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
36 c_MATRIX_NAME = "Matrix:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
37 c_FILE_NAME = "File:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
38 c_DELIMITER = "Delimiter:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
39 c_ID_ROW = "Name_Row_Number:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
40 c_ID_COLUMN = "Name_Column_Number:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
41 c_ROWS = "Read_Rows:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
42 c_PCLROWS = "Read_PCL_Rows:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
43 c_TSVROWS = "Read_TSV_Rows:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
44 c_COLUMNS = "Read_Columns:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
45 c_PCLCOLUMNS = "Read_PCL_Columns:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
46 c_TSVCOLUMNS = "Read_TSV_Columns:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
47 c_CHARACTER_DATA_TYPE = "DT_Character:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
48 c_FACTOR_DATA_TYPE = "DT_Factor:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
49 c_INTEGER_DATA_TYPE = "DT_Integer:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
50 c_LOGICAL_DATA_TYPE = "DT_Logical:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
51 c_NUMERIC_DATA_TYPE = "DT_Numeric:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
52 c_ORDEREDFACTOR_DATA_TYPE = "DT_Ordered_Factor:"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
53
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
54 ### The name of the data matrix read in using a read.config file
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
55 c_strMatrixData <- "Abundance"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
56 ### The name of the metadata matrix read in using a read.config file
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
57 c_strMatrixMetadata <- "Metadata"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
58 # Settings for MFA visualization/ordination
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
59 c_iMFA <- 30
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
60 c_dHeight <- 9
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
61 c_dDefaultScale = 0.5
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
62 # The column that is used to determine if information meets a certain significance threshold (dSignificanceLevel) to include in the Summary text file)
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
63 c_strKeywordEvaluatedForInclusion <- "Q.value"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
64 #The name of the custom process function
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
65 c_strCustomProcessFunction = "processFunction"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
66
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
67 #Delimiters
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
68 #Feature name delimiter
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
69 c_cFeatureDelim = "|"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
70 c_cFeatureDelimRex = "\\|"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
71
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
72 #The word used for unclassified
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
73 c_strUnclassified = "unclassified"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
74
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
75 #Maaslincore settings
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
76 #If a metadata does not have more than count of unique values, it is changed to factor data mode.
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
77 c_iNonFactorLevelThreshold = 3
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
78
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
79 #Extensions
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
80 c_sDetailFileSuffix = ".txt"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
81 c_sSummaryFileSuffix = ".txt"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
82 c_sLogFileSuffix = "_log"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
83
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
84 #Delimiter for output tables
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
85 c_cTableDelimiter="\t"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
86
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
87 #Testing Related
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
88 c_strTestingDirectory = "testing"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
89 c_strCorrectAnswers = "answers"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
90 c_strTemporaryFiles = "tmp"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
91 c_strTestingInput = "input"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
92
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
93 #Reading matrix defaults
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
94 c_strDefaultMatrixDelimiter = "\t"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
95 c_strDefaultMatrixRowID = "1"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
96 c_strDefaultMatrixColID = "1"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
97 c_strDefaultReadRows = "-"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
98 c_strDefaultReadCols = "-"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
99
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
100 #Separator used when collapsing factor names
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
101 c_sFactorNameSep = ""
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
102
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
103 #Separator used by the mfa
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
104 c_sMFANameSep1 = "_"
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
105 c_sMFANameSep2 = "."
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
106
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
107 #Analysis Module list positioning
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
108 c_iSelection = 1
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
109 c_iTransform = 2
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
110 c_iAnalysis = 3
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
111 c_iResults = 4
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
112 c_iUnTransform = 5
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
113 c_iIsUnivariate = 6
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
114
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
115 #Count based models
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
116 c_vCountBasedModels = c("neg_binomial","quasi")
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
117
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
118 # Na action in anaylsis, placed here to standardize
e0b5980139d9 maaslin
george-weingart
parents:
diff changeset
119 c_strNA_Action = "na.omit"