Question: How to create matrix for larger data set?
1
gravatar for mathavanbioinfo
3 months ago by
India
mathavanbioinfo50 wrote:

Dear All, I have an excel file containing two attributes genesA and genesB , the entity in the first attribute interacts with the second. attribute. the attribute size 10000 rows, I want to create a matrix contain the boolean values [0,1] genesA as rows and genesB as a column. please hit the link below

enter image description here enter image description here

rna-seq matrix • 107 views
ADD COMMENTlink modified 3 months ago by ATpoint28k • written 3 months ago by mathavanbioinfo50
1

This can be done in R.

library(readxl)
library(dplyr)

df <- read_excel('data.xlsx') # reading in your data

df %>%
  gather(key = 'genesB', value, -c(genesA)) %>%
  filter(value > 0) %>%
  select(genesA, genesB) %>%
  rename(Protein.B = genesB)
ADD REPLYlink modified 3 months ago • written 3 months ago by patelk26100
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 916 users visited in the last hour