Boston's Temperature Chart

At the end of January I will be moving to Boston. I will start my post-doc at the Boston Children’s Hospital. So… I started looking to weather and temperature conditions. I used Weather Underground to download a weatehr tamble for each month in 2016 and 2017. The aim is to create a plot with everyday mínimum and maximum temperature along all 2017. Also a heat-map indicating the weather condition of each day of the year.

Christmas Card 2017 - 2018

It is the time to follow the tradition of creating a geek christmas card. As I did last year, the one for this year is typed it in javascript. It is much simpler compared to the game of the 2016 Christmas, but I enjoyed coding it. Merry Christmas 2017-2018 The card is a HTML5 canvas used as a grid where different pixelled cartoons appears being drawn pixel-a-pixel. I have coded five different patterns.

minfi betas and residuals from methylation models

In the HELIX project we decided to use residuals instead of M values for the methylation analyses. So, how we get the residuals of a basic lineal model? Libraries and Data First of all we load the libraries we will use in this test: library( limma ) # We use lmFit to fit the lineal model library( minfi ) # Methylation data is saved as a GenomicRatioSet library( SmartSVA ) # We want to compute the SVA to correct methylation data library( isva ) # " library( Biobase ) # We will sabe the residuals in an ExpressionSet Once the libraries are loaded we proceed to obtain the methylation data:

Exploring public NHANES data using Rcupcake

The Rcupcake package contains functions to query different databases through the BD2K RESTful API. BD2K RESTful API is an interface that provides access to different data sources, making easier data accessibility, analysis reproducibility and scalability. The package is installed via devtools using it’s GitHub URL (hms-dbmi/Rcupcake) library( Rcupcake ) Rcupcake package follows a four-step process to retrieve the data from a database: Start session Select the variables of interest Build the JSON query Run the query to obtain the data The start.

Cross-referencing between different files with LaTeX

Sometimes I want to refer labels I placed in external .tex files. I mean, I want o refer (using the command \ref) a \label from a .tex file I created in another project. A valid solution it to use the command \include. But I in this case I don’t want to include the .tex, I only want to be able to refer their labels. This can be done using the xr package.

Change the title of Table of Contents (ToC) in LaTeX

The steps to change the title of the table of contents (ToC) depends on if you are using the babel package or not. Without babel The title of the table of contents can be changed using the command \contentsname. Let’s see a small example: \documentclass{article} \renewcommand{\contentsname}{Index} % ToC will show "Index" instead of "Content" \begin{document} \tableofcontents \section{Section} \subsection{Subsection} \end{document} With babel When using babel package the name of the table of contents needs to be changed for the particular language used with babel.

Getting docker virtual environment IP in Windows 10

Docker is a full development platform for creating containerized apps. It is a platform available for Windows, GNU/Linux and MAC here. Unfortunately, for Windows users, the docker version you can get depends on the Windows you are running. Windows Docker Access Windows Home Docker Toolbox link Windows Pro Docket link This is because Windows Home systems goes without Hyper-V.

Comparing 'user' Internet connection from some Catalan research centers

Using the same technique seen in the old post “Comparing ping time between connections” I asked some colleges to run the following command in their research centers. ping -c 200 > ping_google.txt So, I load the multiple ping-files to create a data.frame with the icmp_seq number, the time spend per ping and the institution where the ping was promoted. ping <- lapply( files, function( file ) { dta <- read.

From Barcelona to Boston in R

Today I am traveling to Boston to attend the BioC 2017: Where Software and Biology Connect. In this trip to Boston, I stop in Lisbon to take the transoceanic flight. Let’s see a map Boston-Barcelona “centered” using the package maps: library( maps ) xlim <- c( -140, 20 ) ylim <- c( 25, 50 ) map( "world", lwd = 0.75, xlim = xlim, ylim = ylim ) Map showing Spain and USA

Comparing ping time between connections

To perform this test I ping 200 times Google from my PC at ISGlobal (running Linux Mint in a Virtual Machine) and from my laptop (running native Ubuntu). I saved the output in two TXT files with a command like the following one: ping -c 200 > ping_google_work_wifi.txt I processed both files in R to create a data.frame. pwm <- read.delim( file1, nrows = 200, skip = 1, header = FALSE, sep = " ", stringsAsFactors = FALSE ) pwm <- pwm[ , c( 6, 8 ) ] colnames( pwm ) <- c( "icmp_seq", "time" ) pwm$icmp_seq <- as.