Commit 0b31238b authored by Sander Bollen's avatar Sander Bollen
Browse files

add wait flag to manwe extensions

parent 3e9b759b
......@@ -16,13 +16,16 @@ class ManweAnnotateBed(val root: Configurable) extends Manwe {
@Argument(doc = "flag if data has already been uploaded")
var alreadyUploaded: Boolean = false
@Argument(doc = "Flag whether to wait for annotation to complete on the server")
var waitToComplete: Boolean = false
@Argument(doc = "annotation queries")
var queries: List[String] = Nil
def subCommand = {
required("annotate-bed") + required(bed) +
conditional(alreadyUploaded, "-u") +
repeat("-q", queries)
repeat("-q", queries) + conditional(waitToComplete, "--wait")
}
}
......@@ -16,13 +16,16 @@ class ManweAnnotateVcf(val root: Configurable) extends Manwe {
@Argument(doc = "flag if data has already been uploaded")
var alreadyUploaded: Boolean = false
@Argument(doc = "flag whether to wait for annotation to complete")
var waitToComplete: Boolean = false
@Argument(doc = "annotation queries")
var queries: List[String] = Nil
def subCommand = {
required("annotate-vcf") + required(vcf) +
conditional(alreadyUploaded, "-u") +
repeat("-q", queries)
repeat("-q", queries) + conditional(waitToComplete, "--wait")
}
}
......@@ -14,9 +14,13 @@ class ManweDataSourcesAnnotate(val root: Configurable) extends Manwe {
@Argument(doc = "list of queries")
var queries: List[String] = Nil
@Argument(doc = "Flag whether to wait for annotation to complete on server")
var waitToComplete: Boolean = false
def subCommand = {
required("data-sources") + required("annotate") +
required(uri) + repeat("-q", queries)
required(uri) + repeat("-q", queries) +
conditional(waitToComplete, "--wait")
}
}
......@@ -41,12 +41,16 @@ class ManweSamplesImport(val root: Configurable) extends Manwe {
@Argument(doc = "Pool size")
var poolSize: Option[Int] = _
@Argument(doc = " Flag whether to wait for import to complete on server")
var waitToComplete: Boolean = false
def subCommand = {
required("samples") + required("import") + required(name) +
repeat("-g", group) + repeat("--vcf", vcfs) + repeat("--bed", beds) +
optional("-s", poolSize) + conditional(alreadyUploaded, "-u") +
conditional(public, "-p") + conditional(preferLikelihood, "-l") +
conditional(noCoverage, "--no-coverage-profile")
conditional(noCoverage, "--no-coverage-profile") +
conditional(waitToComplete, "--wait")
}
}
......@@ -23,10 +23,13 @@ class ManweSamplesImportBed(val root: Configurable) extends Manwe {
@Argument(doc = "flag if data is already uploaded?") // TODO: What is the use of this flag even? We're specifically uploading with this command
var alreadyUploaded: Boolean = false
@Argument(doc = " Flag whether to wait for import to complete on server")
var waitToComplete: Boolean = false
def subCommand = {
required("samples") + required("import-bed") +
required(uri) + required(bed) +
conditional(alreadyUploaded, "-u")
conditional(alreadyUploaded, "-u") + conditional(waitToComplete, "--wait")
}
}
......@@ -26,10 +26,14 @@ class ManweSamplesImportVcf(val root: Configurable) extends Manwe {
@Argument(doc = "Flag when to prefer genotype likelihoods")
var preferLikelihoods: Boolean = false
@Argument(doc = " Flag whether to wait for import to complete on server")
var waitToComplete: Boolean = false
def subCommand = {
required("samples") + required("import-vcf") +
required(uri) + required(vcf) +
conditional(alreadyUploaded, "-u") + conditional(preferLikelihoods, "-l")
conditional(alreadyUploaded, "-u") + conditional(preferLikelihoods, "-l") +
conditional(waitToComplete, "--wait")
}
}
......@@ -32,6 +32,9 @@ class ManweTest extends TestNGSuite with Matchers {
manwe.alreadyUploaded = true
manwe.cmd should equal(s"manwe annotate-bed ${bed.getAbsolutePath} -u -q /uri/1&&/uri/2 -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
manwe.waitToComplete = true
manwe.cmd should equal(s"manwe annotate-bed ${bed.getAbsolutePath} -u -q /uri/1&&/uri/2 --wait -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
@Test
......@@ -53,6 +56,9 @@ class ManweTest extends TestNGSuite with Matchers {
manwe.alreadyUploaded = true
manwe.cmd should equal(s"manwe annotate-vcf ${vcf.getAbsolutePath} -u -q /uri/1&&/uri/2 -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
manwe.waitToComplete = true
manwe.cmd should equal(s"manwe annotate-vcf ${vcf.getAbsolutePath} -u -q /uri/1&&/uri/2 --wait -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
@Test
......@@ -68,6 +74,9 @@ class ManweTest extends TestNGSuite with Matchers {
manwe.uri = Some("/uri/1")
manwe.queries = List("/uri/1&&/uri/2")
manwe.cmd should equal(s"manwe data-sources annotate /uri/1 -q /uri/1&&/uri/2 -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
manwe.waitToComplete = true
manwe.cmd should equal(s"manwe data-sources annotate /uri/1 -q /uri/1&&/uri/2 --wait -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
@Test
......@@ -204,6 +213,9 @@ class ManweTest extends TestNGSuite with Matchers {
manwe.noCoverage = true
manwe.cmd should equal(s"manwe samples import pietje -g /uri/1&&/uri/2 -g /uri/3 $vcfLine $bedLine -s 4 -u -p -l --no-coverage-profile -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
manwe.waitToComplete = true
manwe.cmd should equal(s"manwe samples import pietje -g /uri/1&&/uri/2 -g /uri/3 $vcfLine $bedLine -s 4 -u -p -l --no-coverage-profile --wait -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
@Test
......@@ -227,6 +239,9 @@ class ManweTest extends TestNGSuite with Matchers {
manwe.alreadyUploaded = true
manwe.cmd should equal(s"manwe samples import-bed /uri/1 ${bed.getAbsolutePath} -u -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
manwe.waitToComplete = true
manwe.cmd should equal(s"manwe samples import-bed /uri/1 ${bed.getAbsolutePath} -u --wait -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
@Test
......@@ -252,6 +267,9 @@ class ManweTest extends TestNGSuite with Matchers {
manwe.preferLikelihoods = true
manwe.cmd should equal(s"manwe samples import-vcf /uri/1 ${vcf.getAbsolutePath} -u -l -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
manwe.waitToComplete = true
manwe.cmd should equal(s"manwe samples import-vcf /uri/1 ${vcf.getAbsolutePath} -u -l --wait -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
@Test
......
Supports Markdown
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