comparison src/breadcrumbs/src/ConstantsBreadCrumbs.py @ 0:2f4f6f08c8c4 draft

Uploaded
author george-weingart
date Tue, 13 May 2014 21:58:57 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2f4f6f08c8c4
1 """
2 Author: Timothy Tickle
3 Description: Project constants.
4 """
5
6 #####################################################################################
7 #Copyright (C) <2012>
8 #
9 #Permission is hereby granted, free of charge, to any person obtaining a copy of
10 #this software and associated documentation files (the "Software"), to deal in the
11 #Software without restriction, including without limitation the rights to use, copy,
12 #modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
13 #and to permit persons to whom the Software is furnished to do so, subject to
14 #the following conditions:
15 #
16 #The above copyright notice and this permission notice shall be included in all copies
17 #or substantial portions of the Software.
18 #
19 #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
20 #INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
21 #PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 #HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 #OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 #SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #####################################################################################
26
27 __author__ = "Timothy Tickle"
28 __copyright__ = "Copyright 2012"
29 __credits__ = ["Timothy Tickle"]
30 __license__ = "MIT"
31 __maintainer__ = "Timothy Tickle"
32 __email__ = "ttickle@sph.harvard.edu"
33 __status__ = "Development"
34
35 ##
36 #Used to test the FileIO class
37 class ConstantsBreadCrumbs():
38 """
39 Class to hold project constants.
40 """
41
42 #Character Constants
43 c_strComma = ','
44 c_strColon = ':'
45 c_strConfigFileHeaderChar = '['
46 c_strConfigFileCommentChar = '#'
47 c_strEndline = '\n'
48 c_strExtDelim = '.'
49 c_cFastaIDLineStart = '>'
50 c_strPathDelim = '/'
51 c_cPipe = '|'
52 c_cQuote = '\"'
53 c_cTab = '\t'
54 c_strWhiteSpace = ' '
55 c_matrixFileDelim = '\t'
56
57 c_strBreadCrumbsSVMSpace = c_strWhiteSpace
58
59 #Default values for missing data in the Abundance Table
60 c_strEmptyAbundanceData = "0"
61 c_strEmptyDataMetadata = "NA"
62 c_strSVMNoSample = "-"
63
64 lNAs = list(set(["NA","na","Na","nA",c_strEmptyDataMetadata]))
65
66 #TODO remove
67 #Reference to circlader
68 c_strCircladerScript = "circlader/circlader.py"
69
70 #AbundanceTable
71 #Suffix given to a file that is check with the checkRawDataFile method
72 OUTPUT_SUFFIX = "-checked.pcl"
73
74 #BIOM related
75 #PCL File metadata defaults (many of these come from biom file requirements
76 #ID
77 c_strIDKey = "id"
78 c_strDefaultPCLID = None
79
80 #File date
81 c_strDateKey = "date"
82
83 #File format type
84 c_strFormatKey = "format"
85 c_strDefaultPCLFileFormateType = "PCL"
86
87 #File generation source
88 c_strSourceKey = "source"
89 c_strDefaultPCLGenerationSource = None
90
91 #File type
92 c_strTypekey = "type"
93 c_strDefaultPCLFileTpe = None
94
95 #Allowable file types for biom files
96 c_strOTUType = "OTU"
97 c_strOTUBIOMType = "OTU table"
98 c_strPathwayType = "Pathway"
99 c_strPathwayBIOMType = "Pathway table"
100 c_strFunctionType = "Function"
101 c_strFunctionBIOMType = "Function table"
102 c_strOrthologType = "Ortholog"
103 c_strOrthologBIOMType = "Ortholog table"
104 c_strGeneType = "Gene"
105 c_strGeneBIOMType = "Gene table"
106 c_strMetaboliteType = "Metabolite"
107 c_strMetaboliteBIOMType = "Metabolite table"
108 c_strTaxonType = "Taxon"
109 c_strTaxonBIOMType = "Taxon table"
110 c_dictFileType = {c_strOTUType:c_strOTUBIOMType, c_strPathwayType:c_strPathwayBIOMType, c_strFunctionType:c_strFunctionBIOMType, c_strOrthologType:c_strOrthologBIOMType, c_strGeneType:c_strGeneBIOMType, c_strMetaboliteType:c_strMetaboliteBIOMType, c_strTaxonType:c_strTaxonType}
111
112 #File URL
113 c_strURLKey = "url"
114 c_strDefaultPCLURL = None
115 c_strFormatUrl = "format_url"
116
117 #File sparse matrix
118 c_strSparsityKey = "sparsity"
119 c_fDefaultPCLSparsity = False
120
121 # BIOM related Data
122 # Data shape
123 c_strDataShapeKey = "shape"
124
125 ######################################################################
126 # Constants related to biom import and export files #
127 ######################################################################
128 # Biom file extension
129 c_strBiomFile = "biom"
130 c_BiomTaxData = "BiomTaxData"
131 c_MetadataID = "column_metadata_id"
132 c_Metadata = "Metadata"
133 c_metadata_lowercase = "metadata"
134 c_sLastMetadata = "sLastMetadata"
135 c_columns = "columns"
136 c_rows = "rows"
137 c_ascii = "ascii"
138 c_ignore = "ignore"
139 c_Dtype = "Dtype"
140 c_ID = "ID"
141 c_id_lowercase = "id"
142 c_f4 = "f8"
143 c_biom_file_generated_by = "BreadCrumbs"
144 c_strPCLFile = "pcl"
145 c_taxonomy = "taxonomy"
146 c_dRowsMetadata = "dRowsMetadata"
147 c_BiomFileInfo = "BiomFileInfo"
148 c_MatrixTtype = "matrix_type"
149 c_GeneratedBy = "generated_by"
150 c_MetadataEntriesTotal = "MetadataEntriesTotal"
151 c_MaximumLength = "MaximumLength"
152
153
154 def __init__(self):
155 pass