Articles by fabiomarroni

Nice tables in R

March 4, 2020 | fabiomarroni

I used to think that making nice table in R is not worth the effort. However, after changing my mind for the billionth time on relatively large tables for a paper and do not wanting to reformat them again from scratch, I gave a try to the formattable package, and ...
[Read more...]

Visualize KEGG pathway and fold enrichment

November 14, 2017 | fabiomarroni

As a useful note to self, I paste here an easy example on the use of the pathview package by Weijun Luo to plot the log fold change of gene expression across a given KEGG pathway. This example is on Vitis vinifera (as the prefix vvi can suggest), but the ... [Read more...]

Reading large data tables in R

May 2, 2014 | fabiomarroni

Ok, I confess. Until yesterday I was one of those still trying to read large data tables using read.table. Then, I came across this thread in stackoverflow and I saw the light. Since I noticed that a lot of people still struggle with read.table I decided to write ... [Read more...]

R and theater

June 3, 2012 | fabiomarroni

You might ask what R has to do with theater. I assure you it has. I act in the theater group ‘ndescenze. We will soon present (actually, we just performed) a show based on the Marx Brothers Radio Shows. We shuffle actors and characters during the show (we like it ... [Read more...]

Introduction to R (Milano R course)

May 25, 2012 | fabiomarroni

I am happy to repost the information I got about the course “Introduction to R” that will be organized by Milano R net in collaboration with Quantide. The course will be held in Milano, Italy, June 7-8, 2012, and is intended to introduce the unexperienced user to R. For furhter info ... [Read more...]

Milano R net meeting

April 24, 2012 | fabiomarroni

I received the announce of the first Milano R net meeting, and I am glad to post it below. If you are based in Milano area you might think about going. If you are not based in Milano area, you might think about going as well! Milano R net Milano ... [Read more...]

Estimate decay of linkage disequilibrium with distance

August 9, 2011 | fabiomarroni

It is well known that linkage disequilibrium (LD) decays with distance. Several functions have been proposed to estimate such decay. Among the most widely used are the Hill and Weir (1) formula for describing the decay of r2 and a formula proposed by Abecasis (2) for describing the decay of D’. I ... [Read more...]

For happy-R blogging

May 3, 2011 | fabiomarroni

You may notice that I don’t have that many posts on my blog, and they are all about R. The paucity of my posts makes me a bit sad, but not much, really… What makes (or better, used to make me) sad is that posts of R code (used ... [Read more...]

Estimate Gene Diversity

May 3, 2011 | fabiomarroni

I provide here an R function to estimate gene diversity of diallelic sites (e.g. SNPs), given allele frequencies at each segregating site. The function takes three input parameters: maf: a numeric value (or vector) representing minor allele frequency at each site. Default is 0.5 nreads: size of each resampling experiment. ... [Read more...]

R function to convert degrees to radians

December 23, 2010 | fabiomarroni

I would have never imagined that I would have to go back to high school concepts and do strange trigonometric calculations. However, it happened to me that I needed to convert GPS coordinates of a large data set to radians. It’s a trivial task, if you know how to ... [Read more...]

R function to reverse and complement a DNA sequence

November 13, 2008 | fabiomarroni

Warning!! This post is intended for documentation only. I would like to remind everyone (me in first place!) that the comp() function of the (seqinr) package can complement a DNA sequence, and rev() function of Rbase can reverse a character vector. Using a combination of the two you can reverse, ... [Read more...]