本文整理了Java中org.opencb.opencga.core.results.VariantQueryResult.getSource()
方法的一些代码示例,展示了VariantQueryResult.getSource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VariantQueryResult.getSource()
方法的具体详情如下:
包路径:org.opencb.opencga.core.results.VariantQueryResult
类名称:VariantQueryResult
方法名:getSource
暂无
代码示例来源:origin: opencb/opencga
@Test
public void testSummary() {
queryResult = query(new Query(), new QueryOptions(VariantField.SUMMARY, true).append(QueryOptions.LIMIT, 1000));
System.out.println("queryResult = " + ((VariantQueryResult) queryResult).getSource());
assertEquals(allVariants.getResult().size(), queryResult.getResult().size());
for (Variant variant : queryResult.getResult()) {
assertThat(variant.getStudies().get(0).getSamplesData(), is(Collections.emptyList()));
assertThat(variant.getStudies().get(0).getFiles(), is(Collections.emptyList()));
}
}
代码示例来源:origin: opencb/opencga
@SuppressWarnings("unchecked")
public
throws CatalogException, IOException, StorageEngineException {
VariantQueryResult
List
if (clazz == Variant.class) {
return (VariantQueryResult
} else if (clazz == org.ga4gh.models.Variant.class) {
Ga4ghVariantConverter
variants = (List
} else if (clazz == ga4gh.Variants.Variant.class) {
Ga4ghVariantConverter
variants = (List
} else {
throw new IllegalArgumentException("Unknown variant format " + clazz);
}
return new VariantQueryResult<>(
result.getId(),
result.getDbTime(),
result.getNumResults(),
result.getNumTotalResults(),
result.getWarningMsg(),
result.getErrorMsg(),
variants,
result.getSamples(),
result.getSource(),
result.getApproximateCount(),
result.getApproximateCountSamplingSize());
}
代码示例来源:origin: opencb/opencga
public void testGetBySampleName(String expectedSource, QueryOptions options) throws Exception {
query = new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.SAMPLE.key(), "NA12877");
// queryResult = dbAdaptor.get(query, options);
queryResult = variantStorageEngine.get(query, options);
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "S_1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"), options);
assertEquals(expectedSource, queryResult.getSource());
assertThat(queryResult, everyResult(allVariants, withStudy("S_1", allOf(withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"), withSampleData("NA12877", "GT", containsString("1"))))));
}
代码示例来源:origin: opencb/opencga
public void testGetBySamplesName(String expectedSource, QueryOptions options) throws Exception {
query = new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.SAMPLE.key(), "NA12877;NA12878");
// queryResult = dbAdaptor.get(query, options);
queryResult = variantStorageEngine.get(query, options);
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "S_1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz,1K.end.platinum-genomes-vcf-NA12878_S1.genome.vcf.gz"), options);
assertEquals(expectedSource, queryResult.getSource());
assertThat(queryResult, everyResult(allVariants, withStudy("S_1", allOf(
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"),
withSampleData("NA12877", "GT", containsString("1"))),
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12878_S1.genome.vcf.gz"),
withSampleData("NA12878", "GT", containsString("1")))))));
}
代码示例来源:origin: opencb/opencga
public void testGetByGenotypes(String expectedSource, QueryOptions options) throws Exception {
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "S_1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz,1K.end.platinum-genomes-vcf-NA12878_S1.genome.vcf.gz"), options);
queryResult = variantStorageEngine.get(new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.GENOTYPE.key(), "NA12877:0/1,NA12878:1/1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878"), options);
assertThat(queryResult, everyResult(allVariants, withStudy("S_1", anyOf(
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"),
withSampleData("NA12877", "GT", containsString("0/1"))),
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12878_S1.genome.vcf.gz"),
withSampleData("NA12878", "GT", containsString("1/1")))))));
assertEquals(expectedSource, queryResult.getSource());
queryResult = variantStorageEngine.get(new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.GENOTYPE.key(), "NA12877:" + GenotypeClass.HET_REF + ",NA12878:" + GenotypeClass.HOM_ALT)
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878"), options);
assertThat(queryResult, everyResult(allVariants, withStudy("S_1", anyOf(
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"),
withSampleData("NA12877", "GT", containsString("0/1"))),
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12878_S1.genome.vcf.gz"),
withSampleData("NA12878", "GT", containsString("1/1")))))));
assertEquals(expectedSource, queryResult.getSource());
}
代码示例来源:origin: opencb/opencga
public void testGetByFileName(String expectedSource, QueryOptions options) throws Exception {
query = new Query()
// .append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz");
// queryResult = dbAdaptor.get(query, options);
queryResult = variantStorageEngine.get(query, options);
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "all")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"), options);
assertEquals(expectedSource, queryResult.getSource());
assertThat(queryResult, everyResult(allVariants, withStudy("S_1", withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"))));
}
代码示例来源:origin: opencb/opencga
public void testGetByGenotypesWithRefMix(String expectedSource, QueryOptions options) throws Exception {
query = new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.GENOTYPE.key(), "NA12877:0/1;NA12878:0/0,0/1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878")
.append(VariantQueryParam.UNKNOWN_GENOTYPE.key(), "0/0");
// queryResult = dbAdaptor.get(query, options);
queryResult = variantStorageEngine.get(query, options);
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "S_1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz,1K.end.platinum-genomes-vcf-NA12878_S1.genome.vcf.gz")
.append(VariantQueryParam.UNKNOWN_GENOTYPE.key(), "0/0"), options);
assertThat(queryResult, everyResult(allVariants, withStudy("S_1", allOf(
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"),
withSampleData("NA12877", "GT", containsString("0/1"))),
anyOf(
withSampleData("NA12878", "GT", containsString("0/0")),
withSampleData("NA12878", "GT", containsString("0/1"))
)
))));
assertEquals(expectedSource, queryResult.getSource());
}
代码示例来源:origin: opencb/opencga
public void testGetByGenotypesWithRef(String expectedSource, QueryOptions options) throws Exception {
query = new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.GENOTYPE.key(), "NA12877:0/1;NA12878:0/0")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878")
.append(VariantQueryParam.UNKNOWN_GENOTYPE.key(), "0/0");
// queryResult = dbAdaptor.get(query, options);
queryResult = variantStorageEngine.get(query, options);
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "S_1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877,NA12878")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz,1K.end.platinum-genomes-vcf-NA12878_S1.genome.vcf.gz")
.append(VariantQueryParam.UNKNOWN_GENOTYPE.key(), "0/0"), options);
assertThat(queryResult, everyResult(allVariants, withStudy("S_1", allOf(
allOf(
withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"),
withSampleData("NA12877", "GT", containsString("0/1"))),
withSampleData("NA12878", "GT", containsString("0/0"))))));
assertEquals(expectedSource, queryResult.getSource());
}
代码示例来源:origin: opencb/opencga
public void testGetBySampleNameMultiRegion(String expectedSource, QueryOptions options) throws Exception {
query = new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.SAMPLE.key(), "NA12877")
.append(VariantQueryParam.REGION.key(), "1:1-12783,M");
// queryResult = dbAdaptor.get(query, options);
queryResult = variantStorageEngine.get(query, options);
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "S_1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"), options);
assertEquals(expectedSource, queryResult.getSource());
assertThat(queryResult, everyResult(allVariants, allOf(anyOf(overlaps(new Region("1:1-12783")), overlaps(new Region("M"))), withStudy("S_1", allOf(withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"), withSampleData("NA12877", "GT", containsString("1")))))));
}
代码示例来源:origin: opencb/opencga
public void testGetByGenotypeMultiRegion(String expectedSource, QueryOptions options) throws Exception {
query = new Query()
.append(VariantQueryParam.STUDY.key(), "S_1")
.append(VariantQueryParam.GENOTYPE.key(), "NA12877:1/1")
.append(VariantQueryParam.REGION.key(), "1:1-12783,M");
// queryResult = dbAdaptor.get(query, options);
queryResult = variantStorageEngine.get(query, options);
VariantQueryResult
.append(VariantQueryParam.INCLUDE_STUDY.key(), "S_1")
.append(VariantQueryParam.INCLUDE_SAMPLE.key(), "NA12877")
.append(VariantQueryParam.INCLUDE_FILE.key(), "1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"), options);
assertEquals(expectedSource, queryResult.getSource());
assertThat(queryResult, everyResult(allVariants, allOf(anyOf(overlaps(new Region("1:1-12783")), overlaps(new Region("M"))), withStudy("S_1", allOf(withFileId("1K.end.platinum-genomes-vcf-NA12877_S1.genome.vcf.gz"), withSampleData("NA12877", "GT", is("1/1")))))));
}