R

R programming language

Beginner R: functions that make your life easier

Let’s get to know my top 10 R’s neat little functions and tricks that make our life easier when manipulating data in R. Sequences Want to make long sequences of numbers or letters but don’t feel like writing them all out into a vector? R let’s you make a sequence with “:” for numbers. You can also use seq() if you are looking for a regular sequence that is not incremented by one. letters[] let’s you make continuous letter sequences, [...]

By | 2016-11-08T09:30:07+00:00 January 28, 2016|Categories: Bioinformatics, R|0 Comments

Applying PCA to Leucegene data

GEO offers an extremely rich source of transcriptional profile data, but downloading and preparing a dataset is often an obstacle to aspiring bioinformaticians. I'll walk you through one way to do it using the Leucegene dataset as an example. Once this data is loaded and ready to use in R, I'll then present a very simplified and practical perspective on the use of PCA for exploratory analysis. Loading data A dataset of 285 transcriptional profiles of acute myeloid leukemia (AML) [...]

By | 2016-11-08T09:30:08+00:00 November 17, 2015|Categories: Data Analysis, R|0 Comments

Formatting data for Circos with R

When generating a Circos plot, the formatting of the data to be represented is a crucial step. Here are some pointers on how to avoid the dreadful *** CIRCOS ERROR ***. All data files must be in text format. For instance, using R, I would generate a myData.txt file that I would then call within a specific plot block (<plot>...</plot>). Data files are used for 2-dimensional graphical representations (histogram, scatter plot, heatmap, tiles), labels (which are technically also a type [...]

By | 2016-11-08T09:30:09+00:00 October 29, 2015|Categories: Circos, Data Visualization, R|0 Comments

Permutations

Say we have the two following groups : g1 <- c(55, 65, 58) g2 <- c(12, 18, 32) We want to see if the two groups belong to the same distribution or can be considered as different groups. We might be tempted to try a Student’s t-test. t.test(g1, g2) ## Welch Two Sample t-test ## ## data: g1 and g2 ## t = 5.8366, df = 2.9412, p-value = 0.01059 ## alternative hypothesis: true difference in means is not equal [...]

By | 2016-11-08T09:30:09+00:00 October 14, 2015|Categories: Data Analysis, R, Statistics|0 Comments

Don’t ignore the warnings!

I'm sure that all of you R users have now noticed that sometimes R is talking to you. When you do something wrong, R replies with a message written in red in the console. How many of you actually read those error messages? If you take the time to read them carefully, you'll get a hint about what was wrong in your command. Let's look at an example: > sum(c('1','3','4','4')) Error in sum(c("1", "3", "4", "4")) : invalid 'type' (character) [...]

By | 2016-11-08T09:30:10+00:00 September 3, 2015|Categories: R, Statistics|0 Comments