qsar-report 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,146 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE QMRF PUBLIC "http://qmrf.sourceforge.net/qmrf.dtd" "qmrf.dtd">
3
+ <QMRF author="Joint Research Centre, European Commission" contact="Joint Research Centre, European Commission" date="July 2007" email="JRC-IHCP-COMPUTOX@ec.europa.eu" name="(Q)SAR Model Reporting Format" schema_version="1.0" url="http://ihcp.jrc.ec.europa.eu/" version="1.3">
4
+ <QMRF_chapters>
5
+ <QSAR_identifier chapter="1" help="" name="QSAR identifier">
6
+ <QSAR_title chapter="1.1" help="" name="QSAR identifier (title)"/>
7
+ <QSAR_models chapter="1.2" help="" name="Other related models"/>
8
+ <QSAR_software chapter="1.3" help="" name="Software coding the model">
9
+
10
+ <software_ref idref="firstsoftware"/>
11
+ </QSAR_software>
12
+ </QSAR_identifier>
13
+ <QSAR_General_information chapter="2" help="" name="General information">
14
+ <qmrf_date chapter="2.1" help="" name="Date of QMRF"/>
15
+ <qmrf_authors chapter="2.2" help="" name="QMRF author(s) and contact details">
16
+
17
+ <author_ref idref="firstauthor"/>
18
+ <author_ref idref="secondauthor"/></qmrf_authors>
19
+ <qmrf_date_revision chapter="2.3" help="" name="Date of QMRF update(s)"/>
20
+ <qmrf_revision chapter="2.4" help="" name="QMRF update(s)"/>
21
+ <model_authors chapter="2.5" help="" name="Model developer(s) and contact details">
22
+
23
+ <author_ref idref="modelauthor"/>
24
+ </model_authors>
25
+ <model_date chapter="2.6" help="" name="Date of model development and/or publication"/>
26
+ <references chapter="2.7" help="" name="Reference(s) to main scientific papers and/or software package">
27
+
28
+ </references>
29
+ <info_availability chapter="2.8" help="" name="Availability of information about the model"/>
30
+ <related_models chapter="2.9" help="" name="Availability of another QMRF for exactly the same model"/>
31
+ </QSAR_General_information>
32
+ <QSAR_Endpoint chapter="3" help="" name="Defining the endpoint - OECD Principle 1">
33
+ <model_species chapter="3.1" help="" name="Species"/>
34
+ <model_endpoint chapter="3.2" help="" name="Endpoint">
35
+
36
+ </model_endpoint>
37
+ <endpoint_comments chapter="3.3" help="" name="Comment on endpoint"/>
38
+ <endpoint_units chapter="3.4" help="" name="Endpoint units"/>
39
+ <endpoint_variable chapter="3.5" help="" name="Dependent variable"/>
40
+ <endpoint_protocol chapter="3.6" help="" name="Experimental protocol"/>
41
+ <endpoint_data_quality chapter="3.7" help="" name="Endpoint data quality and variability"/>
42
+ </QSAR_Endpoint>
43
+ <QSAR_Algorithm chapter="4" help="" name="Defining the algorithm - OECD Principle 2">
44
+ <algorithm_type chapter="4.1" help="" name="Type of model"/>
45
+ <algorithm_explicit chapter="4.2" help="" name="Explicit algorithm">
46
+ <algorithm_ref idref="algorithms_catalog_1"/>
47
+ <equation/>
48
+ </algorithm_explicit>
49
+ <algorithms_descriptors chapter="4.3" help="" name="Descriptors in the model">
50
+
51
+ <descriptor_ref idref="descriptors_catalog_1"/>
52
+ </algorithms_descriptors>
53
+ <descriptors_selection chapter="4.4" help="" name="Descriptor selection"/>
54
+ <descriptors_generation chapter="4.5" help="" name="Algorithm and descriptor generation"/>
55
+ <descriptors_generation_software chapter="4.6" help="" name="Software name and version for descriptor generation" options="">
56
+
57
+ <software_ref idref="software_catalog_2"/>
58
+ </descriptors_generation_software>
59
+ <descriptors_chemicals_ratio chapter="4.7" help="" name="Chemicals/Descriptors ratio"/>
60
+ </QSAR_Algorithm>
61
+ <QSAR_Applicability_domain chapter="5" help="" name="Defining the applicability domain - OECD Principle 3">
62
+ <app_domain_description chapter="5.1" help="" name="Description of the applicability domain of the model"/>
63
+ <app_domain_method chapter="5.2" help="" name="Method used to assess the applicability domain"/>
64
+ <app_domain_software chapter="5.3" help="" name="Software name and version for applicability domain assessment">
65
+
66
+ <software_ref idref="software_catalog_3"/>
67
+ </app_domain_software>
68
+ <applicability_limits chapter="5.4" help="" name="Limits of applicability"/>
69
+ </QSAR_Applicability_domain>
70
+ <QSAR_Robustness chapter="6" help="" name="Internal validation - OECD Principle 4">
71
+ <training_set_availability answer="Yes" chapter="6.1" help="" name="Availability of the training set"/>
72
+ <training_set_data cas="Yes" chapter="6.2" chemname="Yes" formula="Yes" help="" inchi="Yes" mol="Yes" name="Available information for the training set" smiles="Yes"/>
73
+ <training_set_descriptors answer="All" chapter="6.3" help="" name="Data for each descriptor variable for the training set"/>
74
+ <dependent_var_availability answer="All" chapter="6.4" help="" name="Data for the dependent variable for the training set"/>
75
+ <other_info chapter="6.5" help="" name="Other information about the training set"/>
76
+ <preprocessing chapter="6.6" help="" name="Pre-processing of data before modelling"/>
77
+ <goodness_of_fit chapter="6.7" help="" name="Statistics for goodness-of-fit"/>
78
+ <loo chapter="6.8" help="" name="Robustness - Statistics obtained by leave-one-out cross-validation"/>
79
+ <lmo chapter="6.9" help="" name="Robustness - Statistics obtained by leave-many-out cross-validation"/>
80
+ <yscrambling chapter="6.10" help="" name="Robustness - Statistics obtained by Y-scrambling"/>
81
+ <bootstrap chapter="6.11" help="" name="Robustness - Statistics obtained by bootstrap"/>
82
+ <other_statistics chapter="6.12" help="" name="Robustness - Statistics obtained by other methods"/>
83
+ </QSAR_Robustness>
84
+ <QSAR_Predictivity chapter="7" help="" name="External validation - OECD Principle 4">
85
+ <validation_set_availability answer="Yes" chapter="7.1" help="" name="Availability of the external validation set"/>
86
+ <validation_set_data cas="Yes" chapter="7.2" chemname="Yes" formula="Yes" help="" inchi="Yes" mol="Yes" name="Available information for the external validation set" smiles="Yes"/>
87
+ <validation_set_descriptors answer="All" chapter="7.3" help="" name="Data for each descriptor variable for the external validation set"/>
88
+ <validation_dependent_var_availability answer="All" chapter="7.4" help="" name="Data for the dependent variable for the external validation set"/>
89
+ <validation_other_info chapter="7.5" help="" name="Other information about the external validation set"/>
90
+ <experimental_design chapter="7.6" help="" name="Experimental design of test set"/>
91
+ <validation_predictivity chapter="7.7" help="" name="Predictivity - Statistics obtained by external validation"/>
92
+ <validation_assessment chapter="7.8" help="" name="Predictivity - Assessment of the external validation set"/>
93
+ <validation_comments chapter="7.9" help="" name="Comments on the external validation of the model"/>
94
+ </QSAR_Predictivity>
95
+ <QSAR_Interpretation chapter="8" help="" name="Providing a mechanistic interpretation - OECD Principle 5">
96
+ <mechanistic_basis chapter="8.1" help="" name="Mechanistic basis of the model"/>
97
+ <mechanistic_basis_comments chapter="8.2" help="" name="A priori or a posteriori mechanistic interpretation"/>
98
+ <mechanistic_basis_info chapter="8.3" help="" name="Other information about the mechanistic interpretation"/>
99
+ </QSAR_Interpretation>
100
+ <QSAR_Miscelaneous chapter="9" help="" name="Miscellaneous information">
101
+ <comments chapter="9.1" help="" name="Comments"/>
102
+ <bibliography chapter="9.2" help="" name="Bibliography">
103
+
104
+ <publication_ref idref="publications_catalog_1"/>
105
+ </bibliography>
106
+ <attachments chapter="9.3" help="" name="Supporting information">
107
+
108
+
109
+
110
+
111
+
112
+
113
+ <attachment_training_data/>
114
+ <attachment_validation_data/>
115
+ <attachment_documents/>
116
+ </attachments>
117
+ </QSAR_Miscelaneous>
118
+ <QMRF_Summary chapter="10" help="" name="Summary (JRC QSAR Model Database)">
119
+ <QMRF_number chapter="10.1" help="" name="QMRF number">To be entered by JRC</QMRF_number>
120
+ <date_publication chapter="10.2" help="" name="Publication date">To be entered by JRC</date_publication>
121
+ <keywords chapter="10.3" help="" name="Keywords">To be entered by JRC</keywords>
122
+ <summary_comments chapter="10.4" help="" name="Comments">To be entered by JRC</summary_comments>
123
+ </QMRF_Summary>
124
+ </QMRF_chapters>
125
+ <Catalogs>
126
+ <software_catalog>
127
+ <software contact="" description="" id="firstsoftware" name="" number="" url=""/>
128
+ <software contact="" description="" id="software_catalog_2" name="" number="" url=""/>
129
+ <software contact="" description="" id="software_catalog_3" name="" number="" url=""/>
130
+ </software_catalog>
131
+ <algorithms_catalog>
132
+ <algorithm definition="" description="" id="algorithms_catalog_1" publication_ref=""/>
133
+ </algorithms_catalog>
134
+ <descriptors_catalog>
135
+ <descriptor description="" id="descriptors_catalog_1" name="" publication_ref="" units=""/>
136
+ </descriptors_catalog>
137
+ <endpoints_catalog/>
138
+ <publications_catalog>
139
+ <publication id="publications_catalog_1" title="" url=""/>
140
+ </publications_catalog>
141
+ <authors_catalog>
142
+ <author affiliation="" contact="" email="myauthor@myauthor.dom" id="firstauthor" name="Dr. My MyName" number="" url="http://myauthor.dom"/>
143
+ <author affiliation="" contact="" email="" id="modelauthor" name="" number="" url=""/>
144
+ <author id="secondauthor" name="Dr. Mysec MysecName" url="http://myauthor.dom" email="myauthor@myauthor.dom"/></authors_catalog>
145
+ </Catalogs>
146
+ </QMRF>
@@ -0,0 +1,197 @@
1
+ {
2
+ "meta": {
3
+ "description": "qprf report",
4
+ "title": "qprf report",
5
+ "qprf_version": "1.1",
6
+ "date": ""
7
+ },
8
+ "visible": true,
9
+ "singleCalculations": {
10
+ "Date": "2016/08/21",
11
+ "Disclaimer and Instructions": "Please fill in the fields of the QPRF with information about the prediction and the substance for which the prediction is made. The information that you provide will be used to facilitate considerations on the adequacy of the prediction (model result) in relation to a defined regulatory purpose. The adequacy of a prediction depends on the following conditions: a) the (Q)SAR model is scientifically valid: the scientific validity is established according to the OECD principles for (Q)SAR validation; b) the (Q)SAR model is applicable to the query chemical: a (Q)SAR is applicable if the query chemical falls within the defined applicability domain of the model; c) the (Q)SAR result is reliable: a valid (Q)SAR that is applied to a chemical falling within its applicability domain provides a reliable result; d) the (Q)SAR model is relevant for the regulatory purpose: the predicted endpoint can be used directly or following an extrapolation, possibly in combination with other information, for a particular regulatory purpose. A (Q)SAR prediction (model result) may be considered adequate if it is reliable and relevant, and depending on the totality of information available in a weight-of-evidence assessment (see Section 4 of the QPRF).",
12
+ "Time": "",
13
+ "Title": "My QPRF Report",
14
+ "Version": "2.1"
15
+ },
16
+ "arrayCalculations": {
17
+ "1. Substance": {
18
+ "colNames": [
19
+ "Title",
20
+ "Value"
21
+ ],
22
+ "values": {
23
+ "General": [
24
+ "Instructions",
25
+ "This section is aimed at defining the substance for which the (Q)SAR prediction is made."
26
+ ],
27
+ "1.1": [
28
+ "CAS number",
29
+ "7732-18-5"
30
+ ],
31
+ "1.2": [
32
+ "EC number",
33
+ "Report the EC number."
34
+ ],
35
+ "1.3": [
36
+ "Chemical name",
37
+ "Report the chemical names (IUPAC and CAS names)."
38
+ ],
39
+ "1.4": [
40
+ "Structural formula",
41
+ "Report the structural formula."
42
+ ],
43
+ "1.5 General": [
44
+ "Structure codes",
45
+ "Report available structural information for the substance, including the structure code used to run the model. If you used a SMILES or InChI code, report the code in the corresponding field below. If you have used any another format (e.g. mol file), please include the corresponding structural representation as supporting information."
46
+ ],
47
+ "1.5 a.": [
48
+ "SMILES",
49
+ "Report the SMILES of the substance (indicate if this is the one used for the model prediction)."
50
+ ],
51
+ "1.5 b.": [
52
+ "InChI",
53
+ "Report the InChI code of the substance (indicate if this is the one used for the model prediction)."
54
+ ],
55
+ "1.5 c.": [
56
+ "Other structural representation",
57
+ "Indicate if another structural representation was used to generate the prediction. Indicate whether this information is included as supporting information. Example: 'mol file used and included in the supporting information'."
58
+ ],
59
+ "1.5 d.": [
60
+ "Stereochemical features",
61
+ "Indicate whether the substance is a stereo-isomer and consequently may have properties that depend on the orientation of its atoms in space. Identify the stereochemical features that may affect the reliability of predictions for the substance, e.g. cis-trans isomerism, chiral centres. Are these features encoded in the structural representations mentioned above?"
62
+ ]
63
+ }
64
+ },
65
+ "2. General information": {
66
+ "colNames": [
67
+ "Title",
68
+ "Value"
69
+ ],
70
+ "values": {
71
+ "General": [
72
+ "Instructions",
73
+ "General information about the compilation of the current QPRF is provided in this section."
74
+ ],
75
+ "2.1": [
76
+ "Date of QPRF",
77
+ "Report the date of compilation of the QPRF. Example: “01 January 2007”."
78
+ ],
79
+ "2.2": [
80
+ "QPRF author and contact details",
81
+ "Report the contact details of the author of the QPRF."
82
+ ]
83
+ }
84
+ },
85
+ "3. Prediction": {
86
+ "colNames": [
87
+ "Title",
88
+ "Value"
89
+ ],
90
+ "values": {
91
+ "General": [
92
+ "Instructions",
93
+ "The information provided in this section will help to facilitate considerations on the scientific validity of the model (as defined in the OECD Principles for the validation of (Q)SAR models) and the reliability of the prediction. Detailed information on the model are stored in the corresponding QMRF which is devised to reflect as much as possible the OECD principles. Remember that the QMRF and the QPRF are complementary, and a QPRF should always be associated with a defined QMRF."
94
+ ],
95
+ "3.1 General": [
96
+ "Endpoint",
97
+ "(OECD Principle 1)"
98
+ ],
99
+ "3.1 a.": [
100
+ "Endpoint",
101
+ "Define the endpoint for which the model provides predictions (this information should correspond to the information provided in the QMRF under fields 3.2 and 3.3). Example: 'Nitrate radical degradation rate constant KNO3'."
102
+ ],
103
+ "3.1 b.": [
104
+ "Dependent variable",
105
+ "Report the dependent variable for which the model provides predictions including any transformations introduced for modelling purposes (note that this information should correspond to the information provided in the QMRF under field 3.5). Example: '-log (KNO3)'."
106
+ ],
107
+ "3.2 General": [
108
+ "Algorithm",
109
+ "(OECD Principle 2)"
110
+ ],
111
+ "3.2 a.": [
112
+ "Model or submodel name",
113
+ "Identify the model used to make the prediction and possibly report its name as stored in the corresponding QMRF; in the QMRF the model name is reported in the field QSAR identifier. Examples: “BIOWIN for Biodegradation”; “TOPKAT Developmental Toxicity Potential”. If applicable identify the specific submodel or algorithm applicable to the specific chemical Examples: 'BIOWIN '; 'TOPKAT Skin Irritation Acyclics (Acids, Amines, Esters) MOD v SEV Model'; 'ECOSAR esters model'."
114
+ ],
115
+ "3.2 b.": [
116
+ "Model version",
117
+ "Identify, where relevant, the version number and/or date of the model and submodel."
118
+ ],
119
+ "3.2 c.": [
120
+ "Reference to QMRF",
121
+ "Provide relevant information about the QMRF that stores information about the model used to make the prediction. Possible useful pieces of information are: availability, source, reference number (if any) of the QMRF. Examples: 'The corresponding QMRF named -BIOWIN for Biodegradation- has been downloaded from the JRC QSAR Model Database'; 'The corresponding QMRF named -TOPKAT Skin Irritation Acyclics (Acids, Amines, Esters) MOD v SEV Model- has been newly compiled'."
122
+ ],
123
+ "3.2 d.": [
124
+ "Predicted value (model result)",
125
+ "Report the predicted value (including units) obtained from the application of the model to the query chemical. For an expert system such as Derek for Windows, report the alert triggered together with the reasoning. Example: ' aromatic amine - mutagenicity, plausible'."
126
+ ],
127
+ "3.2 e.": [
128
+ "Predicted value (comments)",
129
+ "If the result is qualitative (e.g. yes/no) or semi-quantitative (e.g. low/medium/high), explain the cut-off values that were used as the basis for classification. In reporting the predicted value, pay attention to the transformations (e.g. if the prediction is made in log units, apply anti-logarithm function)."
130
+ ],
131
+ "3.2 f.": [
132
+ "Input for prediction",
133
+ "Specify what kind of input was used to generate the prediction (SMILES, mol file, graphical interface etc). Please provide the structure code used to generate the prediction (unless already provided in section 1.5)."
134
+ ],
135
+ "3.2 g.": [
136
+ "Descriptor values",
137
+ "Where appropriate, report the values (experimental or calculated data) for numerical descriptors and indicate which values were used for making the prediction."
138
+ ],
139
+ "3.3 General": [
140
+ "Applicability domain",
141
+ "(OECD principle 3)"
142
+ ],
143
+ "3.3 a.": [
144
+ "Domains",
145
+ "Discuss whether the query chemical falls in the applicability domain of the model as defined in the corresponding QMRF (section 5 of QMRF, Defining the applicability domain - OECD Principle 3). If additional software/methods were used to assess the applicability domain then they should also be documented in this section. Include a discussion about: i. descriptor domain ii. structural fragment domain (e.g., discuss whether the chemical contains fragments that are not represented in the model training set) iii. mechanism domain (discuss whether the chemical is known or considered to act according to the mechanism of action associated with the used model) iv. metabolic domain, if relevant"
146
+ ],
147
+ "3.3 b.": [
148
+ "Structural analogues",
149
+ "List the structural analogues that are present in the training or test sets, or accessible from other sources (in this case you should explain how the structural analogue was retrieved1) and why they are considered analogues). For each analogue, report the CAS number, the structural formula, the SMILES code, and the source (e.g., training set, test set or other source). For an expert system (like Derek for Windows or TOPKAT), the example compounds or structurally related analogues with their experimental data should be provided here."
150
+ ],
151
+ "3.3 c.": [
152
+ "Considerations on structural analogues",
153
+ "Discuss how predicted and experimental data for analogues support the prediction of the chemical under consideration. "
154
+ ],
155
+ "3.4": [
156
+ "The uncertainty of the prediction (OECD principle 4)",
157
+ "If possible, comment on the uncertainty of the prediction for this chemical, taking into account relevant information (e.g. variability of the experimental results). "
158
+ ],
159
+ "3.5": [
160
+ "The chemical and biological mechanisms according to the model underpinning the predicted result (OECD principle 5)",
161
+ "Discuss the mechanistic interpretation of the model prediction for this specific chemical. For an expert system based on structural alerts (e.g. Derek for Windows, OncologicTM) the rationale for the structural alert fired should be provided."
162
+ ]
163
+ }
164
+ },
165
+ "4. Adequacy (Optional)": {
166
+ "colNames": [
167
+ "Title",
168
+ "Value"
169
+ ],
170
+ "values": {
171
+ "General": [
172
+ "Instructions",
173
+ "The information provided in this section might be useful, depending on the reporting needs and formats of the regulatory framework of interest. This information aims to facilitate considerations about the adequacy of the (Q)SAR prediction (result) estimate. A (Q)SAR prediction may or may not be considered adequate ('fit-for-purpose'), depending on whether the prediction is sufficiently reliable and relevant in relation to the particular regulatory purpose. The adequacy of the prediction also depends on the availability of other information, and is determined in a weight-of-evidence assessment."
174
+ ],
175
+ "4.1": [
176
+ "Regulatory purpose",
177
+ "Explain the regulatory purpose for which the prediction described in Section 3 is being used."
178
+ ],
179
+ "4.2": [
180
+ "Approach for regulatory interpretation of the model result",
181
+ "Describe how the predicted result is going to be interpreted in light of the specific regulatory purpose (e.g. by applying an algorithm or regulatory criteria). This may involve the need to convert the units of the dependent variable (e.g. from log molar units to mg/l). It may also involve the application of another algorithm, an assessment factor, or regulatory criteria, and the use or consideration of additional information in a weight-of-evidence assessment. "
182
+ ],
183
+ "4.3": [
184
+ "Outcome",
185
+ "Report the interpretation of the model result in relation to the defined regulatory purpose."
186
+ ],
187
+ "4.4": [
188
+ "Conclusion",
189
+ "Provide an assessment of whether the final result is considered adequate for a regulatory conclusion, or whether additional information is required (and, if so, what this additional information should be)."
190
+ ]
191
+ }
192
+ }
193
+ },
194
+ "figures": {
195
+ },
196
+ "_id": ""
197
+ }
@@ -0,0 +1,74 @@
1
+ require_relative "setup.rb"
2
+
3
+ class QMRFReportTest < MiniTest::Test
4
+
5
+ def test_0_self
6
+ puts "MiniTest #{self.class} start OK"
7
+ end
8
+
9
+ def test_1_base
10
+ report = OpenTox::QMRFReport.new
11
+ assert report
12
+ assert_kind_of(OpenTox::QMRFReport, report)
13
+ end
14
+
15
+ def test_2_validate
16
+ report = OpenTox::QMRFReport.new
17
+ assert_empty report.validate
18
+ end
19
+
20
+ def test_3_write_some_values
21
+ report = OpenTox::QMRFReport.new
22
+ report.Value "QSAR_title", "My QSAR Title"
23
+ report.Value "QSAR_models", "My QSAR Model"
24
+ assert_equal report.Value("QSAR_title"), "My QSAR Title"
25
+ assert_equal report.Value("QSAR_models"), "My QSAR Model"
26
+ refute_equal report.Value("QSAR_title"), "lazar"
27
+ end
28
+
29
+ def test_4_write_check
30
+ report = OpenTox::QMRFReport.new
31
+ report.Value "QSAR_title", "My QSAR Title"
32
+ report.Value "QSAR_models", "My QSAR Model"
33
+ assert_equal report.to_xml, File.read(File.join(File.join(DATA_DIR, "qmrf_t4.xml")))
34
+ end
35
+
36
+ def test_5_write_catalog
37
+ report = OpenTox::QMRFReport.new
38
+ report.change_catalog :software_catalog, :firstsoftware, {:name => "lazar", :contact => "in-silico toxicology gmbh", :url => "https://lazar.in-silico.ch", :description => "lazar toxicity predictions"}
39
+ assert "in-silico toxicology gmbh", report.get_catalog_value(:software_catalog, :firstsoftware, :contact)
40
+ assert "lazar", report.get_catalog_value(:software_catalog, :firstsoftware, :name)
41
+ assert "https://lazar.in-silico.ch", report.get_catalog_value(:software_catalog, :firstsoftware, :url)
42
+ assert "lazar toxicity predictions", report.get_catalog_value(:software_catalog, :firstsoftware, :description)
43
+ end
44
+
45
+ def test_6_check_catalog_exists
46
+ report = OpenTox::QMRFReport.new
47
+ assert_raises RuntimeError do
48
+ report.catalog_exists? :noexist_catalog
49
+ end
50
+ assert report.catalog_exists? :software_catalog
51
+ end
52
+
53
+ def test_7_write_alot
54
+ report = OpenTox::QMRFReport.new
55
+ report.Value "QSAR_title", "My QSAR Title"
56
+ report.Value "QSAR_models", "My QSAR Model"
57
+ report.change_catalog :software_catalog, :firstsoftware, {:name => "lazar", :contact => "in-silico toxicology gmbh", :url => "https://lazar.in-silico.ch", :description => "lazar toxicity predictions"}
58
+ report.change_catalog :publications_catalog, :publications_catalog_1, {:title => "MyName M (2016) My Publication Title, QSAR News, 10, 14-22", :url => "http://myqsarnewsmag.dom"}
59
+ report.change_catalog :publications_catalog, :publications_catalog_2, {:title => "MyName M (2016) My Second Publication Title, Hornblower, 101ff.", :url => "http://hornblower.dom"}
60
+ assert_equal report.to_xml, File.read(File.join(File.join(File.dirname(__FILE__),"data/qmrf_t7.xml")))
61
+ report.change_catalog :publications_catalog, :publications_catalog_3, {:title => "MyName M (2016) My Third Publication Title, Somewhereelse, 43f.", :url => "http://somewhereelse.dom"}
62
+ refute_equal report.to_xml, File.read(File.join(File.join(DATA_DIR, "qmrf_t7.xml")))
63
+ end
64
+
65
+ def test_8_ref_catalog_entry
66
+ report = OpenTox::QMRFReport.new
67
+ report.change_catalog :authors_catalog, :firstauthor, {:name => "Dr. My MyName", :url => "http://myauthor.dom", :email => "myauthor@myauthor.dom"}
68
+ report.ref_catalog :qmrf_authors, :authors_catalog, :firstauthor
69
+ report.change_catalog :authors_catalog, :secondauthor, {:name => "Dr. Mysec MysecName", :url => "http://myauthor.dom", :email => "myauthor@myauthor.dom"}
70
+ report.ref_catalog :qmrf_authors, :authors_catalog, :secondauthor
71
+ assert_equal report.to_xml, File.read(File.join(File.join(DATA_DIR, "qmrf_t8.xml")))
72
+ end
73
+
74
+ end
@@ -0,0 +1,52 @@
1
+ require_relative "setup.rb"
2
+
3
+ class QMRFReportTest < MiniTest::Test
4
+
5
+ def test_0_self
6
+ puts "MiniTest #{self.class} start OK"
7
+ end
8
+
9
+ def test_1_base
10
+ report = OpenTox::QPRFReport.new
11
+ assert report
12
+ assert_kind_of(OpenTox::QPRFReport, report)
13
+ assert report.to_json
14
+ assert report.to_html
15
+ assert report.pretty_json
16
+ end
17
+
18
+ def test_2_md
19
+ report = OpenTox::QPRFReport.new
20
+ assert report.to_html
21
+ end
22
+
23
+ def test_3_get_Title
24
+ report = OpenTox::QPRFReport.new
25
+ assert_equal report.Title, "QSAR Prediction Reporting Format (QPRF)"
26
+ end
27
+
28
+ def test_4_set_Values
29
+ report = OpenTox::QPRFReport.new
30
+ report.Title = "My Test Title"
31
+ report.Version = "12"
32
+ assert_equal report.Title, "My Test Title"
33
+ assert_equal report.Version, "12"
34
+ #puts report.to_html
35
+ end
36
+
37
+ def test_5_get_11
38
+ report = OpenTox::QPRFReport.new
39
+ report.Value "1.1", "7732-18-5"
40
+ assert_equal report.Value("1.1"), "7732-18-5"
41
+ end
42
+
43
+ def test_6_set_more_Values
44
+ report = OpenTox::QPRFReport.new
45
+ report.Title = "My QPRF Report"
46
+ report.Version = "2.1"
47
+ report.Date = "2016/08/21"
48
+ report.Value "1.1", "7732-18-5"
49
+ assert_equal report.pretty_json, File.read(File.join(DATA_DIR,'qprf-t6.json'))
50
+ end
51
+
52
+ end