Biostar Beta. Not for public use.
How to get binary data from gene set data?
0
Entering edit mode
15 months ago
Neu • 10
India

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 • 332 views
ADD COMMENTlink
0
Entering edit mode

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

ADD REPLYlink
1
Entering edit mode
13 months ago
Republic of Ireland

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 COMMENTlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1