Articles by Xianjun Dong

Making Art in R

October 15, 2018 | 0 Comments

Amazing artworks people made in R:See their source code and more arts at:http://www.r-graph-gallery.com/286-antonio-sanchez-dataart/
[Read more...]

PCA plot with fill, color, and shape all together

September 25, 2018 | 0 Comments

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...]

Download all KEGG pathway KGML files for SPIA analysis

June 8, 2018 | 0 Comments

Most people know KEGG pathway, but not everyone knows that it costs at least $2000 to subscribe its database. If you want to save the cost a bit, you can manually download the KEGG pathway KGML files and install in SPIA. Here I have a workaround to dow... [Read more...]

Best way to draw heatmap for publication

July 8, 2016 | 0 Comments

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 | 0 Comments

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 | 0 Comments

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 | 0 Comments

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 | 0 Comments

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 | 0 Comments

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 | 0 Comments

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 | 0 Comments

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...]

How to correctly set color in the image() function?

May 15, 2015 | 0 Comments

Sometimes we want to make our own heatmap using image() function. I recently found it's tricky to set the color option there, as its manual has very little information on col:cola list of colors such as that generated by rainbow, heat.colors,... [Read more...]

Tips and Tools you may need for working on BIG data

May 8, 2015 | 0 Comments

Nowadays everyone is talking about big data. As a genomic scientist, I could feel hungry of a collection of tools more specialized for the mediate-to-big data we deal everyday.Here are some tips I found useful when getting, processing or visualizing la... [Read more...]

X11 connection error in Mac

March 11, 2015 | 0 Comments

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 | 0 Comments

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...]

vennpieR: combination of venn diagram and pie chart in R

September 25, 2014 | 0 Comments

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, ... [Read more...]

How to draw venn pie-agram (multi-layer pie chart) in R?

September 25, 2014 | 0 Comments

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

reshape2: convert table from wide to long format

July 15, 2014 | 0 Comments

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 tak... [Read more...]

Access Google Spreadsheet directly in bash and in R

January 31, 2014 | 0 Comments

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 Spre... [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)