Merging files with gene expression data
Entering edit mode
BioinfGuru ▴ 30
Last seen 2 days ago

Hi all,

This seemed like such an easy task, yet I am boggled.


I have:

28 files: each named n.txt , where n is a type of tissue (e.g. cortex.txt, heart.txt)

Each file contains 2 columns and the column headers are gene name (column 1) and log2rpkm (column 2)

Each file contains around 30-40k rows


I need:

To merge the files into one file with 29 columns

Headers: genename, tissue1, tissue2, tissue3, etc.... to tissue28

So that each row contains one gene and its expression value in the 28 tissues.

With that I can convert it to a matrix in R and quantile normalise it for tissue specificity calculations


Thanks in advance for your help,




merge rnaseq files • 2.0k views
Entering edit mode
Last seen 7.8 years ago

I think you likely are looking for the merge function.  Much like Cbind it can bind by columns.  Unlike that it matches them based on matching values (so if in one file the APC gene is like 2 and in the other it is like 400 it can figure that out).

The function information is here:


Login before adding your answer.

Traffic: 1306 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6