Skip to content

Commit

Permalink
Autogenerated literator docs for v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eparejatobes committed Nov 9, 2016
1 parent bdedae1 commit fca1663
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
16 changes: 15 additions & 1 deletion docs/src/main/scala/go.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,23 @@ trait AnyTerm extends Any {
def ID: String
def name: String
def definition: String
def namespace: String // TODO finite known set of namespaces
def namespace: Namespace
def comments: Seq[String]
}
```


See:

- http://geneontology.org/page/ontology-structure#oneorthree
- http://geneontology.org/page/ontology-structure#essential


```scala
sealed trait Namespace
case object cellular_component extends Namespace
case object molecular_function extends Namespace
case object biological_process extends Namespace

sealed trait AnyRel {

Expand Down
19 changes: 16 additions & 3 deletions docs/src/main/scala/oboxml/parser.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import scala.compat.java8.OptionConverters._
case class GOOBOXML(xml: Elem) extends AnyVal with AnyGO {

def terms: Seq[XmlTerm] =
(xml \ "term").filter( term => (term \ "isObsolete").isEmpty ) map XmlTerm
(xml \ "term").filter( term => (term \ "isObsolete").isEmpty ) map { XmlTerm(_) }

def isA: Seq[IsA] =
terms flatMap { _.isA }
Expand Down Expand Up @@ -38,8 +38,8 @@ case class XmlTerm(val xml: Node) extends AnyVal with AnyTerm {
def comments: Seq[String] =
(xml \ "comment") map { _.text }

def namespace: String =
(xml \ "namespace").head.text
def namespace: Namespace =
XmlTerm namespaceFrom (xml \ "namespace").head.text

def definition: String =
(xml \ "def" \ "defstr").head.text
Expand Down Expand Up @@ -72,6 +72,19 @@ case class XmlTerm(val xml: Node) extends AnyVal with AnyTerm {
.map( relFromRelationship )
}

case object XmlTerm {

def namespaceFrom(rep: String): Namespace = {
println { rep };
rep match {
case "cellular_component" => cellular_component
case "molecular_function" => molecular_function
case "biological_process" => biological_process
}
}

}

case class Rel(sourceID: String, targetID: String)

```
Expand Down

0 comments on commit fca1663

Please sign in to comment.