Articles by Xianjun Dong

PCA plot with fill, color, and shape all together

September 25, 2018 | Xianjun Dong

When I plotted the PCA results (e.g. scatter plot for PC1 and PC2) and was about to annotate the dataset with different covariates (e.g. gender, diagnosis, and ethic group), I noticed that it's not straightforward to annotate __2 covariates at the same time using ggplot. Here is what works ... [Read more...]

Best way to draw heatmap for publication

July 8, 2016 | Xianjun Dong

Here are two tips I can share if you were also working on a big dataset towards a high quality heatmap:1. Don't generate PDF using pheatmap() or heatmap.2() as (i) the file is unnecessarily SUPER large if you have a lot of data points in the heatmap, s... [Read more...]

Best way to draw heatmap for publication

July 8, 2016 | Xianjun Dong

Here are two tips I can share if you were also working on a big dataset towards a high quality heatmap:1. Don't generate PDF using pheatmap() or heatmap.2() as (i) the file is unnecessarily SUPER large if you have a lot of data points in the heatmap, so that you ... [Read more...]

My 15 practical tips for a bioinformatician

February 16, 2016 | Xianjun Dong

Tips below are based on the lessons I learnt from making mistakes during my years of research. It's purely personal opinion. Order doesn't mean anything. If you think I should include something else, please comment below.Always set a seed number when y...
[Read more...]

My 15 practical tips for a bioinformatician

February 16, 2016 | Xianjun Dong

Tips below are based on the lessons I learnt from making mistakes during my years of research. It's purely personal opinion. Order doesn't mean anything. If you think I should include something else, please comment below. Always set a seed number when you run tools with random option, e.g. ...
[Read more...]

Calculate the odd of winning Powerball in R

January 12, 2016 | Xianjun Dong

This Wednesday’s Powerball grand prize already climbed up to $1.5 BILLION. If you choose to cash out, it would be $930 million. And it keeps increasing…So, what’s the odd of winning the jackpot prize?Here is the game rule according to Powerball.com:…we draw five white balls out ... [Read more...]

Calculate the odd of winning Powerball in R

January 12, 2016 | Xianjun Dong

This Wednesday’s Powerball grand prize already climbed up to $1.5 BILLION. If you choose to cash out, it would be $930 million. And it keeps increasing… So, what’s the odd of winning the jackpot prize? Here is the game rule according to Powerball... [Read more...]

My note on multiple testing

December 4, 2015 | Xianjun Dong

It's not a shame to put a note on something (probably) everyone knows and you thought you know but actually you are not 100% sure. Multiple testing is such a piece in my knowledge map.Some terms first:- Type I error (false positive) and Type II error (false negative): When ... [Read more...]

My note on multiple testing

December 4, 2015 | Xianjun Dong

It's not a shame to put a note on something (probably) everyone knows and you thought you know but actually you are not 100% sure. Multiple testing is such a piece in my knowledge map.Some terms first:- Type I error (false positive) and Type II error (false negative): When ... [Read more...]

X11 connection error in Mac

March 11, 2015 | Xianjun Dong

Typically, I log into my remote server/cluster via "ssh -X" and from there launch R program for plotting. But it always shows an error asunable to open connection to X11 display ''after a while, when you want to call functions such as plot(). This is very annoying. So that ... [Read more...]

reshape: from long to wide format

February 26, 2015 | Xianjun Dong

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 ... [Read more...]
1 2 3

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)