jellyfish K-mer analysis and genome size estimate
So, to estimate manually, take the sum of the counts of unique kmers under the first peak and multiply by 1; add the sum of the counts of unique kmers under the peak at 2x the depth of the first peak and multiply by 2; etc, for all peaks. This will give you the haploid genome size. So if your genome is tetraploid, the actual size will be 1/4 of your result, since the first peak will correspond to mutations present on only 1 ploidy (1/0/0/0 genotype).
You can make this more accurate by modelling the peaks as a sum of Gaussian curves, but that probably won't change the result much. Of course, this method is subjective because calling peaks is subjective.
Please note - I think 17-mers are too short for this kind of analysis. I prefer 31-mers because they are the longest computationally-efficient kmers. Also, FYI, BBNorm is faster than Jellyfish and can also generate kmer-frequency histograms:
khist.sh in=reads.fq hist=khist.txt
Outline
- count k-mer occurence using Jellyfish (jellyfish count)
- summarize as histogram (jellyfish histo)
- plot graph with R
- determine the total number of k-mer analyzed and the peak position
- compare the peak shape with poisson distribution
Count k-mer occurence
In this example we have 5 pair of fastq files in three different subdirectories. The file to process can be specified with "*/*.qf.fastq" and veriied with ls.
$ ls */*.qf.fastq run1/s_1_1_sequence.qf.fastq run2/s_2_2_sequence.qf.fastq run1/s_1_2_sequence.qf.fastq run3/s_1_1_sequence.qf.fastq run2/s_1_1_sequence.qf.fastq run3/s_1_2_sequence.qf.fastq run2/s_1_2_sequence.qf.fastq run3/s_2_1_sequence.qf.fastq run2/s_2_1_sequence.qf.fastq run3/s_2_2_sequence.qf.fastq
Next, we issue the jellyfish count command
jellyfish count -t 8 -C -m 25 -s 5G -o spec1_25mer --min-quality=20 --quality-start=33 */*.qf.fastq
- -t 8
- specifies the number of threads to be used. This value should be equal to the number of cores on the machine or the number of slots you reserved through job management system ($NSLOTS in SGE or UGE).
- -C
- specifies the both strands are considered. If you do not specify this, the apparent depth would be half, --- that is undesirable
- -m 25
- specified that now you are counting for 25 mer (i.e., k=25)
- -s 5G
- is some kind of magical number specification of hash size. This should be as high as the physical memory allows. The higher the faster, but exceeding the available memory leads to failure or extremely slow counting.
- -o spec1_25mer
- specifies the prefix of output file names.
- --quality-start=33
- specified that your fastq file have 33 based quality value string. Be careful on the dataformat. There are cases that your data are 64 based depending on the sequending system and software versions. This is relevant only when you specify --min-quality
- --min-quality=20
- specifies that nucleotide having qv lower than 20 should not included in the count. This selection reduces the k-mers derived from sequence errors and make the peak clearer.
- */*.qf.fastq
- will be expanded to the ten filenames explained above by the shell and passed to jellyfish as input files
summarize as histogram (jellyfish histo)
First confirm that you got the output file
$ ls spec1_25mer* spec1_25mer_0
now that there is a single file spec1_25mer_0
$ jellyfish histo -o spec1_25mer.histo spec1_25mer_0
Confirm that you got the output
$ ls spec1_25mer* spec1_25mer_0 spec1_25mer.histo
Examine the numbers by your eyes
$ head -25 spec1_25mer.histo 1 461938583 2 95606044 3 19280477 4 13836754 5 11018480 6 9555090 7 8557935 8 7863244 9 7319505 10 6920880 11 6589723 12 6321923 13 6148638 14 6036120 15 5972264 16 5962234 17 5987696 18 6051171 19 6154429 20 6297373 21 6485135 22 6700579 23 6932570 24 7217627 25 7533211
terminate called after throwing an instance of 'jellyfish::invertible_hash::ErrorAllocation'
what(): Failed to allocate 628292358736 bytes of memory
jellyfish K-mer analysis and genome size estimate的更多相关文章
- Evaluate|GC content|Phred|BAC|heterozygous single nucleotide polymorphisms|estimate genome size|
(Evaluate):检查reads,可使用比对软件:使用SOAPaligner重新排列:采用massively parallel next-generation sequencing technol ...
- Maximum Size Subarray Sum Equals k -- LeetCode
Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If t ...
- 【LeetCode】325. Maximum Size Subarray Sum Equals k 解题报告 (C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 prefix Sum 日期 题目地址:https:// ...
- The sequence and de novo assembly of the giant panda genome.ppt
sequencing:使用二代测序原因:高通量,短序列 不用长序列原因: 1.算法错误率高 2.长序列测序将嵌合体基因错误积累.嵌合体基因:通过重组由来源与功能不同的基因序列剪接而形成的杂合基因 se ...
- [LeetCode] Longest Substring with At Least K Repeating Characters 至少有K个重复字符的最长子字符串
Find the length of the longest substring T of a given string (consists of lowercase letters only) su ...
- [LeetCode] Kth Largest Element in an Array 数组中第k大的数字
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the so ...
- k近邻算法的Java实现
k近邻算法是机器学习算法中最简单的算法之一,工作原理是:存在一个样本数据集合,即训练样本集,并且样本集中的每个数据都存在标签,即我们知道样本集中每一数据和所属分类的对应关系.输入没有标签的新数据之后, ...
- 6.3Sum && 4Sum [ && K sum ] && 3Sum Closest
3Sum Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find a ...
- 剑指offer系列55---最小的k个数
[题目] 输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,. *[思路]排序,去除k后的数. package com.exe11 ...
随机推荐
- 使用tomcat配置文件下载服务器,自定义下载列表
先上图,利用tomcat,这个下载界面没有代码,点击文件名即可下载 详细参考:http://tomcat.apache.org/tomcat-7.0-doc/default-servlet.html
- jquery 字数限制
$("#TextArea1").keydown(function(){ 10 var curLength=$("#TextArea1").val().lengt ...
- S1 : 函数
一.做为值的函数 例如,假设有一个对象数组,我们想要根据某个对象属性对数组进行排序.而传递给数组sort()方法的比较函数要接收两个参数,即要比较的值.可是,我们需要一种方式来指明按照哪个属性来排序. ...
- 各种常用函数 (SQL)
数学函数 1.绝对值 S:select abs(-1) value O:select abs(-1) value from dual 2.取整(大) S:select ceiling(-1.001 ...
- 2.精通前端系列技术之seajs和gruntJs结合开发(三)
1.我们先来了解下模块化历史 模块化历史 nodeJS的出现(http://nodejs.org/) commonJS规范(http://www.commonjs.org/) 浏览器JS的模块化? A ...
- (DFS)hdoj1175:连连看
题目链接 这道题被稍微改编当作过去年的期末上机题,也被直接放到了这次这一届的第二次练习赛.当初刚看到这道题时DFS并没有系统的学过,做起来极其费劲.现在学过之后开始实践练习,发现这道题真的是很水. 我 ...
- Deep Learning 初识
实际生活中,人们为了解决一个问题,如对象的分类(对象可是是文档.图像等),首先必须做的事情是如何来表达一个对象,即必须抽取一些特征来表示一个对象,如文本的处理中,常常用词**来表示一个文档,或把文档表 ...
- SQlServer 从系统表 sysobjects 中获取数据库中所有表或存储过程等对象
[sysobjects] 一.概述 系统对象表. 保存当前数据库的对象,如约束.默认值.日志.规则.存储过程等,该表中包含该数据库中的表 存储过程 视图等所有对象 在sqlserver2005,sql ...
- 多线程第一次亲密接触 CreateThread与_beginthreadex本质区别
本文将带领你与多线程作第一次亲密接触,并深入分析CreateThread与_beginthreadex的本质区别,相信阅读本文后你能轻松的使用多线程并能流畅准确的回答CreateThread与_beg ...
- Apache Qpid Python 1.35.0 发布
Apache Qpid Python 1.35.0 发布了,Apache Qpid (Open Source AMQP Messaging) 是一个跨平台的企业通讯解决方案,实现了高级消息队列协议.提 ...