This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge two data sets

Hello everyone

I have two RNA seq experiments, one done on tissue and the second one done on cells. I am looking to do cross correlation between the two experiments. I have CSV file for each experiment. I am interested to merge the two files in one CSV file. How I can merge the two files with matching the gene IDs? I am looking to do this step because I am interested to calculated the correlation of gene expression between invitro and invivo.

Thanks for help

rna-seq r

You can read CSV files into R separately, and use the gene IDs as rownames of data frame, then you can use cbind to merge two data frame.

R also has a merge function that is useful, and you can merge by gene ID.

Hello I used merge command, but I got this error message, any help or suggestion

> CP1.df <- read.csv(file.choose(), header = TRUE, sep = ",")
> CP2.df <- read.csv(file.choose(), header = TRUE, sep = ",")
> X=merge(CP1.df,CP2.df)
Error: cannot allocate vector of size 4.9 Gb
In addition: Warning messages:
1: In expand.grid(seq_len(nx), seq_len(ny)) :
  Reached total allocation of 20388Mb: see help(memory.size)
2: In expand.grid(seq_len(nx), seq_len(ny)) :
  Reached total allocation of 20388Mb: see help(memory.size)
3: In expand.grid(seq_len(nx), seq_len(ny)) :
  Reached total allocation of 20388Mb: see help(memory.size)
4: In expand.grid(seq_len(nx), seq_len(ny)) :
  Reached total allocation of 20388Mb: see help(memory.size)
>

I added markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

did you try passing in a by argument to merge

Hello I got the figured out how to solve it, and I am sharing it with you

exporttab <- merge(x=dwd_nogap, y=dwd_gap, by.x='x1', by.y='x2', fill=-9999), and it was very useful.

Do you see why it initially failed, expanding to > 20Gb, though?

0 answers

No answers yet.

Log in to answer this question.