GATK Haplotype类介绍

在GATK(Genome Analysis Toolkit)中,Haplotype类用于表示和处理基因组中的可能基因型(haplotype)。这个类是GATK中重要的数据结构之一,尤其在变异检测和基因组组装过程中具有关键作用。以下是Haplotype类的设计和功能的详细介绍:

设计目标

Haplotype类的设计旨在提供一个灵活的数据结构,以表示基因组中的不同基因型序列。这个类可以处理各种类型的变异,包括单核苷酸变异(SNPs)和插入/缺失变异(Indels),并支持对这些变异的详细分析。

主要功能

  1. 存储基因型序列

    • Haplotype类用于存储一个基因型的完整序列,包括参考序列和变异序列。
    • 它可以包含在给定位置的变异(SNPs、Indels)以及这些变异的上下文。
  2. 管理变异信息

    • 提供方法来获取和管理变异信息,例如变异的位置、类型以及影响。
    • 支持对基因型序列的变异进行详细分析和注释。
  3. 变异比对

    • 支持与参考基因组的比对,以确定基因型序列的准确性和变异的性质。
    • 提供方法来比较不同的Haplotype对象,以识别和分析基因型之间的差异。
  4. 序列操作

    • 提供对基因型序列的操作功能,例如插入、删除和替换变异。
    • 支持对序列进行编辑和更新,以便于进一步的分析和处理。
  5. 质量评估

    • 包括质量评估功能,用于评估基因型的可靠性和准确性。
    • 提供与变异质量相关的信息,如支持度、置信度等。

源码:

package org.broadinstitute.hellbender.utils.haplotype;

import htsjdk.samtools.Cigar;
import htsjdk.samtools.CigarElement;
import htsjdk.samtools.CigarOperator;
import htsjdk.samtools.util.Locatable;
import htsjdk.variant.variantcontext.Allele;
import htsjdk.variant.variantcontext.SimpleAllele;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.broadinstitute.hellbender.utils.SimpleInterval;
import org.broadinstitute.hellbender.utils.Utils;
import org.broadinstitute.hellbender.utils.read.AlignmentUtils;
import org.broadinstitute.hellbender.utils.read.CigarBuilder;
import org.broadinstitute.hellbender.utils.read.ReadUtils;

import java.util.Arrays;
import java.util.Comparator;

public class Haplotype extends SimpleAllele implements Locatable{
    private static final long serialVersionUID = 1L;

    /**
     * Compares two haplotypes first by their lengths and then by lexicographic order of their bases.
     */
    public static final Comparator<Haplotype> SIZE_AND_BASE_ORDER =
            Comparator.comparingInt((Haplotype hap) -> hap.getBases().length)
                      .thenComparing(Allele::getBaseString);

    private Locatable genomeLocation = null;
    private EventMap eventMap = null;
    private Cigar cigar;
    private int alignmentStartHapwrtRef; //NOTE: this is the offset to a supposed array of reference bases held in memory and has nothing to do with start positions
    private double score = Double.NaN;

    /**
     * see {@link org.broadinstitute.hellbender.tools.walkers.haplotypecaller.LongHomopolymerHaplotypeCollapsingEngine} for a description of the semantics of collapsing
     */
    private boolean isCollapsed;
    private int uniquenessValue;   // uniquely diffrentiates the haplotype from others with same ref/bases.

    // debug information for tracking kmer sizes used in graph construction for debug output
    private int kmerSize = 0;

    /**
     * Main constructor
    
  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值