GATK EventMap类介绍

在GATK4中,EventMap类是用于处理和管理变异事件(如插入、缺失和替换)在基因组位置上的映射。这个类在复杂变异调用和变异分析中扮演了重要角色。以下是EventMap类的主要功能和用途:

主要功能

  1. 存储变异事件

    • EventMap用于存储在特定基因组位置上发生的变异事件。这些事件可能包括插入、缺失或替换等类型的变异。
  2. 合并事件

    • 当多个变异事件发生在同一位置时,EventMap能够合并这些事件。合并过程通常涉及将不同类型的事件结合起来,以形成一个复合事件,从而便于进一步分析。
  3. 查询事件

    • 可以通过位置查询特定的变异事件。这使得对特定区域或位置的变异进行详细分析成为可能。
  4. 更新事件

    • 提供方法来更新现有位置的变异事件,例如通过添加新的变异或修改现有变异的详细信息。
  5. 管理事件

    • 支持添加、删除和检查特定位置的变异事件,以及获取所有事件的位置和详情。

EventMap类和Haplotype类关系

  1. 事件和基因型的关联

    • Haplotype类可能会包含一个或多个EventMap实例,表示其所描述的基因型中涉及的所有变异事件。这意味着一个Haplotype可以关联多个变异事件,通过EventMap管理这些事件。
  2. 变异分析过程中的协同作用

    • 在变异呼叫和分析中,Haplotype类用于描述具体的基因型,包括变异事件的上下文,而EventMap则用于管理这些变异事件的位置和信息。它们协同工作来支持复杂的变异分析任务。
  3. 复合事件处理

    • EventMap在处理复合事件时,可能会涉及到多个Haplotype,每个Haplotype可能包含不同的变异事件。EventMap负责管理这些事件的详细信息,而Haplotype则负责描述这些事件在基因组中的具体表现形式。

源码:

package org.broadinstitute.hellbender.utils.haplotype;

import com.google.common.annotations.VisibleForTesting;
import htsjdk.samtools.Cigar;
import htsjdk.samtools.CigarElement;
import htsjdk.samtools.util.Locatable;
import htsjdk.variant.variantcontext.Allele;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.broadinstitute.hellbender.exceptions.GATKException;
import org.broadinstitute.hellbender.tools.walkers.haplotypecaller.AssemblyBasedCallerUtils;
import org.broadinstitute.hellbender.utils.BaseUtils;
import org.broadinstitute.hellbender.utils.Utils;
import org.broadinstitute.hellbender.utils.param.ParamUtils;

import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
 * Extract simple VariantContext events from a single haplotype
 */
public final class EventMap extends TreeMap<Integer, Event> {
    private static final long serialVersionUID = 1L;

    private static final Logger logger = LogManager.getLogger(EventMap.class);

    public EventMap(final Collection<Event> events) {
        super();
        events.forEach(this::addEvent);
    }

    public static EventMap fromHaplotype(final Haplotype haplotype, final byte[] ref, final Locatable refLoc, final int maxMnpDistance) {
        return new EventMap(getEvents(haplotype, ref, refLoc, maxMnpDistance));
    }

    public static EventMap fromHaplotype(final Haplotype haplotype, final byte[] ref, final int maxMnpDistance) {
        return new EventMap(getEvents(haplotype, ref, haplotype, maxMnpDistance));
    }

    // this is really just a convenient way to make EventMap objects in unit tests
    @VisibleForTesting
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值