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

htsjdk.variant.variantcontext.Genotype.sameGenotype()方法的使用及代码示例

本文整理了Java中htsjdk.variant.variantcontext.Genotype.sameGenotype()方法的一些代码示例,展示了Ge

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

Genotype.sameGenotype介绍

暂无

代码示例

代码示例来源:origin: samtools/htsjdk

public boolean sameGenotype(final Genotype other) {
return sameGenotype(other, true);
}

代码示例来源:origin: com.github.samtools/htsjdk

public boolean sameGenotype(final Genotype other) {
return sameGenotype(other, true);
}

代码示例来源:origin: org.seqdoop/htsjdk

public boolean sameGenotype(final Genotype other) {
return sameGenotype(other, true);
}

代码示例来源:origin: samtools/htsjdk

Assert.assertTrue( ((Genotype) jEXLContext.get("g")).sameGenotype(gt, false));
Assert.assertEquals(jEXLContext.get("isHom"), VariantJEXLContext.false_string);
Assert.assertEquals(jEXLContext.get("isHomRef"), VariantJEXLContext.false_string);

代码示例来源:origin: broadinstitute/picard

@Test(dataProvider = "updatePLsAndADData")
public void testUpdatePLsAndADData(final VariantContext originalVC,
final VariantContext selectedVC,
final List expectedGenotypes) {
// initialize cache of allele anyploid indices
for (final Genotype genotype : originalVC.getGenotypes()) {
GenotypeLikelihoods.initializeAnyploidPLIndexToAlleleIndices(originalVC.getNAlleles() - 1, genotype.getPloidy());
}
final VariantContext selectedVCwithGTs = new VariantContextBuilder(selectedVC).genotypes(originalVC.getGenotypes()).make();
final GenotypesContext oldGs = selectedVCwithGTs.getGenotypes();
final GenotypesContext actual = selectedVCwithGTs.getNAlleles() == originalVC.getNAlleles() ? oldGs :
AlleleSubsettingUtils.subsetAlleles(oldGs, originalVC.getAlleles(),
selectedVCwithGTs.getAlleles());
Assert.assertEquals(actual.size(), expectedGenotypes.size());
for (final Genotype expected : expectedGenotypes) {
final Genotype actualGT = actual.get(expected.getSampleName());
Assert.assertNotNull(actualGT);
Assert.assertTrue(actualGT.sameGenotype(expected), String.format("expected same genotypes, found: %s and expected: %s", actual.toString(), expected.toString()));
}
}

代码示例来源:origin: broadgsa/gatk-protected

@Test
public void TestReallyMergeIntoMNP( ){
final VariantContext vc = PhasingUtils.reallyMergeIntoMNP(vc1, vc2, referenceFile);
final List alleleList = Arrays.asList(Allele.create("TG", true), Allele.create("TA", false), Allele.create("CG", false));
final Map attributes = new HashMap(){{
put("AC", new ArrayList(Arrays.asList(1, 1)));
put("AF", new ArrayList(Arrays.asList(0.5, 0.5)));
put("AN", 2);
}};
final Map extendedAttributes = new HashMap(){{
put("PQ", 100.0); put("HP", new String[]{"10-1", "10-2"});
}};
final List alleleListMeged = Arrays.asList(Allele.create("TA"), Allele.create("CG"));
final Genotype genotype = new GenotypeBuilder().name("sample").attributes(extendedAttributes).alleles(alleleListMeged).make();
final VariantContext vcExpected = new VariantContextBuilder().chr(contig).id("id1;id2").source("TC_GA").start(start).stop(start+1).alleles(alleleList).genotypes(genotype).attributes(attributes).make();
Assert.assertTrue(genotype.sameGenotype(vcExpected.getGenotypes().get("sample")));
Assert.assertTrue(vcExpected.hasSameAllelesAs(vc));
Assert.assertEquals(vcExpected.getChr(), vc.getChr());
Assert.assertEquals(vcExpected.getStart(), vc.getStart());
Assert.assertEquals(vcExpected.getEnd(), vc.getEnd());
Assert.assertEquals(vcExpected.getID(), vc.getID());
Assert.assertEquals(vcExpected.getSource(), vc.getSource());
Assert.assertEquals(vcExpected.isFiltered(), vc.isFiltered());
Assert.assertEquals(vcExpected.getPhredScaledQual(), vc.getPhredScaledQual());
Assert.assertEquals(vcExpected.getAttribute("PQ"), vc.getAttribute("PQ"));
Assert.assertEquals(vcExpected.getAttribute("HP"), vc.getAttribute("HP"));
}

代码示例来源:origin: broadgsa/gatk-protected

@Test
public void TestMergeIntoMNP(){
final AlwaysTrueMergeRule alleleMergeRule = new AlwaysTrueMergeRule();
final VariantContext vc = PhasingUtils.mergeIntoMNP(genomeLocParser, vc1, vc2, referenceFile, alleleMergeRule);
final List alleleList = Arrays.asList(Allele.create("TG", true), Allele.create("TA", false), Allele.create("CG", false));
final Map attributes = new HashMap(){{
put("AC", new ArrayList(Arrays.asList(1, 1)));
put("AF", new ArrayList(Arrays.asList(0.5, 0.5)));
put("AN", 2);
}};
final Map extendedAttributes = new HashMap(){{
put("PQ", 100.0); put("HP", new String[]{"10-1", "10-2"});
}};
final List alleleListMeged = Arrays.asList(Allele.create("TA"), Allele.create("CG"));
final Genotype genotype = new GenotypeBuilder().name("sample").attributes(extendedAttributes).alleles(alleleListMeged).make();
final VariantContext vcExpected = new VariantContextBuilder().chr(contig).id("id1;id2").source("TC_GA").start(start).stop(start+1).alleles(alleleList).genotypes(genotype).attributes(attributes).make();
Assert.assertTrue(genotype.sameGenotype(vcExpected.getGenotypes().get("sample")));
Assert.assertTrue(vcExpected.hasSameAllelesAs(vc));
Assert.assertEquals(vcExpected.getChr(), vc.getChr());
Assert.assertEquals(vcExpected.getStart(), vc.getStart());
Assert.assertEquals(vcExpected.getEnd(), vc.getEnd());
Assert.assertEquals(vcExpected.getID(), vc.getID());
Assert.assertEquals(vcExpected.getSource(), vc.getSource());
Assert.assertEquals(vcExpected.isFiltered(), vc.isFiltered());
Assert.assertEquals(vcExpected.getPhredScaledQual(), vc.getPhredScaledQual());
Assert.assertEquals(vcExpected.getAttribute("PQ"), vc.getAttribute("PQ"));
Assert.assertEquals(vcExpected.getAttribute("HP"), vc.getAttribute("HP"));
}

推荐阅读
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • 目录实现效果:实现环境实现方法一:基本思路主要代码JavaScript代码总结方法二主要代码总结方法三基本思路主要代码JavaScriptHTML总结实 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 1,关于死锁的理解死锁,我们可以简单的理解为是两个线程同时使用同一资源,两个线程又得不到相应的资源而造成永无相互等待的情况。 2,模拟死锁背景介绍:我们创建一个朋友 ... [详细]
  • 本文详细介绍了Spring的JdbcTemplate的使用方法,包括执行存储过程、存储函数的call()方法,执行任何SQL语句的execute()方法,单个更新和批量更新的update()和batchUpdate()方法,以及单查和列表查询的query()和queryForXXX()方法。提供了经过测试的API供使用。 ... [详细]
  • [大整数乘法] java代码实现
    本文介绍了使用java代码实现大整数乘法的过程,同时也涉及到大整数加法和大整数减法的计算方法。通过分治算法来提高计算效率,并对算法的时间复杂度进行了研究。详细代码实现请参考文章链接。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
author-avatar
拍友2702938227
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有