<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/methylkit-v0-9-6/"></div></div><div><a data-url="http://www.r-bloggers.com/methylkit-v0-9-6/" data-counturl="http://www.r-bloggers.com/methylkit-v0-9-6/" data-count="horizontal" data-text="methylKit v0.9.6" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://zvfak.blogspot.com/2016/06/methylkit-v096.html"> Recipes, scripts and genomics</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>We released a new version of <a target="_blank" href="https://github.com/al2na/methylKit">methylKit</a>, which is a package for DNA methylation analysis with bisulfite-seq data. This version comes with many changes summarized below. you can also have a look at the<a target="_blank" href="https://github.com/al2na/methylKit/releases/tag/v0.9.6"> release notes</a>. The vignette is now converted to HTML and also lives on <a target="_blank" href="http://rpubs.com/al2na/methylKit">rpubs</a>.</p>
<p>
<h4>Working with large and/or many files</h4>
<p>This turns out to be more and more of a problem. When we first designed methylKit it was tested on RRBS data with couple of million CpGs covered. These days many people have either many RRBS or similar reduced representation sequencing results or a fair amount whole-genome bisulfite sequencing. Due to their size, it may be difficult to work with these kind of samples in-memory. We developed a flatfile database based on “tabix”(<a target="_blank" href="http://www.htslib.org/doc/tabix.html">http://www.htslib.org/doc/tabix.html</a>). This means large objects are written out as tabix files, they are compressed and indexed. We can work with them chunk-by-chunk in a parallelized manner. However, that comes with a cost. It will take time to initially create tabix files but you will be able to work with large data sets without so much of the memory bottleneck. </p>
<p>
<h4>C/C++ based parsing of Bismark SAM/BAM files</h4>
<p>We used to parse sorted Bismark SAM files with a perl script. Now, that script is converted to C/C++ using samtools libraries and Rcpp in the background. This made parsing faster also got rid of a system dependency. <span>processBismarkAln()</span> function is the one where this functionality is implemented. It can parse sorted BAM/SAM files.</p>
<p>
<h4>More differential methylation tests and dealing with covariates</h4>
<p>We added more differential methylation tests. Main improvement is that we can adjust for overdispersion within the logistic regression model. In addition, we can also add covariates such as age and sex into the model and take them into account when testing for differential methylation. We also added a beta-binomial distribution based test by wrapping the functions in the bioconductor DSS package.</p>
<p>
<h4>Methylation profile segmentation </h4>
<p>Regulatory regions can be discovered by analyzing the methylation patterns, segments with low methylation could indicate a regulatory region. We used a segmentation strategy based on change-point analysis, where change points in a signal across the genome is extracted and the genome is segmented to regions between two change points These methods are typically <a target="_blank" href="http://www.ncbi.nlm.nih.gov/pubmed/22302147">used in CNV (copy-number variation) detection</a> but could have applications in methylation context as well.  In the context of methylation, we first extract segments between change points of the signal (methylation profiles) then cluster those segments into groups based on the mean methylation values of the segments. In this case, a segment is a region of the genome where CpGs have similar methylation values. We cluster those segments into segment groups using mixture modeling. This functionality is also mentioned <a target="_blank" href="http://zvfak.blogspot.de/2015/06/segmentation-of-methylation-profiles.html">here</a> in this blog before, now it is a part of the current version.</p>
<h4>Reading processed Bismark files </h4>
<p>Bismark aligner scripts can produce per base methylation files. These files, namely “cytosine report”  and “coverage” files can be read in R using methylKit methRead() function. See <a target="_blank" href="http://www.bioinformatics.bbsrc.ac.uk/projects/bismark/">Bismark manual</a> for details on the files.</p>
<p>
<h4>Function name changes </h4>
<p>The following function names are changed for package wide naming consistency. The old names will continue to work for a while.<br>    – read() to methRead() <br>    – read.bismark to processBismarkAln()<br>    – adjust.methylC() to adjustMethylC()<br>    – get.methylDiff() to getMethylDiff()<br>    – annotate.WithFeature() to annotateWithFeature()<br>    – annotate.WithFeature.Flank() to annotateWithFeatureFlank()<br>    – annotate.WithGenicParts() to annotateWithGenicParts()<br>    – read.bed() to readBed()<br>    – read.feature.flank() to readFeatureFlank()<br>    – read.transcript.features() to readTranscriptFeatures()</p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/methylkit-v0-9-6/"></div></div><div><a data-url="http://www.r-bloggers.com/methylkit-v0-9-6/" data-counturl="http://www.r-bloggers.com/methylkit-v0-9-6/" data-count="vertical" data-text="methylKit v0.9.6" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://zvfak.blogspot.com/2016/06/methylkit-v096.html"> Recipes, scripts and genomics</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/28-RHhnyYw8"></a></div>