热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何使用`org.opencb.opencga.core.results.VariantQueryResult.getSource()`方法及其代码示例详解

本文整理了Java中org.opencb.opencga.core.results.VariantQueryResult.getSource()方法的一些代码示例,展示了VariantQueryRes

本文整理了Java中org.opencb.opencga.core.results.VariantQueryResult.getSource()方法的一些代码示例,展示了VariantQueryResult.getSource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VariantQueryResult.getSource()方法的具体详情如下:
包路径:org.opencb.opencga.core.results.VariantQueryResult
类名称:VariantQueryResult
方法名:getSource

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 VariantQueryResult get(Query query, QueryOptions queryOptions, String sessionId, Class clazz)
throws CatalogException, IOException, StorageEngineException {
VariantQueryResult result = get(query, queryOptions, sessionId);
List variants;
if (clazz == Variant.class) {
return (VariantQueryResult) result;
} else if (clazz == org.ga4gh.models.Variant.class) {
Ga4ghVariantConverter cOnverter= new Ga4ghVariantConverter<>(new AvroGa4GhVariantFactory());
variants = (List) converter.apply(result.getResult());
} else if (clazz == ga4gh.Variants.Variant.class) {
Ga4ghVariantConverter cOnverter= new Ga4ghVariantConverter<>(new ProtoGa4GhVariantFactory());
variants = (List) converter.apply(result.getResult());
} 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 allVariants = dbAdaptor.get(new Query()
.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 allVariants = dbAdaptor.get(new Query()
.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 allVariants = dbAdaptor.get(new Query()
.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 allVariants = dbAdaptor.get(new Query()
.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 allVariants = dbAdaptor.get(new Query()
.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 allVariants = dbAdaptor.get(new Query()
.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 allVariants = dbAdaptor.get(new Query()
.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 allVariants = dbAdaptor.get(new Query()
.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")))))));
}

推荐阅读
  • 版本控制工具——Git常用操作(下)
    本文由云+社区发表作者:工程师小熊摘要:上一集我们一起入门学习了git的基本概念和git常用的操作,包括提交和同步代码、使用分支、出现代码冲突的解决办法、紧急保存现场和恢复 ... [详细]
  • 本文探讨了在 SQL Server 中使用 JDBC 插入数据时遇到的问题。通过详细分析代码和数据库配置,提供了解决方案并解释了潜在的原因。 ... [详细]
  • LeetCode 690:计算员工的重要性评分
    在解决LeetCode第690题时,我记录了详细的解题思路和方法。该问题要求根据员工的ID计算其重要性评分,包括直接和间接下属的重要性。本文将深入探讨如何使用哈希表(Map)来高效地实现这一目标。 ... [详细]
  • 本文介绍如何从字符串中移除大写、小写、特殊、数字和非数字字符,并提供了多种编程语言的实现示例。 ... [详细]
  • Linux环境下C语言实现定时向文件写入当前时间
    本文介绍如何在Linux系统中使用C语言编程,实现在每秒钟向指定文件中写入当前时间戳。通过此示例,读者可以了解基本的文件操作、时间处理以及循环控制。 ... [详细]
  • 在高并发需求的C++项目中,我们最初选择了JsonCpp进行JSON解析和序列化。然而,在处理大数据量时,JsonCpp频繁抛出异常,尤其是在多线程环境下问题更为突出。通过分析发现,旧版本的JsonCpp存在多线程安全性和性能瓶颈。经过评估,我们最终选择了RapidJSON作为替代方案,并实现了显著的性能提升。 ... [详细]
  • 本文详细介绍了如何在Kendo UI for jQuery的数据管理组件中,将行标题字段呈现为锚点(即可点击链接),帮助开发人员更高效地实现这一功能。通过具体的代码示例和解释,即使是新手也能轻松掌握。 ... [详细]
  • This post discusses an issue encountered while using the @name annotation in documentation generation, specifically regarding nested class processing and unexpected output. ... [详细]
  • ElasticSearch 集群监控与优化
    本文详细介绍了如何有效地监控 ElasticSearch 集群,涵盖了关键性能指标、集群健康状况、统计信息以及内存和垃圾回收的监控方法。 ... [详细]
  • 为了解决不同服务器间共享图片的需求,我们最初考虑建立一个FTP图片服务器。然而,考虑到项目是一个简单的CMS系统,为了简化流程,团队决定探索七牛云存储的解决方案。本文将详细介绍使用七牛云存储的过程和心得。 ... [详细]
  • 本文探讨了如何在Classic ASP中实现与PHP的hash_hmac('SHA256', $message, pack('H*', $secret))函数等效的哈希生成方法。通过分析不同实现方式及其产生的差异,提供了一种使用Microsoft .NET Framework的解决方案。 ... [详细]
  • Java多线程实现:从1到100分段求和并汇总结果
    本文介绍如何使用Java编写一个程序,通过10个线程分别计算不同区间的和,并最终汇总所有线程的结果。每个线程负责计算一段连续的整数之和,最后将所有线程的结果相加。 ... [详细]
  • 本文介绍了如何通过Java代码计算一个整数的位数,并展示了多个基础编程示例,包括求和、平均分计算、条件判断等。 ... [详细]
  • 本文将详细探讨 Java 中提供的不可变集合(如 `Collections.unmodifiableXXX`)和同步集合(如 `Collections.synchronizedXXX`)的实现原理及使用方法,帮助开发者更好地理解和应用这些工具。 ... [详细]
  • 本文旨在探讨如何利用决策树算法实现对男女性别的分类。通过引入信息熵和信息增益的概念,结合具体的数据集,详细介绍了决策树的构建过程,并展示了其在实际应用中的效果。 ... [详细]
author-avatar
hytyj_989
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有