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
1d1a6256
Commit
1d1a6256
authored
9 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Added heatmap plot
parent
d411daac
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/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala
+23
-5
23 additions, 5 deletions
.../sasc/biopet/pipelines/gentrap/measures/Measurement.scala
with
23 additions
and
5 deletions
public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala
+
23
−
5
View file @
1d1a6256
package
nl.lumc.sasc.biopet.pipelines.gentrap.measures
import
java.io.File
import
nl.lumc.sasc.biopet.core.Reference
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.extensions.tools.MergeTables
import
nl.lumc.sasc.biopet.pipelines.gentrap.scripts.PlotHeatmap
import
org.broadinstitute.gatk.queue.QScript
/**
...
...
@@ -11,22 +14,32 @@ import org.broadinstitute.gatk.queue.QScript
trait
Measurement
extends
SummaryQScript
with
Reference
{
qscript
:
QScript
=>
protected
var
bamFiles
:
Map
[
String
,
File
]
=
Map
()
/**
* Method to add a bamFile to the pipeline
* @param id Uniqe id used for this bam file, most likly to be a sampleName
* @param file Location of the bam file
*/
def
addBamfile
(
id
:
String
,
file
:
File
)
:
Unit
=
{
require
(!
bamFiles
.
contains
(
id
),
s
"'$id' already exist"
)
bamFiles
+=
id
->
file
}
/** Name of job, this is used as prefix for most of the files */
def
name
:
String
=
this
.
getClass
.
getSimpleName
.
toLowerCase
/** Locations of single bam count tables */
lazy
val
countFiles
:
Map
[
String
,
File
]
=
bamFiles
.
map
{
case
(
id
,
bamFile
)
=>
bamToCountFile
(
id
,
bamFile
)
}
/** Location of merge count table */
def
mergedCountFile
=
new
File
(
outputDir
,
s
"$name.merged.tsv"
)
case
class
MergeArgs
(
idCols
:
List
[
Int
],
valCol
:
Int
,
numHeaderLines
:
Int
=
0
,
fallback
:
String
=
"-"
)
/** Location of heatmap */
def
heatpMap
=
new
File
(
outputDir
,
s
"$name.heatmap.png"
)
/** Class to store args for MergeTables */
case
class
MergeArgs
(
idCols
:
List
[
Int
],
valCol
:
Int
,
numHeaderLines
:
Int
=
0
,
fallback
:
String
=
"-"
)
/** This should contain the args for MergeTables */
def
mergeArgs
:
MergeArgs
/** Init for pipeline */
...
...
@@ -39,9 +52,14 @@ trait Measurement extends SummaryQScript with Reference { qscript: QScript =>
add
(
MergeTables
(
this
,
countFiles
.
values
.
toList
,
mergedCountFile
,
mergeArgs
.
idCols
,
mergeArgs
.
valCol
,
mergeArgs
.
numHeaderLines
,
mergeArgs
.
fallback
))
//TODO: Heatmap
val
job
=
new
PlotHeatmap
(
qscript
)
job
.
input
=
mergedCountFile
job
.
output
=
heatpMap
job
.
countType
=
Some
(
name
)
add
(
job
)
}
/** This function should add the count table for each bamFile */
def
bamToCountFile
(
id
:
String
,
bamFile
:
File
)
:
(
String
,
File
)
/** Must return a map with used settings for this pipeline */
...
...
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