Commit 51d189aa authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Adding placeholder for RNA and Target stats

parent 0c9b920b
#{ //TODO: Need content }#
Todo
\ No newline at end of file
package nl.lumc.sasc.biopet.pipelines.bammetrics package nl.lumc.sasc.biopet.pipelines.bammetrics
import nl.lumc.sasc.biopet.core.report.{ReportBuilder, ReportPage, ReportSection} import nl.lumc.sasc.biopet.core.report.{ ReportBuilder, ReportPage, ReportSection }
/** /**
* Created by pjvan_thof on 3/30/15. * Created by pjvan_thof on 3/30/15.
...@@ -22,8 +22,10 @@ object BammetricsReport extends ReportBuilder { ...@@ -22,8 +22,10 @@ object BammetricsReport extends ReportBuilder {
"Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"), "Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"),
"Bam Stats" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/bamStats.ssp"), "Bam Stats" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/bamStats.ssp"),
"Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp"), "Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp"),
"RNA (optional)" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/rna.ssp"),
"Target (optional)" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/target.ssp"),
"GC Bias" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/gcBias.ssp") "GC Bias" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/gcBias.ssp")
), ),
Map() Map()
) )
......
...@@ -66,7 +66,7 @@ object VcfToTsv extends ToolCommand { ...@@ -66,7 +66,7 @@ object VcfToTsv extends ToolCommand {
opt[String]("list_separator") maxOccurs (1) action { (x, c) => opt[String]("list_separator") maxOccurs (1) action { (x, c) =>
c.copy(listSeparator = x) c.copy(listSeparator = x)
} text ("Optional list separator. By default, lists are separated by a comma") } text ("Optional list separator. By default, lists are separated by a comma")
opt[Int]("max_decimals") maxOccurs(1) action { (x, c) => opt[Int]("max_decimals") maxOccurs (1) action { (x, c) =>
c.copy(maxDecimals = x) c.copy(maxDecimals = x)
} text ("Number of decimal places for numbers. Default is 2") } text ("Number of decimal places for numbers. Default is 2")
} }
...@@ -79,7 +79,7 @@ object VcfToTsv extends ToolCommand { ...@@ -79,7 +79,7 @@ object VcfToTsv extends ToolCommand {
// Throw exception if separator and listSeparator are identical // Throw exception if separator and listSeparator are identical
if (commandArgs.separator == commandArgs.listSeparator) throw new IllegalArgumentException( if (commandArgs.separator == commandArgs.listSeparator) throw new IllegalArgumentException(
"Separator and list_separator should not be identical" "Separator and list_separator should not be identical"
) )
val formatter = createFormatter(commandArgs.maxDecimals) val formatter = createFormatter(commandArgs.maxDecimals)
...@@ -101,7 +101,6 @@ object VcfToTsv extends ToolCommand { ...@@ -101,7 +101,6 @@ object VcfToTsv extends ToolCommand {
buffer.toSet[String] buffer.toSet[String]
} }
val sortedFields = sortFields(fields, samples.toList) val sortedFields = sortFields(fields, samples.toList)
val writer = if (commandArgs.outputFile != null) new PrintStream(commandArgs.outputFile) val writer = if (commandArgs.outputFile != null) new PrintStream(commandArgs.outputFile)
...@@ -137,10 +136,10 @@ object VcfToTsv extends ToolCommand { ...@@ -137,10 +136,10 @@ object VcfToTsv extends ToolCommand {
val l = for (g <- genotype.getAlleles) yield vcfRecord.getAlleleIndex(g) val l = for (g <- genotype.getAlleles) yield vcfRecord.getAlleleIndex(g)
l.map(x => if (x < 0) "." else x).mkString("/") l.map(x => if (x < 0) "." else x).mkString("/")
} }
if (genotype.hasAD) values += sample + "-AD" -> List(genotype.getAD: _*).mkString(commandArgs.listSeparator) if (genotype.hasAD) values += sample + "-AD" -> List(genotype.getAD: _*).mkString(commandArgs.listSeparator)
if (genotype.hasDP) values += sample + "-DP" -> genotype.getDP if (genotype.hasDP) values += sample + "-DP" -> genotype.getDP
if (genotype.hasGQ) values += sample + "-GQ" -> genotype.getGQ if (genotype.hasGQ) values += sample + "-GQ" -> genotype.getGQ
if (genotype.hasPL) values += sample + "-PL" -> List(genotype.getPL: _*).mkString(commandArgs.listSeparator) if (genotype.hasPL) values += sample + "-PL" -> List(genotype.getPL: _*).mkString(commandArgs.listSeparator)
for ((field, content) <- genotype.getExtendedAttributes) { for ((field, content) <- genotype.getExtendedAttributes) {
values += sample + "-" + field -> content values += sample + "-" + field -> content
} }
...@@ -164,7 +163,6 @@ object VcfToTsv extends ToolCommand { ...@@ -164,7 +163,6 @@ object VcfToTsv extends ToolCommand {
new DecimalFormat(patternString) new DecimalFormat(patternString)
} }
/** /**
* This fields sorts fields, such that non-info and non-sample specific fields (e.g. general ones) are on front * This fields sorts fields, such that non-info and non-sample specific fields (e.g. general ones) are on front
* followed by info fields * followed by info fields
...@@ -182,7 +180,7 @@ object VcfToTsv extends ToolCommand { ...@@ -182,7 +180,7 @@ object VcfToTsv extends ToolCommand {
fields.toList.sortWith((a, b) => { fields.toList.sortWith((a, b) => {
(fieldType(a), fieldType(b)) match { (fieldType(a), fieldType(b)) match {
case ('g','g') => { case ('g', 'g') => {
val ai = defaultFields.indexOf(a) val ai = defaultFields.indexOf(a)
val bi = defaultFields.indexOf(b) val bi = defaultFields.indexOf(b)
if (bi < 0) true else ai <= bi if (bi < 0) true else ai <= bi
...@@ -191,16 +189,16 @@ object VcfToTsv extends ToolCommand { ...@@ -191,16 +189,16 @@ object VcfToTsv extends ToolCommand {
val sampleA = a.split("-").head val sampleA = a.split("-").head
val sampleB = b.split("-").head val sampleB = b.split("-").head
sampleA.compareTo(sampleB) match { sampleA.compareTo(sampleB) match {
case 0 => !(a.compareTo(b) > 0) case 0 => !(a.compareTo(b) > 0)
case i if (i > 0) => false case i if (i > 0) => false
case _ => true case _ => true
} }
} }
case ('g', _) => true case ('g', _) => true
case (_, 'g') => false case (_, 'g') => false
case (a, b) if a == b => !(a.compareTo(b) > 0) case (a, b) if a == b => !(a.compareTo(b) > 0)
case ('i', _) => true case ('i', _) => true
case _ => false case _ => false
} }
}) })
} }
......
...@@ -64,7 +64,7 @@ class VcfToTsvTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -64,7 +64,7 @@ class VcfToTsvTest extends TestNGSuite with MockitoSugar with Matchers {
val sorted = sortFields(unsortedFields, samples) val sorted = sortFields(unsortedFields, samples)
sorted should be(List("WeirdField", "INFO-AlleleScoreSomething", "INFO-ScoreSomething", "INFO-Something", sorted should be(List("WeirdField", "INFO-AlleleScoreSomething", "INFO-ScoreSomething", "INFO-Something",
"Child01-GT", "Father03-GT", "Mother02-GT")) "Child01-GT", "Father03-GT", "Mother02-GT"))
} }
} }
...@@ -19,17 +19,17 @@ object FlexiprepReport extends ReportBuilder { ...@@ -19,17 +19,17 @@ object FlexiprepReport extends ReportBuilder {
def flexiprepPage = ReportPage( def flexiprepPage = ReportPage(
Map(), Map(),
List( List(
"Read Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"), "Read Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"Base Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"), "Base Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"),
fastqcPlotSection("Base quality", "plot_per_base_quality"), fastqcPlotSection("Base quality", "plot_per_base_quality"),
fastqcPlotSection("Sequence quality", "plot_per_sequence_quality"), fastqcPlotSection("Sequence quality", "plot_per_sequence_quality"),
fastqcPlotSection("Base GC content", "plot_per_base_gc_content"), fastqcPlotSection("Base GC content", "plot_per_base_gc_content"),
fastqcPlotSection("Sequence GC content", "plot_per_sequence_gc_content"), fastqcPlotSection("Sequence GC content", "plot_per_sequence_gc_content"),
fastqcPlotSection("Base seqeunce content", "plot_per_base_sequence_content"), fastqcPlotSection("Base seqeunce content", "plot_per_base_sequence_content"),
fastqcPlotSection("Duplication", "plot_duplication_levels"), fastqcPlotSection("Duplication", "plot_duplication_levels"),
fastqcPlotSection("Kmers", "plot_kmer_profiles"), fastqcPlotSection("Kmers", "plot_kmer_profiles"),
fastqcPlotSection("Length distribution", "plot_sequence_length_distribution") fastqcPlotSection("Length distribution", "plot_sequence_length_distribution")
), ),
Map() Map()
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment