qsar-report 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b36d91146940f6c752ac94d1df770468a445423
4
- data.tar.gz: c3d31e0a3ff976d273b009158c1c2f3f4214bae3
3
+ metadata.gz: 64a39f9e1511d0f8f585aa3fa316dbd349d6c30f
4
+ data.tar.gz: 1fe77d4ed35aeba2d7927eae6608f7a1ddee36c1
5
5
  SHA512:
6
- metadata.gz: 866edd13851bddd06476e9f76abadcd0c7834fcc92f058a2398a6a1b9c30733759a7dc23dc120e847cf300edd4dadcd13b961175031592e505177ee76b2cbc46
7
- data.tar.gz: 3db055f65b0e9b2ed165ccef85c99462d71a17a222aa58562a6b19a39da9f0e1ece8c7eb5f50ae934768598bff1521a07c792b8342eef3615fc496ae4ab90eb1
6
+ metadata.gz: eff30e0c0d94da86a568f967a46fb13cc5e6fcf893b953aa1bb809748946b12151fa271b04945049c04017c56d419385c7cbc5c1b2c0c1215c865df991619bfb
7
+ data.tar.gz: 18a34a213877e2025b9aebe47ec61e4921a4152645dca17b742a3bda525dd1341eaceb954687dd3725d9e4a3ba507ccdcc6a8bbcc763d1ce46608d6b699ab07f
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # QSAR-Report
2
2
  QMRF and QPRF reporting extension to OpenTox ruby modules and lazar
3
3
  ## About
4
- Class for QMRF and QPRF reporting.
4
+ Class for QMRF and QPRF reporting.
5
5
  * QMRF:
6
6
  Provides a ruby OpenTox class to prepare an initial version of a QMRF report.
7
7
  The XML output is in QMRF version 1.3 and can be finalized with the QMRF editor 2.0 (https://sourceforge.net/projects/qmrf/)
8
8
  * QPRF:
9
- Provides a ruby OpenTox class to prepare an initial version of a QPRF report in JSON or HTML.
9
+ Provides a ruby OpenTox class to prepare an initial version of a QPRF (version 1.1) report in JSON or HTML.
10
10
 
11
11
  ## Usage
12
12
  ### QMRF
@@ -18,7 +18,7 @@ require "qsar-report"
18
18
  report = OpenTox::QMRFReport.new
19
19
 
20
20
  # add a title
21
- report.change_qmrf_tag "QSAR_title", "My QSAR Title"
21
+ report.value "QSAR_title", "My QSAR Title"
22
22
 
23
23
  # add a publication to the publication catalog
24
24
  report.change_catalog :publications_catalog, :publications_catalog_1, {:title => "MyName M (2016) My Publication Title, QSAR News, 10, 14-22", :url => "http://myqsarnewsmag.dom"}
@@ -50,7 +50,7 @@ report.Version = "1"
50
50
  report.Date = Time.now.strftime("%Y/%m/%d")
51
51
 
52
52
  # Set the CAS number in chapter 1.1
53
- report.Value "1.1", "7732-18-5" # set CAS number for H²O
53
+ report.value "1.1", "7732-18-5" # set CAS number for H²O
54
54
 
55
55
  # print HTML version
56
56
  puts report.to_html
@@ -60,4 +60,17 @@ puts report.pretty_json
60
60
 
61
61
  ```
62
62
 
63
+ Installation
64
+ ------------
65
+
66
+ gem install qsar-report
67
+
68
+ Documentation
69
+ -------------
70
+ * [RubyDoc.info Code documentation](http://www.rubydoc.info/gems/qsar-report)
71
+ * For full information on QSAR reporting see: [JRC QSAR Model Database and QSAR Model Reporting Formats](https://eurl-ecvam.jrc.ec.europa.eu/databases/jrc-qsar-model-database-and-qsar-model-reporting-formats)
72
+
73
+ Copyright
74
+ ---------
75
+ Copyright (c) 2016 Christoph Helma, Micha Rautenberg, Denis Gebele. See LICENSE for details.
63
76
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/lib/qmrf-report.rb CHANGED
@@ -10,7 +10,7 @@ module OpenTox
10
10
  #@example Report
11
11
  # require "qsar-report"
12
12
  # report = OpenTox::QMRFReport.new
13
- # report.change_qmrf_tag "QSAR_title", "My QSAR Title"
13
+ # report.value "QSAR_title", "My QSAR Title"
14
14
  # report.change_catalog :publications_catalog, :publications_catalog_1, {:title => "MyName M (2016) My Publication Title, QSAR News, 10, 14-22", :url => "http://myqsarnewsmag.dom"}
15
15
  # report.ref_catalog :bibliography, :publications_catalog, :publications_catalog_1
16
16
  # puts report.to_xml
@@ -48,7 +48,7 @@ module OpenTox
48
48
  # @param [String] value Value to change. If not set the function returns the current value
49
49
  # @return [Error] returns Error message if fails
50
50
  # @return [String] returns value
51
- def Value key, value=nil
51
+ def value key, value=nil
52
52
  raise "Can not edit attribute #{key} directly. Edit the catalog with 'report.change_catalog(catalog, key, value)'." if ["QSAR_software","QSAR_Algorithm", ""].include? key
53
53
  t = @report.at_css key
54
54
  t.content = value unless value.nil?
data/lib/qprf-report.rb CHANGED
@@ -14,7 +14,7 @@ module OpenTox
14
14
  # report.Title = "My QPRF Report"
15
15
  # report.Version = "1"
16
16
  # report.Date = Time.now.strftime("%Y/%m/%d")
17
- # report.Value "1.1", "7732-18-5" # set CAS number for H²O
17
+ # report.value "1.1", "7732-18-5" # set CAS number for H²O
18
18
  # puts report.to_html
19
19
 
20
20
  class QPRFReport
@@ -56,12 +56,12 @@ module OpenTox
56
56
  # Set or Get a value in the QPRF report
57
57
  #@example for CAS Number
58
58
  # report = OpenTox::QPRFReport.new
59
- # report.Value "1.1", "7732-18-5"
59
+ # report.value "1.1", "7732-18-5"
60
60
  #
61
61
  # @param [String] chapter Name of the chapter - e.g.: "1.1", "1.2", "1.3", "1.4", "1.5 General", "1.5 a.", "1.5 b.", "1.5 c.", "1.5 d.", "2.1" ...
62
62
  # @param [String] value Value to set. If not set the function returns the current value
63
63
  # @return [String] returns Value
64
- def Value chapter, value=nil
64
+ def value chapter, value=nil
65
65
  case chapter
66
66
  when /^1\.\d*/
67
67
  block = "1. Substance"
data/test/qmrf-report.rb CHANGED
@@ -19,17 +19,17 @@ class QMRFReportTest < MiniTest::Test
19
19
 
20
20
  def test_3_write_some_values
21
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"
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
27
  end
28
28
 
29
29
  def test_4_write_check
30
30
  report = OpenTox::QMRFReport.new
31
- report.Value "QSAR_title", "My QSAR Title"
32
- report.Value "QSAR_models", "My QSAR Model"
31
+ report.value "QSAR_title", "My QSAR Title"
32
+ report.value "QSAR_models", "My QSAR Model"
33
33
  assert_equal report.to_xml, File.read(File.join(File.join(DATA_DIR, "qmrf_t4.xml")))
34
34
  end
35
35
 
@@ -52,8 +52,8 @@ class QMRFReportTest < MiniTest::Test
52
52
 
53
53
  def test_7_write_alot
54
54
  report = OpenTox::QMRFReport.new
55
- report.Value "QSAR_title", "My QSAR Title"
56
- report.Value "QSAR_models", "My QSAR Model"
55
+ report.value "QSAR_title", "My QSAR Title"
56
+ report.value "QSAR_models", "My QSAR Model"
57
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
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
59
  report.change_catalog :publications_catalog, :publications_catalog_2, {:title => "MyName M (2016) My Second Publication Title, Hornblower, 101ff.", :url => "http://hornblower.dom"}
data/test/qprf-report.rb CHANGED
@@ -25,7 +25,7 @@ class QMRFReportTest < MiniTest::Test
25
25
  assert_equal report.Title, "QSAR Prediction Reporting Format (QPRF)"
26
26
  end
27
27
 
28
- def test_4_set_Values
28
+ def test_4_set_values
29
29
  report = OpenTox::QPRFReport.new
30
30
  report.Title = "My Test Title"
31
31
  report.Version = "12"
@@ -36,16 +36,16 @@ class QMRFReportTest < MiniTest::Test
36
36
 
37
37
  def test_5_get_11
38
38
  report = OpenTox::QPRFReport.new
39
- report.Value "1.1", "7732-18-5"
40
- assert_equal report.Value("1.1"), "7732-18-5"
39
+ report.value "1.1", "7732-18-5"
40
+ assert_equal report.value("1.1"), "7732-18-5"
41
41
  end
42
42
 
43
- def test_6_set_more_Values
43
+ def test_6_set_more_values
44
44
  report = OpenTox::QPRFReport.new
45
45
  report.Title = "My QPRF Report"
46
46
  report.Version = "2.1"
47
47
  report.Date = "2016/08/21"
48
- report.Value "1.1", "7732-18-5"
48
+ report.value "1.1", "7732-18-5"
49
49
  assert_equal report.pretty_json, File.read(File.join(DATA_DIR,'qprf-t6.json'))
50
50
  end
51
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qsar-report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micha Rautenberg