https://www.biorxiv.org/content/biorxiv/early/2019/12/02/861054/DC1/embed/media-1.pdf?download=true
Finding Active Regions
위의 수식에서 ln(N N_alt)는 combination (즉 C(N,N_alt))을 의미한다. 즉 N개의 read가 있을 때 N_alt개의 조합을 뽑는거라고 생각하면 된다.
diagamma function을 활용해서 entropy가 적정 지점 이상인 부분을 선택함.https://en.wikipedia.org/wiki/Digamma_function
Digamma function - Wikipedia
From Wikipedia, the free encyclopedia Mathematical function The digamma function ψ ( z ) {\displaystyle \psi (z)} ,visualized using domain coloring Real part plots of the digamma and the next three polygamma functions along the real line In mathematics, t
en.wikipedia.org
Debrujin graph를 이용한 re-alignment
mutect2/vardict 등과 마찬가지로 deepvariant도 debrujin graph를 통해 realignment를 진행한다.
해당 부분을 어떻게 한다는 것은 찾기 어려운데 deepvariant의 논문 부분에서 조금 더 설명되어 있어서 해당 부분을 적었다.
Haplotype-aware realignment of reads. Mapped reads are preprocessed using an error-tolerant, local De-Bruijn-graph-based read assembly procedure that realigns them according to their most likely derived haplotype. Candidate
windows across the genome are selected for reassembly by looking for any evidence of possible genetic variation, such as mismatching or soft clipped
bases. The selection criteria for a candidate window are very permissive so that true variation is unlikely to be missed. All candidate windows across the genome are considered independently. De Bruijn graphs are constructed using
multiple fixed k-mer sizes (from 20 to 75, inclusive, with increments of 5) out of the reference genome bases for the candidate window, as well as all overlapping reads. Edges are given a weight determined by how many times they are
observed in the reads. We trim any edges with weight less than three, except that edges found in the reference are never trimmed. Candidate haplotypes are generated by traversing the assembly graphs and the top two most likely haplo-
types are selected that best explain the read evidence. The likelihood function used to score haplotypes is a traditional pair HMM with fixed parameters that do not depend on base quality scores. This likelihood function assumes that
each read is independent. Finally, each read is then realigned to its most likely haplotype using a Smith–Waterman-like algorithm with an additional affine gap penalty score for homopolymer indels. This procedure updates both the
position and the CIGAR string for each read.
debrujin graph를 통해 re-alignment를 진행하면 reference와 여러 종류의 haplotypes들이 나오게 될 것임.
이제 여기서 할 일은 해당 영역의 read들에 대해 pairHMM을 통해 각 read별로 어떤 haplotype (또는 ref)인지 확률을 계산하는 것임.
deepvariant의 경우는 최대 2가지의의 haplotype만을 고려하므로 간단히 예를들면 상태는 haplotype인 A, B, 그리고 Ref가 있다. 이것들에 대해 read1이 어디에서 왔을지 가능도 (likelihood)를 계산하는 것이다. 이를 통해 reference와 haplotype들에 대한 read-count를 계산할 수 있게 된다.
pairHMM에서 transition probability는 deepvariant의 경우 어떻게 계산하는지 모르겠지만
mutect2의 방법은 아래와 같다. 먼저 M, I, D 모두 0으로 시작한 후에 업데이트를 진행한다.
여기서 lambda는 base-quality (Qi)에 따른 확률값으로 일치 시에는 Qi/3이고 불일치 시에는 1-Qi값이다.
deepvariant에서는 현재 (2024년 01 08)는 pairHMM 모델은 버리고 단순히 alignment 후 가장 최대로 matching되는 것을 지정하는 형태로 바뀐 것으로 확인됨. find_max_overlapping(query_range, search_ranges)
https://github.com/google/deepvariant/blob/r1.6/deepvariant/realigner/realigner.py
https://github.com/google/deepvariant/blob/r1.6/third_party/nucleus/util/ranges.py