如何划窗统计测序数据的reads数(depth):https://blog.csdn.net/shenshenwu666/article/details/80936374

方法1,用samtools depth。但是这个方法仅仅局限于对单个位点进行depth进行统计

samtools depth -b bed_file sample.bam > sample.depth

bed 用来指定统计区间,运行后输出指定区间每一个碱基的测序深度(由于涉及所有碱基,因此文件很大)

方法2,用samtools bedcov方法。

samtools bedcov bed_file samplename.bam > sample.bedcov

输出的文件中计算了bed文件每一个区间的碱基总数,这里并不是reads的条数

方法3,bedtools软件。。需要使用滑动窗口来对区间进行统计,这样可以观察在整条染色体上测序深度的变化趋势:

1). bedtools makewindows -g genome.txt -w 10000000 -s 1000000 > windows.bed

#bedtools makewindows用来自动生成划窗区间。-g genome.txt是要划分的基因组,格式为两列:染色体、染色体长度;-w 10000000为窗口大小为10M;-s 1000000为步长为1M,即窗口在染色体上每次向右平移1M的距离;windows.bed为输出文件,格式为三列:染色体、区间开始位点、区间结束位点。

2). bedtools coverage -a windows.bed -b xxx.sort.bam > xxx.depth.txt

#bedtools coverage对划分好的每个滑动窗口进行reads数(depth)的统计。-a windows为上一步划分好的区间;-b xxx.sort.bam为测序数据mapping到参考基因组的比对文件;xxx.depth.txt为统计结果的输出文件,格式为7列:染色体、区间起始位点、区间结束位点、该区间内的reads数、该区间内的碱基数、区间大小、该区间的平均覆盖度。

#关于xxx.sort.bam文件的几点说明:

1. 一般将测序数据mapping到参考基因组之后的输出文件为sam文件格式,需要先用samtools view -bS xxx.sam > xxx.bam转换为bam格式

2.xxx.bam还需要进行排序和建立索引才能用于后续的统计:

samtools sort xxx.bam xxx.sort   ##输出结果为xxx.sort.bam

samtools index xxx.sort.bam      ##输出结果为xxx.sort.bam.bai
---------------------
作者:wu伸伸
来源:CSDN
原文:https://blog.csdn.net/shenshenwu666/article/details/80936374

方法4,https://www.jianshu.com/p/82ed6e27f571

方法5, GATK软件

java -Xmx30g -XX:ParallelGCThreads=6 -jar /opt/GenomeAnalysisTK.jar -T DepthOfCoverage -R /path/genome.fna -I /path/sample.bam -o /path/sample.DepthOfCoverage -nt 10 -ct 5 -ct 1 -ct 10 -ct 30 -ct 50 --omitDepthOutputAtEachBase --omitIntervalStatistics --omitLocusTable

使用DepthOfCoverage模块统计测序深度和覆盖度。与samtools depth 一样,统计每个碱基的测序深度。 -ct指定统计测序深度的阈值,如 -ct 1 统计测序深度为1 的碱基占比。

https://mp.weixin.qq.com/s/7KiXyvKgQ35wHfEiDLvLyQ

GCdepth散点图绘制:

https://blog.csdn.net/huangliangbo0805/article/details/51165943?utm_source=blogxgwz2

滑窗口统计基因组GC含量的分布:

https://blog.csdn.net/hugolee123/article/details/38441927?utm_source=blogxgwz1

求Read Depth的更多相关文章

  1. POJ 1330 Nearest Common Ancestors / UVALive 2525 Nearest Common Ancestors (最近公共祖先LCA)

    POJ 1330 Nearest Common Ancestors / UVALive 2525 Nearest Common Ancestors (最近公共祖先LCA) Description A ...

  2. 【BZOJ4573】[ZJOI2016] 大森林(LCT)

    点此看题面 大致题意: 有\(n\)棵树,初始各有\(1\)个编号为\(1\)的节点,且其为生长节点.\(3\)种操作:将\([l,r]\)区间内的树增加一个新的编号的节点,修改\([l,r]\)区间 ...

  3. 【LNOI 2014】 LCA

    [题目链接] 点击打开链接 [算法] 考虑求lca(x,y)的深度 我们可以将从根到x路径上的点都打上标记,然后,询问y到根上路径的权值和 那么,求sigma(depth(lca(i,z)))(l & ...

  4. 线段树&数链剖分

    傻逼线段树,傻逼数剖 线段树 定义: 线段树是一种二叉搜索树,与区间树相似,它将一个区间划分成一些单元区间,每个单元区间对应线段树中的一个叶结点. 使用线段树可以快速的查找某一个节点在若干条线段中出现 ...

  5. 瘋子C++笔记

    瘋耔C++笔记 欢迎关注瘋耔新浪微博:http://weibo.com/cpjphone 参考:C++程序设计(谭浩强) 参考:http://c.biancheng.net/cpp/biancheng ...

  6. 【easy】104. Maximum Depth of Binary Tree 求二叉树的最大深度

    求二叉树的最大深度 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; ...

  7. LeetCode Maximum Depth of Binary Tree (求树的深度)

    题意:给一棵二叉树,求其深度. 思路:递归比较简洁,先求左子树深度,再求右子树深度,比较其结果,返回:max_one+1. /** * Definition for a binary tree nod ...

  8. leetcode 104 Maximum Depth of Binary Tree二叉树求深度

    Maximum Depth of Binary Tree Total Accepted: 63668 Total Submissions: 141121 My Submissions Question ...

  9. 【easy】111. Minimum Depth of Binary Tree求二叉树的最小深度

    求二叉树的最小深度: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; ...

随机推荐

  1. svn 同步资源库时忽略某些文件类型和文件夹

    项目开发中,开发人员经常用SVN来管理代码,在和服务器同步时,每次都看到一堆.class,.log,target等文件,这样很不舒服. 解决方法: 打开:window-->preferences ...

  2. 浅谈maven中的scope,systempath

    scope  maven中scope的默认值是compile scope的分类 1)compile 默认是compile.compile表示被依赖项目需要参与当前项目的编译,包括后续的测试,运行周期也 ...

  3. LeetCode题解之Find the Difference

    1.题目描述 2.题目分析 比较两个字符串中加入的一个字符,由于可能在字符串中加入一个已经存在的字符,因此使用hash table 去统计字符个数最好. 3.代码 char findTheDiffer ...

  4. Swiper-轮播图。

    Swiper(Swiper master)是目前应用较广泛的移动端网页触摸内容滑动js插件,可以用来做轮播和滑动. 初始化 <!DOCTYPE html> <html> < ...

  5. Oracle EBS 应收API只创建收款没有核销行以及消息堆栈

    只创建了收款但没有创建核销行 排除其他原因 有可能是缓存溢出导致的这个要改成true 且使用消息堆栈处理

  6. nodejs+redis使用

    安装 linux安装及配置之前写过了http://www.cnblogs.com/zycbloger/p/6226682.html windows安装 下载地址:https://github.com/ ...

  7. [翻译] CNPPopupController

    CNPPopupController CNPPopupController is a simple and versatile class for presenting a custom popup ...

  8. Python学习---IO的异步[twisted模块]

    安装twisted模块 Linux: pip3 install twisted Window: a. http://www.lfd.uci.edu/~gohlke/pythonlibs/#twiste ...

  9. Error creating bean with name xxxx,xxxx must be provided

    原因: 继承父类的bean注入是set,get方法 问题: 自己的controller不能创建,因为需要的bean没有创建 解决方法: bean 注入,通过构造函数调用父类的set方法

  10. HTTP 错误 404.3 - Not Found的问题(WCF)

    模块 StaticFileModule 通知 ExecuteRequestHandler 处理程序 StaticFile 错误代码 0x80070032 请求的 URL http://10.101.3 ...