作者,Evil Genius
跟美國人交流的時(shí)候,討論起外顯子的CNV檢測(cè),國內(nèi)用的cnvkit居多,但是我翻了很多的推文,感覺都寫的很膚淺,美國人問到的問題都比較深入,涉及到算法核心,所以這一篇我們好好梳理一下cnvkit的運(yùn)用。
反正不詳細(xì)的深入理解,糊弄不過去,這一點(diǎn)美國人還是很較真的,在大佬面前真的是一點(diǎn)僥幸心理都不能有。
cnvkit的官網(wǎng)網(wǎng)址https://cnvkit.readthedocs.io/en/stable/
文章在CNVkit: Genome-Wide Copy Number Detection and Visualization from Targeted DNA Sequencing
cnvkit方法使用targeted reads和nonspecifically captured off-target reads來均勻地推斷整個(gè)基因組的拷貝數(shù)。這種組合在目標(biāo)區(qū)域?qū)崿F(xiàn)了外顯子水平的分辨率,在較大的內(nèi)含子和基因間區(qū)實(shí)現(xiàn)了足夠的分辨率,以識(shí)別拷貝數(shù)的變化。
知識(shí)背景
- 拷貝數(shù)變化是包括癌癥在內(nèi)的許多疾病的有用診斷指標(biāo)。
- 對(duì)于臨床應(yīng)用,通常更傾向于對(duì)基因組分區(qū)(如外顯子組或一組疾病相關(guān)基因)進(jìn)行測(cè)序,以富集感興趣的區(qū)域,并在更高的覆蓋范圍內(nèi)對(duì)其進(jìn)行測(cè)序,以提高call變異的敏感性。
- 在目標(biāo)區(qū)域富集過程中,通過雜交捕獲目標(biāo)區(qū)域;然而,文庫中仍然保留了大量的脫靶DNA,這些DNA被測(cè)序,代表了相當(dāng)大的一部分reads。因此,除了在目標(biāo)區(qū)域獲得高覆蓋率測(cè)序外,脫靶reads提供了全基因組的極低覆蓋率測(cè)序。雖然脫靶讀取本身不能提供足夠的覆蓋范圍來調(diào)用單核苷酸變異(snv)和其他小變異,但它們可以在更大的范圍內(nèi)提供有關(guān)拷貝數(shù)的有用信息。
-
CNVKIT利用在靶和脫靶測(cè)序讀取并應(yīng)用一系列校正來提高拷貝數(shù)檢測(cè)的準(zhǔn)確性。
pipeline
CNVkit使用on-target reads和非特異性捕獲的off-target reads來計(jì)算每個(gè)樣本基因組的log2拷貝比。簡而言之,off-target bin是從目標(biāo)區(qū)域之間的基因組位置分配的,off-target bin的平均大小比平均on-target bin大得多,以匹配它們的read counts.然后分別使用目標(biāo)位置和非目標(biāo)位置來計(jì)算每個(gè)間隔內(nèi)的平均reads深度。然后將目標(biāo)reads深度和非目標(biāo)reads深度結(jié)合起來,將其歸一化為來自對(duì)照樣本的參考,并對(duì)幾個(gè)系統(tǒng)偏差進(jìn)行校正,從而得到 log2 copy ratios的最終表。內(nèi)置的segmentation algorithm可以在log2 copy ratios上運(yùn)行,以推斷discrete copy number segments。
Calculation of off-target intervals
用于計(jì)數(shù)脫靶reads的基因組間隔最初是從目標(biāo)間隔的基因組位置計(jì)算的。CNVkit根據(jù)target regions,將每個(gè)target之間的非target區(qū)域劃分為bin,通常按100 kilobases的順序劃分。作為可選的輸入,在創(chuàng)建off-target bins時(shí),可以使用可測(cè)序的染色體區(qū)域和低映射區(qū)域的單獨(dú)列表來排除端粒、著絲粒和其他不可測(cè)序或不可映射的重復(fù)區(qū)域。
每個(gè)連續(xù)的非目標(biāo)區(qū)域被劃分為大小相等的bin,使得該區(qū)域內(nèi)的平均bin大小盡可能接近指定大小。可以通過計(jì)算目標(biāo)區(qū)域平均大小與目標(biāo)區(qū)域測(cè)序reads的fold-enrichment的乘積來選擇合適的off-target bin大小,使得平均大致相同數(shù)量的reads被映射到on - and - off-target bin上。為了最大限度地增加bin的數(shù)量,CNVkit將偏離指定的bin大小,將bin放入小的區(qū)域,如內(nèi)含子,這些區(qū)域的大小受到限制。還可以指定bin大小的下限,以避免評(píng)估非常小的非目標(biāo)區(qū)域,在這些區(qū)域中,捕獲的reads太少,無法給出可靠的拷貝數(shù)估計(jì)。一旦生成了一組可靠的off-target bin并保存為BED文件,同一個(gè)BED文件可以在CNVkit中重復(fù)使用,用于使用相同panel的其他樣品的拷貝數(shù)分析,并在相同的平臺(tái)上測(cè)序。
Estimation of copy number by read depth
CNVkit coverage命令使用BAM格式的測(cè)序reads比對(duì)和BED或interval list格式的on或off-target bins的位置,計(jì)算樣本中每個(gè)bin中的log2平均讀取深度。對(duì)于每個(gè)bin,使用pysam計(jì)算和求和bin中每個(gè)堿基對(duì)的read depths,然后除以bin的大小。輸出是一個(gè)表,其中顯示了每個(gè)給定bin的平均reads depths,經(jīng)過log2變換并以所有常染色體centered to the median read depth of all autosomes。
Construction of a copy number reference
在每個(gè)基因組bin中,提取每個(gè)給定對(duì)照樣本的read depths。對(duì)每個(gè)control樣本執(zhí)行reads深度偏差校正。在每個(gè)bin中,計(jì)算control samples中l(wèi)og2 reads深度的加權(quán)平均值,以標(biāo)記上具有較高或較低覆蓋率的bin,the spread or statistical dispersion of log2 read depths indicates bins that have erratic coverage so that they can be de-emphasized at the segmentation step. 也可以使用單個(gè)成對(duì)的control sample,或者,在沒有任何control samples的情況下,可以構(gòu)建一個(gè)“通用”參考,讀取深度為log2,分配給所有箱子的擴(kuò)展為0。在所有情況下,都可以指定一個(gè)“男性參考”,其中X染色體bin的預(yù)期讀取深度是常染色體的一半。
Bin size and resolution
- 人類基因組中的外顯子平均大小約為200bp。選擇目標(biāo)bin大小默認(rèn)值267,這樣拆分較大的外顯子將產(chǎn)生最小大小為200的bin。由于包含較少 reads的bin會(huì)導(dǎo)致更嘈雜的拷貝數(shù)信號(hào),因此這種方法確保通過分裂較大外顯子產(chǎn)生的bin的“噪聲”不會(huì)比平均水平差。
- 例如,將目標(biāo)bin的平均大小設(shè)置為100bp,將產(chǎn)生大約兩倍的目標(biāo)bin,這可能會(huì)導(dǎo)致更高分辨率的分割。然而,在每個(gè)bin中計(jì)數(shù)的讀取次數(shù)將減少大約一半,從而增加了bin級(jí)覆蓋率的方差或“噪聲”。過多的噪聲bin會(huì)使可視化變得困難,并且由于噪聲可能不是正態(tài)分布的,特別是在存在許多reads為零的bin的情況下,分割算法可能會(huì)在低覆蓋率樣本上產(chǎn)生不太準(zhǔn)確的結(jié)果。因此,建議總體靶向測(cè)序覆蓋深度至少為200x至300x,reads長度為100bp,以證明將平均目標(biāo)bin大小減少到100bp是合理的。
- 對(duì)于混合捕獲,如果targets are not tiled with uniform density——例如,target panel is designed with a subset of targets having twice or half the usual number of tiles for a fixed number of genomic bases ——不需要做任何特別的事情來彌補(bǔ)這一點(diǎn),as long as you are using a pooled reference。當(dāng)測(cè)試樣本的讀深度歸一化到pool引用時(shí),log2比率將趨于平衡.
Filtering segments
- cn值,merging adjacent with the same called value.
- Keeping only high-level amplifications (5 copies or more) and homozygous deletions (0 copies) (ampdel).
- Confidence interval overlapping zero (ci).
- Standard error of the mean (sem), a parametric estimate of confidence intervals which behaves similarly.
在每種情況下,根據(jù)給定的標(biāo)準(zhǔn)將具有相同值的相鄰段合并在一起,并適當(dāng)?shù)刂匦掠?jì)算列值。即使總拷貝數(shù)相同,位于不同染色體上或具有不同等位基因特異性拷貝數(shù)值的片段也不會(huì)合并。
breaks
cnvkit.py breaks Sample.cnr Sample.cns
這有助于鑒定(a)發(fā)生不平衡融合或其他結(jié)構(gòu)重排斷點(diǎn)的基因,或(b)由于拷貝數(shù)信號(hào)不一致而難以調(diào)用CNV的基因。
Columns:
- gene, chromosome – as in .cns, the gene where the breakpoint occurs and the chromosome it lies on.
- location – the
end
of the segment to the left of the breakpoint, andstart
of the segment to the right.- change – the difference in
log2
values between the adjacent segments.- probes_left, probes_right – the number of probes on each side of the breakpoint within the gene. (Not the same as the number of probes supporting each segment; just the portion within the gene.)
genemetrics
Identify targeted genes with copy number gain or loss above or below a threshold.
The remaining output columns have slightly different meaning depending on whether or not segments were provided. Without segments (.cnr alone):
- log2: Weighted mean of log2 ratios of all the gene’s bins, including any off-target intronic bins.
- depth: Weighted mean of un-normalized read depths across all this gene’s bins.
- weight: Sum of this gene’s bins’ weights.
- nbins: The number of bins assigned to this gene.
With segments (-s):
- log2: The log2 ratio value of the segment covering the gene, i.e. weighted mean of all bins covered by the whole segment, not just this gene.
- depth, weight, probes: As above.
- seg_weight: The sum of the weights of the bins supporting the segment.
- seg_probes: The number of probes supporting the segment.