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 |2017-04-29T15:36:21+00:00October 29, 2015|Categories: Data Visualization, R|Tags: , , |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 |2017-04-30T10:15:37+00:00October 14, 2015|Categories: Data Analysis, R, Statistics|0 Comments

Working with large files

When dealing with Next Generation Sequencing data, I am routinely asked by clients how to open sequence files. The answer is that given their huge size (often many million lines) and the consequent requirement in memory, they should probably not be opened in any way, they should only be processed. Most software designed to work with NGS data will then process these files in a sequential fashion or stream, loading just the required amount of data from disk, processing it [...]

By |2022-06-09T12:35:12+00:00October 1, 2015|Categories: Data Analysis, Shell scripting|Tags: , |1 Comment

[Python] Iterators vs Generators

In Python, there are iterators and generators. You probably already use iterators without even knowing that you do so. But understanding the difference between those two concepts is really important since choosing one over the other has a huge impact on memory usage. If you are working with small datasets, memory usage might not be your first concern. However, with big datasets, it is another story. So what are they exactly, iterators and generators? Iterators The process of going through [...]

By |2017-04-29T15:37:35+00:00September 18, 2015|Categories: Performance, Python|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 |2017-04-30T16:25:19+00:00September 3, 2015|Categories: R, Statistics|0 Comments
Go to Top