Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
c7cd5499
Commit
c7cd5499
authored
10 years ago
by
bow
Browse files
Options
Downloads
Patches
Plain Diff
Trim down general test to test for expMeasure and strandProtocol combinations
parent
76ef30d0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/gentrap/src/test/scala/nl/lumc/sasc/biopet/pipelines/gentrap/GentrapTest.scala
+45
-39
45 additions, 39 deletions
...a/nl/lumc/sasc/biopet/pipelines/gentrap/GentrapTest.scala
with
45 additions
and
39 deletions
public/gentrap/src/test/scala/nl/lumc/sasc/biopet/pipelines/gentrap/GentrapTest.scala
+
45
−
39
View file @
c7cd5499
...
...
@@ -15,9 +15,6 @@ import org.testng.annotations.{ AfterClass, DataProvider, Test }
import
nl.lumc.sasc.biopet.core.config.Config
import
nl.lumc.sasc.biopet.extensions._
import
nl.lumc.sasc.biopet.pipelines.gentrap.extensions._
import
nl.lumc.sasc.biopet.pipelines.gentrap.scripts._
import
nl.lumc.sasc.biopet.tools.
{
MergeTables
,
WipeReads
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils
class
GentrapTest
extends
TestNGSuite
with
Matchers
{
...
...
@@ -25,66 +22,75 @@ class GentrapTest extends TestNGSuite with Matchers {
def
initPipeline
(
map
:
Map
[
String
,
Any
])
:
Gentrap
=
{
new
Gentrap
()
{
override
def
configName
=
"gentrap"
override
def
globalConfig
=
new
Config
(
map
)
qSettings
=
new
QSettings
qSettings
.
runName
=
"test"
}
}
/** Convenience method for making library config */
private
def
makeLibConfig
(
idx
:
Int
,
paired
:
Boolean
=
true
)
=
{
val
files
=
Map
(
"R1"
->
"test_R1.fq"
)
if
(
paired
)
(
s
"lib_$idx"
,
files
++
Map
(
"R2"
->
"test_R2.fq"
))
else
(
s
"lib_$idx"
,
files
)
}
/** Convenience method for making sample config */
private
def
makeSampleConfig
(
sampleIdx
:
Int
,
numLibs
:
Int
,
paired
:
String
)
=
Map
(
"samples"
->
Map
(
s
"sample_$sampleIdx"
->
Map
(
"libraries"
->
(
0
to
numLibs
)
// if paired == "mixed", alternate paired/not paired between each number
.
map
(
n
=>
makeLibConfig
(
n
,
if
(
paired
==
"mixed"
)
n
%
2
==
0
else
paired
==
"paired"
))
.
toMap
)
)
)
private
val
pairedOneSampleOneLib
=
makeSampleConfig
(
1
,
1
,
"paired"
)
private
val
pairedOneSampleTwoLib
=
makeSampleConfig
(
1
,
2
,
"paired"
)
private
val
pairedOneSampleThreeLib
=
makeSampleConfig
(
1
,
3
,
"paired"
)
private
lazy
val
validExpressionMeasures
=
Set
(
"fragments_per_gene"
,
"fragments_per_exon"
,
"bases_per_gene"
,
"bases_per_exon"
,
"cufflinks_strict"
,
"cufflinks_guided"
,
"cufflinks_blind"
)
@DataProvider
(
name
=
"
gentrapOptions
"
)
@DataProvider
(
name
=
"
expMeasures_strandProtocol
"
)
def
flexiprepOptions
=
{
val
pairTypes
=
Array
(
true
,
false
)
val
aligners
=
Array
(
"gsnap"
)
val
strandProtocols
=
Array
(
"non_specific"
,
"dutp"
)
val
callVariants
=
Array
(
true
,
false
)
// get all possible combinations of expression measures
val
expressionMeasures
=
validExpressionMeasures
.
subsets
.
map
(
_
.
toList
)
.
toArray
for
(
pair
<-
pairTypes
;
aligner
<-
aligners
;
expressionMeasure
<-
expressionMeasures
;
strandProtocol
<-
strandProtocols
;
callVariant
<-
callVariants
)
yield
Array
(
""
,
pair
,
aligner
,
expressionMeasure
,
strandProtocol
,
callVariant
)
for
{
expressionMeasure
<-
expressionMeasures
strandProtocol
<-
strandProtocols
}
yield
Array
(
expressionMeasure
,
strandProtocol
)
}
@Test
(
dataProvider
=
"gentrapOptions"
)
def
testGentrap
(
name
:
String
,
paired
:
Boolean
,
aligner
:
String
,
expMeasures
:
List
[
String
],
strandProtocol
:
String
,
callVariant
:
Boolean
)
=
{
val
map
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
GentrapTest
.
outputDir
,
"gsnap"
->
Map
(
"db"
->
"test"
,
"dir"
->
"test"
),
"aligner"
->
"gsnap"
,
"expression_measures"
->
expMeasures
,
"strand_protocol"
->
strandProtocol
,
"call_variants"
->
callVariant
,
"samples"
->
Map
(
"sample_1"
->
Map
(
"libraries"
->
Map
(
"lib_1"
->
Map
(
"R1"
->
"test_R1.fq"
)
)
)
)
),
Map
(
GentrapTest
.
executables
.
toSeq
:
_
*
))
val
gentrap
:
Gentrap
=
initPipeline
(
map
)
@Test
(
dataProvider
=
"expMeasures_strandProtocol"
)
def
testGentrap
(
expMeasures
:
List
[
String
],
strandProtocol
:
String
)
=
{
val
settings
=
Map
(
"output_dir"
->
GentrapTest
.
outputDir
,
"gsnap"
->
Map
(
"db"
->
"test"
,
"dir"
->
"test"
),
"aligner"
->
"gsnap"
,
"expression_measures"
->
expMeasures
,
"strand_protocol"
->
strandProtocol
)
val
config
=
ConfigUtils
.
mergeMaps
(
settings
++
pairedOneSampleOneLib
,
Map
(
GentrapTest
.
executables
.
toSeq
:
_
*
))
val
gentrap
:
Gentrap
=
initPipeline
(
config
)
gentrap
.
script
()
val
functions
=
gentrap
.
functions
.
groupBy
(
_
.
getClass
)
gentrap
.
functions
.
count
(
_
.
isInstance
Of
[
Gsnap
])
should
Be
1
functions
(
class
Of
[
Gsnap
])
.
size
should
be
>=
1
}
// remove temporary run directory all tests in the class have been run
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment