NGS中根据比对覆盖度推测性别

 

001、计算所有位点覆盖度

samtools depth -@ 8 sample.bam > sample.depth  ## 利用samtools计算所有比对位点的覆盖度

 

002、计算性染色体相对覆盖度

awk '{t_sum += $3; if($1 == "chrX") {x_sum += $3}; if($1 == "chrY") {y_sum += $3}} END {x_cov = x_sum/length_chrX; y_cov = y_sum/length_chrY; t_cov = t_sum/length_whole_genome; print x_cov, y_cov, t_cov, x_cov/t_cov, y_cov/t_cov}' sample.depth > sample_relative_coverage.txt

 

posted @ 2025-03-27 09:51  小鲨鱼2018  阅读(16)  评论(0)    收藏  举报