Publications by Xianjun Dong
counts numbers in a interval
Say I have a list of values, and I cut them by some break points, how do I know the number of values in each interval?We know cut() function in R works for the purpose. For example,tx0 <- c(9, 4, 6, 5, 3, 10, 5, 3, 5) x <- rep(0:8, tx0) > x [1] 0 0 0 0 0 0 0 0 0 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 4 4 4 5 5 5 5 5 5 5 5 5 5 6 [39] 6 6 6 ...
638 sym R (1369 sym/2 pcs)
methods of calling differential region of ChIP-seq
Related papers to read:Model-based Analysis of ChIP-Seq (MACS)MACS can also be applied to differential binding between two conditions by treating one of the samples as the control. Since peaks from either sample are likely to be biologically meaningful in this case, we cannot use a sample swap to calculate FDR, and the data quality of...
4029 sym 1 tbl
Google Developers R Programming Video Lectures
I got this Google Developers R Programming Video Lectures from Stephen’s blog – Getting Genetics Done.Very useful R tutorial for beginner! Short and efficient. Here is what I learned after watching the lectures:4.3 – Add a Warning or Stop the Function Executionstop() and warning() functionI was asked this question during a job ...
1751 sym
R / Bioconductor for High-Throughput Sequence Analysis
I would like to recommend a recent workshop material on R/Bioconductor from Marc Carlson et al.http://www.bioconductor.org/help/course-materials/2013/SeattleMay2013/PDF: IntermediateSequenceAnalysis2013.pdfR script: IntermediateSequenceAnalysis2013.RHere is the TOC list if you want to read more (highlight for suggested reading list):...
9707 sym
How to see source code of a function/method in R?
If it’s an internal function of R (e.g. from base package), just type the function name, like> rowMeansfunction (x, na.rm = FALSE, dims = 1L) { if (is.data.frame(x)) x if (!is.array(x) || length(dn stop(“‘x’ must be an array of at least two dimensions”) if (dims < 1L || dims > length...
3158 sym
Access Google Spreadsheet directly in bash and in R
Google Doc is a good way to share/manage documents between you and your colleagues, but sometime you want to directly access the data in terminal (e.g. bash) or in program (e.g. R), without downloading the data first. For example, I have a Google Spreadsheet here:https://docs.google.com/spreadsheet/ccc?key=0At2sqNEgxTf3dEt5SXBTemZZM1...
1679 sym
reshape2: convert table from wide to long format
I found this elegant note about reshape2 from Sean Anderson’s blog:http://seananderson.ca/2013/10/19/reshape.htmlBasically,reshape2 is based around two key functions: melt and cast:melt takes wide-format data and melts it into long-format data.cast takes long-format data and casts it into wide-format data.For example, this is wide f...
2524 sym
vennpieR: combination of venn diagram and pie chart in R
I was wondering how to draw a venn diagram like pie chart in R, to show the distribution of my RNA-seq reads mapped onto different annotation regions (e.g. intergenic, intron, exons etc.). A google search returns several options, including the nice one from Xiaopeng’s bam2x (see below). However, he told me it’s not released yet. A...
945 sym 6 img
How to draw venn pie-agram (multi-layer pie chart) in R?
I was wondering how to draw a venn diagram like pie chart in R, to show the distribution of my RNA-seq reads mapped onto different annotation regions (e.g. intergenic, intron, exons etc.). A google search returns several options, including the nice one from Xiaopeng’s bam2x (see below). However, he told me it’s not released yet. And it’s ja...
933 sym 6 img
reshape: from long to wide format
This is to continue on the topic of using the melt/cast functions in reshape to convert between long and wide format of data frame. Here is the example I found helpful in generating covariate table required for PEER (or Matrix_eQTL) analysis:Here is my original covariate table:Let’s say we need to convert the categorical variables ...
1357 sym 4 img