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 Oct 29, 2016
1 parent 3a8a452 commit 77a9bb4
Show file tree
Hide file tree
Showing 36 changed files with 397 additions and 285 deletions.
294 changes: 151 additions & 143 deletions docs/src/main/scala/entry.scala.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/src/main/scala/flat/AC.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ case class AC(val lines: Seq[String]) extends AnyVal {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
65 changes: 33 additions & 32 deletions docs/src/main/scala/flat/CC.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,46 @@ case class CC(val lines: Seq[String]) {

topic match {

case "ALLERGEN" => Vector( Allergen(contents.mkString(" ")) )
case "ALLERGEN" => List( Allergen(contents.mkString(" ")) )
case "ALTERNATIVE PRODUCTS" => isoformBlocks(contents.tail) map isoformFromBlock
case "BIOPHYSICOCHEMICAL PROPERTIES" => Vector( BiophysicochemicalProperties(contents.mkString(" ")) )
case "BIOTECHNOLOGY" => Vector( Biotechnology(contents.mkString(" ")) )
case "CATALYTIC ACTIVITY" => Vector( CatalyticActivity(contents.mkString(" ")) )
case "CAUTION" => Vector( Caution(contents.mkString(" ")) )
case "COFACTOR" => Vector( Cofactor(contents.mkString(" ")) )
case "DEVELOPMENTAL STAGE" => Vector( DevelopmentalStage(contents.mkString(" ")) )
case "DISEASE" => Vector( Disease(contents.mkString(" ")) )
case "DISRUPTION PHENOTYPE" => Vector( DisruptionPhenotype(contents.mkString(" ")) )
case "DOMAIN" => Vector( Domain(contents.mkString(" ")) )
case "ENZYME REGULATION" => Vector( EnzymeRegulation(contents.mkString(" ")) )
case "FUNCTION" => Vector( Function(contents.mkString(" ")) )
case "INDUCTION" => Vector( Induction(contents.mkString(" ")) )
case "INTERACTION" => Vector( Interaction(contents.mkString(" ")) )
case "MASS SPECTROMETRY" => Vector( MassSpectrometry(contents.mkString(" ")) )
case "MISCELLANEOUS" => Vector( Miscellaneous(contents.mkString(" ")) )
case "PATHWAY" => Vector( Pathway(contents.mkString(" ")) )
case "PHARMACEUTICAL" => Vector( Pharmaceutical(contents.mkString(" ")) )
case "POLYMORPHISM" => Vector( Polymorphism(contents.mkString(" ")) )
case "PTM" => Vector( PTM(contents.mkString(" ")) )
case "RNA EDITING" => Vector( RNAEditing(contents.mkString(" ")) )
case "SEQUENCE CAUTION" => Vector( SequenceCaution(contents.mkString(" ")) )
case "SIMILARITY" => Vector( Similarity(contents.mkString(" ")) )
case "SUBCELLULAR LOCATION" => Vector( SubcellularLocation(contents.mkString(" ")) )
case "SUBUNIT" => Vector( Subunit(contents.mkString(" ")) )
case "TISSUE SPECIFICITY" => Vector( TissueSpecificity(contents.mkString(" ")) )
case "TOXIC DOSE" => Vector( ToxicDose(contents.mkString(" ")) )
case "WEB RESOURCE" => Vector( WebResource(contents.mkString(" ")) )
case "BIOPHYSICOCHEMICAL PROPERTIES" => List( BiophysicochemicalProperties(contents.mkString(" ")) )
case "BIOTECHNOLOGY" => List( Biotechnology(contents.mkString(" ")) )
case "CATALYTIC ACTIVITY" => List( CatalyticActivity(contents.mkString(" ")) )
case "CAUTION" => List( Caution(contents.mkString(" ")) )
case "COFACTOR" => List( Cofactor(contents.mkString(" ")) )
case "DEVELOPMENTAL STAGE" => List( DevelopmentalStage(contents.mkString(" ")) )
case "DISEASE" => List( Disease(contents.mkString(" ")) )
case "DISRUPTION PHENOTYPE" => List( DisruptionPhenotype(contents.mkString(" ")) )
case "DOMAIN" => List( Domain(contents.mkString(" ")) )
case "ENZYME REGULATION" => List( EnzymeRegulation(contents.mkString(" ")) )
case "FUNCTION" => List( Function(contents.mkString(" ")) )
case "INDUCTION" => List( Induction(contents.mkString(" ")) )
case "INTERACTION" => List( Interaction(contents.mkString(" ")) )
case "MASS SPECTROMETRY" => List( MassSpectrometry(contents.mkString(" ")) )
case "MISCELLANEOUS" => List( Miscellaneous(contents.mkString(" ")) )
case "PATHWAY" => List( Pathway(contents.mkString(" ")) )
case "PHARMACEUTICAL" => List( Pharmaceutical(contents.mkString(" ")) )
case "POLYMORPHISM" => List( Polymorphism(contents.mkString(" ")) )
case "PTM" => List( PTM(contents.mkString(" ")) )
case "RNA EDITING" => List( RNAEditing(contents.mkString(" ")) )
case "SEQUENCE CAUTION" => List( SequenceCaution(contents.mkString(" ")) )
case "SIMILARITY" => List( Similarity(contents.mkString(" ")) )
case "SUBCELLULAR LOCATION" => List( SubcellularLocation(contents.mkString(" ")) )
case "SUBUNIT" => List( Subunit(contents.mkString(" ")) )
case "TISSUE SPECIFICITY" => List( TissueSpecificity(contents.mkString(" ")) )
case "TOXIC DOSE" => List( ToxicDose(contents.mkString(" ")) )
case "WEB RESOURCE" => List( WebResource(contents.mkString(" ")) )
}
}

private def commentBlocks(commentLines: Seq[String]): Seq[Seq[String]] =
commentLines.foldLeft[Seq[Seq[String]]](Vector()){ (acc: Seq[Seq[String]], line: String) =>
commentLines.foldLeft[collection.mutable.Buffer[Seq[String]]](new collection.mutable.UnrolledBuffer[Seq[String]]){ (acc: collection.mutable.Buffer[Seq[String]], line: String) =>
// extra lines for a comment
if(line startsWith " ") {
acc.updated(acc.length - 1, acc.last :+ line.trim)
}
else {
acc :+ Vector(line.stripPrefix("-!-").trim)
acc += List(line.stripPrefix("-!-").trim)
}
}
```
Expand Down Expand Up @@ -87,12 +87,12 @@ The input here has lines **already trimmed**.
private def isoformBlocks(altProdLines: Seq[String]): Seq[Seq[String]] =
altProdLines
.dropWhile(altProdLine => !altProdLine.startsWith("Name="))
.foldLeft(Seq[Seq[String]]()){ (acc: Seq[Seq[String]], line: String) =>
.foldLeft(new collection.mutable.UnrolledBuffer[Seq[String]]()){ (acc: collection.mutable.UnrolledBuffer[Seq[String]], line: String) =>
// same iso
if(!(line startsWith "Name="))
acc.updated(acc.length - 1, acc.last :+ line.trim)
else
acc :+ Vector(line.trim)
acc += List(line.trim)
}
```

Expand Down Expand Up @@ -123,6 +123,7 @@ IsoId=Q15746-3; Sequence=VSP_004792, VSP_004794;



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/scala/flat/DE.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ case object DE {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
15 changes: 8 additions & 7 deletions docs/src/main/scala/flat/DR.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ Bgee; ENSMUSG00000032315; -.
```scala
case class DR(val lines: Seq[String]) extends AnyVal {

@inline
def databaseCrossReferences: Seq[DatabaseCrossReference] =
lines map { line =>

val fragments = line.splitSegments(_==';')
val resourceAbbrv = fragments(0).trim
val id = fragments(1).trim
val (firstFrag, rest1) = line.span(_!=';')
val (secondFrag, rest2) = rest1.stripPrefix(";").span(_!=';')

DatabaseCrossReference(
resource = ResourceAbbreviation.fromString(resourceAbbrv),
identifier = id,
resource = ResourceAbbreviation.fromString(firstFrag.trim),
identifier = secondFrag.trim
// TODO other info?
otherInformation = None,
isoformID = None
// otherInformation = None,
// isoformID = None
)
}
}
Expand All @@ -42,6 +42,7 @@ case class DR(val lines: Seq[String]) extends AnyVal {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/scala/flat/DT.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ case class DT(val value: Seq[String]) {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
52 changes: 29 additions & 23 deletions docs/src/main/scala/flat/Entry.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import java.time.LocalDate
case class Entry(
val allLines: Seq[String]
)
extends AnyEntry {
extends AnyVal with AnyEntry {

private lazy val id: ID =
final def id: ID =
ID(linesOfType(LineType.ID).head)

@inline
final def identification: Identification =
id.identification

private lazy val ac: AC =
final def ac: AC =
AC(linesOfType(LineType.AC))

@inline
Expand All @@ -33,21 +33,21 @@ extends AnyEntry {
)
}

private lazy val dt: DT =
final def dt: DT =
DT(linesOfType(LineType.DT))

@inline
final def date: Date =
dt.date

private lazy val de: DE =
final def de: DE =
DE(linesOfType(LineType.DE))

@inline
final def description: Description =
de.description

private lazy val gn: GN =
final def gn: GN =
GN(linesOfType(LineType.GN))

@inline
Expand All @@ -58,87 +58,92 @@ extends AnyEntry {
final def organismSpecies: OrganismSpecies =
???

private lazy val og: OG =
OG(linesOfType(LineType.GN))
final def og: OG =
OG(linesOfType(LineType.OG))

lazy val organelles: Seq[Organelle] =
@inline
final def organelles: Seq[Organelle] =
og.organelles

@inline
final def organismClassification: OrganismClassification =
???

private lazy val ox: OX =
final def ox: OX =
OX(linesOfType(LineType.OX).head)

@inline
final def taxonomyCrossReference: TaxonomyCrossReference =
ox.taxonomyCrossReference

private lazy val oh: OH =
final def oh: OH =
OH(linesOfType(LineType.OH))

@inline
final def organismHost: Seq[TaxonomyCrossReference] =
oh.taxonomyCrossReferences

private lazy val cc: CC =
final def cc: CC =
CC(linesOfType(LineType.CC))

@inline
final def comments: Seq[Comment] =
cc.comments

private lazy val dr: DR =
DR(linesOfType(LineType.DR))
final def dr: DR =
DR(linesOfType(LineType.DR).toList)

@inline
final def databaseCrossReferences: Seq[DatabaseCrossReference] =
dr.databaseCrossReferences

private lazy val pe: PE =
final def pe: PE =
PE(linesOfType(LineType.PE).head)

@inline
final def proteinExistence: ProteinExistence =
pe.proteinExistence

private lazy val kw: KW =
final def kw: KW =
KW(linesOfType(LineType.KW))

@inline
final def keywords: Seq[Keyword] =
kw.keywords

private lazy val ft: FT =
final def ft: FT =
FT(linesOfType(LineType.FT))

@inline
final def features: Seq[Feature] =
ft.features

private lazy val sq: SQ =
final def sq: SQ =
SQ(linesOfType(LineType.SQ).head)

@inline
final def sequenceHeader: SequenceHeader =
sq.sequenceHeader

private lazy val sd: SequenceData =
final def sd: SequenceData =
SequenceData(linesOfType(LineType.` `))

@inline
final def sequence: Sequence =
sd.sequence



private def linesOfType(lt: LineType) =
(allLines filter Line.isOfType(lt)).map(Line.contentOf)
@inline
final def linesOfType(lt: LineType) =
allLines
.dropWhile(l => !(l startsWith lt.asString))
.takeWhile(_ startsWith lt.asString)
.map(_ drop 5)
// allLines collect { case l if(l startsWith lt.toString) => l drop 5 }
}

case object Entry {

@inline
def from(lns: Seq[String]): Entry =
Entry(lns)
}
Expand All @@ -148,6 +153,7 @@ case object Entry {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/scala/flat/FT.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ case class FT(val lines: Seq[String]) extends AnyVal {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/scala/flat/GN.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ case object GN {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/scala/flat/ID.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ case class ID(val value: String) extends AnyVal {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/scala/flat/KW.scala.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ case class KW(val lines: Seq[String]) extends AnyVal {



[test/scala/LineParsingSpeed.scala]: ../../../test/scala/LineParsingSpeed.scala.md
[test/scala/lines.scala]: ../../../test/scala/lines.scala.md
[test/scala/testData.scala]: ../../../test/scala/testData.scala.md
[test/scala/FlatFileEntry.scala]: ../../../test/scala/FlatFileEntry.scala.md
Expand Down
Loading

0 comments on commit 77a9bb4

Please sign in to comment.