How to create matrix for larger data set?
0
1
Entering edit mode
5.2 years ago

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

matrix RNA-Seq • 897 views
ADD COMMENT
1
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 2034 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6