Question: How to create matrix for larger data set?
1
gravatar for mathavanbioinfo
17 months ago by
India
mathavanbioinfo60 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 • 278 views
ADD COMMENTlink modified 17 months ago by ATpoint45k • written 17 months ago by mathavanbioinfo60
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 17 months ago • written 17 months ago by patelk26140
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: 1868 users visited in the last hour
_