biointerchange 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.travis.yml +3 -3
  2. data/Gemfile +2 -1
  3. data/README.md +192 -7
  4. data/Rakefile +1 -1
  5. data/VERSION +1 -1
  6. data/examples/vocabulary.rb +23 -0
  7. data/generators/javaify.rb +131 -0
  8. data/generators/pythonify.rb +67 -0
  9. data/generators/rdfxml.rb +152 -44
  10. data/lib/biointerchange/core.rb +2 -1
  11. data/lib/biointerchange/exceptions.rb +27 -0
  12. data/lib/biointerchange/genomics/gff3_rdf_ntriples.rb +21 -18
  13. data/lib/biointerchange/gff3o.rb +495 -0
  14. data/lib/biointerchange/gvf1o.rb +730 -0
  15. data/lib/biointerchange/registry.rb +2 -2
  16. data/lib/biointerchange/sio.rb +10951 -5845
  17. data/lib/biointerchange/sofa.rb +2171 -1300
  18. data/spec/exceptions_spec.rb +6 -0
  19. data/spec/gff3_rdfwriter_spec.rb +7 -1
  20. data/spec/text_mining_pdfx_xml_reader_spec.rb +6 -0
  21. data/spec/text_mining_pubannos_json_reader_spec.rb +6 -0
  22. data/spec/text_mining_rdfwriter_spec.rb +6 -0
  23. data/supplemental/java/biointerchange/pom.xml +45 -0
  24. data/supplemental/java/biointerchange/src/main/java/org/biointerchange/App.java +58 -0
  25. data/supplemental/java/biointerchange/src/main/java/org/biointerchange/AppSIO.java +49 -0
  26. data/supplemental/java/biointerchange/src/main/java/org/biointerchange/vocabulary/GFF3O.java +647 -0
  27. data/supplemental/java/biointerchange/src/main/java/org/biointerchange/vocabulary/GVF1O.java +946 -0
  28. data/supplemental/java/biointerchange/src/main/java/org/biointerchange/vocabulary/SIO.java +15390 -0
  29. data/supplemental/java/biointerchange/src/main/java/org/biointerchange/vocabulary/SOFA.java +2968 -0
  30. data/supplemental/java/biointerchange/src/test/java/org/biointerchange/AppTest.java +38 -0
  31. data/supplemental/python/biointerchange/__init__.py +4 -0
  32. data/supplemental/python/biointerchange/gff3o.py +581 -0
  33. data/supplemental/python/biointerchange/gvf1o.py +864 -0
  34. data/supplemental/python/biointerchange/sio.py +11772 -0
  35. data/supplemental/python/biointerchange/sofa.py +2422 -0
  36. data/supplemental/python/example.py +19 -0
  37. data/supplemental/python/setup.py +13 -0
  38. data/web/about.html +3 -0
  39. data/web/api.html +219 -0
  40. data/web/index.html +4 -3
  41. data/web/ontologies.html +109 -0
  42. data/web/webservices.html +1 -0
  43. metadata +144 -117
  44. data/docs/exceptions_readme.txt +0 -13
  45. data/lib/biointerchange/gff3.rb +0 -135
@@ -1,13 +0,0 @@
1
- BioInterchange Exception and Error handling.
2
-
3
- All BioInterchange errors come under two main categories:
4
- 1. InputFormatError
5
- 2. ImplementationError
6
-
7
- Each of these classes is handled differently within the BioInterchange framework.
8
-
9
- InputFormatErrors are those that could be raised at any time (during runtime), and that the user could then be exposed to. Examples include errors relating to missing files, or incorrect file formats. These Errors are rescued at the highest level in our program, and adjusted such that a user friendly error message is displayed without a stacktrace (backtrace). This helps to keep our system more user-friendly. However, this means that we strongly advise that when such an error is raised, that it comes with a user friendly error message, and is as specific as possible.
10
-
11
- ImplementationErrors are those that could only be thrown during program implementation and extension. For example, a method is passed something it isn't expecting or can't handle (e.g., a writer is passed an invalid model). These errors are not caught by the main program, instead left to execute in the normal fashion including stacktrace to enable program debugging by a developer.
12
-
13
- ImplementationErrors have three sub-categories. They are split into errors being raised from either the Reader (ImplementationReaderError), the Model (ImplementationModelError), or the Writer (ImplementationWriterError). Please use the ImplementationError sub-class consistent with where the error is being raised. This helps provide an easy way to see which stage in program execution an error has occurred.
@@ -1,135 +0,0 @@
1
- module BioInterchange
2
-
3
- class GFF3
4
-
5
- def self.strand
6
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0010')
7
- end
8
-
9
- def self.attributes
10
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0012')
11
- end
12
-
13
- def self.parent
14
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0014')
15
- end
16
-
17
- def self.contains
18
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0015')
19
- end
20
-
21
- def self.seqid
22
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0004')
23
- end
24
-
25
- def self.source
26
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0005')
27
- end
28
-
29
- def self.type
30
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0006')
31
- end
32
-
33
- def self.start
34
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0007')
35
- end
36
-
37
- def self.end
38
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0008')
39
- end
40
-
41
- def self.score
42
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0009')
43
- end
44
-
45
- def self.phase
46
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0011')
47
- end
48
-
49
- def self.tag
50
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0013')
51
- end
52
-
53
- def self.Set
54
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0001')
55
- end
56
-
57
- def self.Feature
58
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0002')
59
- end
60
-
61
- def self.Attribute
62
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0003')
63
- end
64
-
65
- def self.Strand
66
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0016')
67
- end
68
-
69
- def self.Positive
70
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0017')
71
- end
72
-
73
- def self.Negative
74
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0018')
75
- end
76
-
77
- def self.UnknownStrand
78
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0019')
79
- end
80
-
81
- def self.NotStranded
82
- RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0020')
83
- end
84
-
85
- # Determines whether the given URI is an object property.
86
- #
87
- # +uri+:: URI that is tested for being an object property
88
- def self.is_object_property?(uri)
89
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0010')
90
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0012')
91
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0014')
92
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0015')
93
- false
94
- end
95
-
96
- # Determines whether the given URI is a datatype property.
97
- #
98
- # +uri+:: URI that is tested for being a datatype property
99
- def self.is_datatype_property?(uri)
100
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0004')
101
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0005')
102
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0006')
103
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0007')
104
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0008')
105
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0009')
106
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0011')
107
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0013')
108
- false
109
- end
110
-
111
- # Determines whether the given URI is a class.
112
- #
113
- # +uri+:: URI that is tested for being a class
114
- def self.is_class?(uri)
115
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0001')
116
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0002')
117
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0003')
118
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0016')
119
- false
120
- end
121
-
122
- # Determines whether the given URI is a named individual.
123
- #
124
- # +uri+:: URI that is tested for being a named individual
125
- def self.is_named_individual?(uri)
126
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0017')
127
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0018')
128
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0019')
129
- return true if uri == RDF::URI.new('http://www.sequenceontology.org/gff3#GFF3_0020')
130
- false
131
- end
132
-
133
- end
134
-
135
- end