Commit 3af64e62 authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub

Merge pull request #43 from biopet/fix-BIOPET-584

Fixed BIOPET-584
parents 2299e7a9 feb2b09a
......@@ -16,10 +16,12 @@ package nl.lumc.sasc.biopet.extensions
import java.io.File
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Version }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import scala.util.matching.Regex
/**
* Wrapper for the cuffquant command line tool.
* Written based on cuffquant version v2.2.1 (md5: 0765b82b11db9256f5be341a7da884d6)
......@@ -116,11 +118,11 @@ class Cuffquant(val root: Configurable) extends BiopetCommandLineFunction with V
/** Disable SCV correction */
var noScvCorrection: Boolean = config("no_scv_correction", default = false)
def versionRegex = """cuffquant v(.*)""".r
def versionCommand = executable
def versionRegex: Regex = """cuffquant v(.*)""".r
def versionCommand: String = executable
override def versionExitcode = List(0, 1)
def cmdLine =
def cmdLine: String =
required(executable) +
required("--output-dir", outputDir) +
optional("--mask-file", maskFile) +
......
......@@ -154,7 +154,10 @@ object VcfWithVcf extends ToolCommand {
* @param header: header of secondary reader
* @return Map of fields and their values in secondary records
*/
def createFieldMap(fields: List[Fields], record: VariantContext, secondaryRecords: List[VariantContext], header: VCFHeader): Map[String, List[Any]] = {
def createFieldMap(fields: List[Fields],
record: VariantContext,
secondaryRecords: List[VariantContext],
header: VCFHeader): Map[String, List[Any]] = {
val fieldMap = (for (
f <- fields if secondaryRecords.exists(_.hasAttribute(f.inputField))
) yield {
......@@ -236,8 +239,8 @@ object VcfWithVcf extends ToolCommand {
* @return
*/
def numberA(referenceRecord: VariantContext, annotateRecord: VariantContext, field: String): List[Any] = {
val refValues = referenceRecord.getAttributeAsList(field).toArray
annotateRecord.
val refValues = annotateRecord.getAttributeAsList(field).toArray
referenceRecord.
getAlternateAlleles.filter(referenceRecord.hasAlternateAllele).
map(x => referenceRecord.getAlternateAlleles.indexOf(x)).
flatMap(x => refValues.lift(x)).
......@@ -252,8 +255,8 @@ object VcfWithVcf extends ToolCommand {
* @return
*/
def numberR(referenceRecord: VariantContext, annotateRecord: VariantContext, field: String): List[Any] = {
val refValues = referenceRecord.getAttributeAsList(field).toArray
annotateRecord.
val refValues = annotateRecord.getAttributeAsList(field).toArray
referenceRecord.
getAlleles.
filter(referenceRecord.hasAllele).
map(x => referenceRecord.getAlleles.indexOf(x)).
......
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