Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
ebb1fbbc
Commit
ebb1fbbc
authored
Jan 27, 2017
by
Peter van 't Hof
Browse files
Added dual indexes
parent
2d604261
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SummaryToSqlite.scala
View file @
ebb1fbbc
...
...
@@ -51,8 +51,9 @@ object SummaryToSqlite extends ToolCommand {
import
nl.lumc.sasc.biopet.utils.summary.db.Schema._
val
setup
=
DBIO
.
seq
(
(
samples
.
schema
++
libraries
.
schema
)
.
create
(
runs
.
schema
++
samples
.
schema
++
samplesRuns
.
schema
++
libraries
.
schema
++
librariesRuns
.
schema
++
pipelines
.
schema
).
create
)
val
setupFuture
=
db
.
run
(
setup
)
Await
.
result
(
setupFuture
,
Duration
.
Inf
)
...
...
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/summary/db/Schema.scala
View file @
ebb1fbbc
...
...
@@ -17,27 +17,45 @@ object Schema {
}
val
runs
=
TableQuery
[
Runs
]
class
Samples
(
tag
:
Tag
)
extends
Table
[(
Int
,
String
,
Int
,
Blob
)](
tag
,
"Samples"
)
{
class
Samples
(
tag
:
Tag
)
extends
Table
[(
Int
,
String
,
Option
[
Blob
]
)](
tag
,
"Samples"
)
{
def
sampleId
=
column
[
Int
](
"sampleId"
,
O
.
PrimaryKey
)
def
sampleName
=
column
[
String
](
"sampleName"
)
def
runId
=
column
[
Int
](
"runId"
)
def
tags
=
column
[
Blob
](
"tags"
)
def
tags
=
column
[
Option
[
Blob
]](
"tags"
)
def
*
=
(
sampleId
,
sampleName
,
runId
,
tags
)
def
*
=
(
sampleId
,
sampleName
,
tags
)
}
val
samples
=
TableQuery
[
Samples
]
class
SamplesRuns
(
tag
:
Tag
)
extends
Table
[(
Int
,
Int
)](
tag
,
"SamplesRuns"
)
{
def
sampleId
=
column
[
Int
](
"sampleId"
)
def
runId
=
column
[
Int
](
"runId"
)
def
*
=
(
sampleId
,
runId
)
def
idx
=
index
(
"idx_samples_runs"
,
(
sampleId
,
runId
),
unique
=
true
)
}
val
samplesRuns
=
TableQuery
[
SamplesRuns
]
class
Libraries
(
tag
:
Tag
)
extends
Table
[(
Int
,
String
,
Int
,
Blob
)](
tag
,
"Libraries"
)
{
class
Libraries
(
tag
:
Tag
)
extends
Table
[(
Int
,
String
,
Int
,
Option
[
Blob
]
)](
tag
,
"Libraries"
)
{
def
libraryId
=
column
[
Int
](
"libraryId"
,
O
.
PrimaryKey
)
def
libraryName
=
column
[
String
](
"libraryName"
)
def
sampleId
=
column
[
Int
](
"sampleId"
)
def
tags
=
column
[
Blob
](
"tags"
)
def
tags
=
column
[
Option
[
Blob
]
]
(
"tags"
)
def
*
=
(
libraryId
,
libraryName
,
sampleId
,
tags
)
}
val
libraries
=
TableQuery
[
Libraries
]
class
LibrariesRuns
(
tag
:
Tag
)
extends
Table
[(
Int
,
Int
)](
tag
,
"LibrariesRuns"
)
{
def
libraryId
=
column
[
Int
](
"libraryId"
)
def
runId
=
column
[
Int
](
"runId"
)
def
*
=
(
libraryId
,
runId
)
def
idx
=
index
(
"idx_libraries_runs"
,
(
libraryId
,
runId
),
unique
=
true
)
}
val
librariesRuns
=
TableQuery
[
LibrariesRuns
]
class
Pipelines
(
tag
:
Tag
)
extends
Table
[(
Int
,
String
)](
tag
,
"Pipelines"
)
{
def
pipelineId
=
column
[
Int
](
"runId"
,
O
.
PrimaryKey
)
def
pipelineName
=
column
[
String
](
"sampleName"
)
...
...
@@ -45,5 +63,4 @@ object Schema {
def
*
=
(
pipelineId
,
pipelineName
)
}
val
pipelines
=
TableQuery
[
Pipelines
]
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment