How to get binary data from gene set data?
1
0
Entering edit mode
6.3 years ago
Neu ▴ 10

Hi, I want to melt a geneset data to get binary interactions. How can I get this? I have mentioned below the input and output.

Thank you,

Input:
AANWWTGC_UNKNOWN    4208    481 6095
AAAYRNCTG_UNKNOWN   4052    9842    23047
AAAYWAACM_HFH4_01   4208    161753  3151

Output:
AANWWTGC_UNKNOWN    4208
AANWWTGC_UNKNOWN    481
AANWWTGC_UNKNOWN    6095
AAAYRNCTG_UNKNOWN   4052
AAAYRNCTG_UNKNOWN   9842
AAAYRNCTG_UNKNOWN   23047
AAAYWAACM_HFH4_01   4208
AAAYWAACM_HFH4_02   161753
AAAYWAACM_HFH4_03   3151
RNA-Seq R • 792 views
ADD COMMENT
0
Entering edit mode

Do all the rows of your input have four columns? And are there column names?

ADD REPLY
1
Entering edit mode
6.3 years ago

Try the melt() function in reshape:

MyDataFrame
                 V1   V2     V3    V4
1  AANWWTGC_UNKNOWN 4208    481  6095
2 AAAYRNCTG_UNKNOWN 4052   9842 23047
3 AAAYWAACM_HFH4_01 4208 161753  3151

require(reshape)

melt(MyDataFrame, id.vars=colnames(MyDataFrame)[1])
                 V1 variable  value
1  AANWWTGC_UNKNOWN       V2   4208
2 AAAYRNCTG_UNKNOWN       V2   4052
3 AAAYWAACM_HFH4_01       V2   4208
4  AANWWTGC_UNKNOWN       V3    481
5 AAAYRNCTG_UNKNOWN       V3   9842
6 AAAYWAACM_HFH4_01       V3 161753
7  AANWWTGC_UNKNOWN       V4   6095
8 AAAYRNCTG_UNKNOWN       V4  23047
9 AAAYWAACM_HFH4_01       V4   3151
ADD COMMENT

Login before adding your answer.

Traffic: 2889 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