'Extract individual genes from modules in WGCNA

I've got the following MEs file after performing WGCNA on genes.

structure(list(MEdarkturquoise = -0.126475329197849, MEtan = -0.233526198026173, 
    MEdarkgrey = -0.086222455739712, MEsalmon = 0.0096490189937994, 
    MEviolet = -0.074214462874189, MEdarkolivegreen = 0.0351479764276791, 
    MEdarkred = 0.0669868352219114, MEskyblue = 0.0952261185132281, 
    MEskyblue3 = 0.135145582896583, MEsteelblue = 0.11287454763798, 
    MEmidnightblue = 0.0651813145953543, MEcyan = 0.209007602108883, 
    MEsienna3 = 0.44443648889449, MEyellowgreen = -0.103085026146051, 
    MElightcyan = -0.031750256452673, MEorange = -0.0126799698551899, 
    MEblack = -0.0634155967712594, MEdarkmagenta = 0.0211453409000538, 
    MEdarkorange = -0.00210726593791533, MEwhite = 0.133020812016434, 
    MEblue = -0.197746247022991, MEgrey60 = -0.0996015659492354, 
    MEdarkgreen = -0.0916627743675571, MEred = -0.0309829945285656, 
    MEgrey = 0.152772139607461), row.names = "TCGA.02.0054.01", class = "data.frame")
> dput(MEs[1:25,])
structure(list(MEdarkturquoise = c(-0.126482404651362, 0.00859685106988051, 
-0.139119978025995, -0.121760256216002, -0.114050357589663, -0.16158166178197, 
-0.169089521235389, 0.134388350128016, -0.128728040505512, 0.0933639502568886, 
-0.116285533417, -0.0715164710720025, -0.050281653395796, -0.0712583935347317, 
-0.116848802717176, -0.1394796603133, -0.131958454866075, -0.167862157710569, 
0.0781961256653059, -0.0874083890994826, -0.142602528126273, 
-0.132749359004561, 0.0530754944359762, -0.112556115187184, -0.126475329197849
), MEtan = c(-0.167883113654055, -0.0109845487812259, -0.246272322275879, 
-0.155118397135028, -0.187094786264526, -0.208897816323153, 0.00918849047141923, 
0.0660987731811726, -0.179682091342798, 0.0361927428937938, -0.168337427405039, 
-0.0872997940891031, 0.0487147246178567, -0.104997421215032, 
-0.166612765418889, -0.27972731849213, -0.269614736192796, -0.218686589132102, 
0.0186266000013494, -0.115752853428279, -0.234180322169165, -0.234468472122879, 
0.0853896953163215, -0.119401273395233, -0.233526198026173), 
    MEdarkgrey = c(-0.100329095271737, -0.0784894235648148, -0.0879486442773462, 
    -0.0995049018784005, -0.0714818317916746, -0.0976149187829668, 
    0.159506068630208, -0.0078547447048395, -0.0919187341851776, 
    -0.0183352208123751, -0.0802716031327569, -0.0921892597579533, 
    0.122475915845315, -0.105142453664124, -0.107464669408259, 
    -0.0838230654624859, -0.0643026477240475, -0.0991970944971272, 
    -0.0299497021490766, -0.0925869123215248, -0.0801263954108516, 
    -0.0801822804978344, 0.0483614999202892, -0.113020942570186, 
    -0.086222455739712), MEsalmon = c(-0.0358095654745313, -0.0534749789951331, 
    0.00945930449870025, -0.0402326557250527, 0.0141791776591814, 
    -0.0193044312130539, 0.0176549615193692, 0.0196918377830713, 
    -0.0161165396744247, 0.0489395668597594, -0.0157533935456657, 
    -0.0365864961052464, 0.00284816428633602, -0.0390827955707751, 
    -0.0331282498660023, 0.0160144463637484, 0.0456439557518989, 
    -0.0170910975438849, 0.0278516976939946, -0.0461529642613651, 
    0.000932542725999325, 0.0306652565937469, -0.00572936088385097, 
    -0.047929378464284, 0.0096490189937994), MEviolet = c(-0.0698514607272664, 
    -0.0625444441558566, -0.0505951048105294, -0.0449811807220172, 
    -0.0441953669134818, -0.0841615937800127, -0.0221491455239211, 
    -0.0267981445053516, -0.0794779460694139, -0.0302013048014515, 
    -0.0353669499138048, -0.0017331573094048, 0.0874838415896361, 
    -0.047762725972725, -0.0669664745407823, -0.0712203584491592, 
    -0.0295047546287239, -0.08493075962853, 0.0272695404925932, 
    -0.0525343912541236, -0.0847673835546743, -0.0538857173401459, 
    -0.0328162107969099, -0.0966668580989554, -0.074214462874189
    ), MEdarkolivegreen = c(0.0377820765118535, -0.126289848165377, 
    0.0457552036312885, -0.0720376769423904, 0.0674183078192647, 
    0.0872226089549376, 0.0671641745702857, 0.0986229412529974, 
    0.124873710183385, -0.0145322250064643, 0.0835047870659539, 
    0.0275515952723316, 0.114534984742249, 0.0174957637942426, 
    0.0638552985728309, 0.0778140457135465, 0.251550135774411, 
    0.0286025658766736, -0.0492443633949548, 0.0329210913327464, 
    0.0787017703166302, 0.0615020315780856, -0.0184948705908313, 
    -0.0954877380526897, 0.0351479764276791), MEdarkred = c(0.272876545608831, 
    0.000123183429299067, 0.0534538229798448, 0.0966098482194768, 
    0.0376326716689517, 0.822582158679362, -0.0248835680553132, 
    -0.0383904231751435, 0.0136807003192766, -0.0248358334970572, 
    0.0339322151406484, 0.0716557037805583, -0.0539693528926393, 
    0.106398558847861, 0.0923427494085759, 0.169664971210157, 
    0.161648440649969, 0.0190084156548717, 0.000138628237731107, 
    0.000585214632906398, 0.102262784369053, 0.0534505728224905, 
    -0.059973432049819, 0.0144335767114106, 0.0669868352219114
    ), MEskyblue = c(0.0300817906913275, -0.0283955827490865, 
    0.382808148350357, 0.0367108628998102, 0.119370910675356, 
    0.0412642225896619, -0.00346854861171808, -0.0143470278284632, 
    0.107636689352283, -0.0236684849544009, 0.0917438787357169, 
    0.0145447693950731, -0.0382373445817665, 0.0191434123578404, 
    0.0375158618776065, 0.249299207645228, 0.120963274601968, 
    0.146633570220078, -0.00679395818159729, 0.0233447602384917, 
    0.0792772300611593, 0.78202446362806, -0.0543273832838903, 
    0.0108020494546566, 0.0952261185132281), MEskyblue3 = c(0.0544999124430812, 
    -0.0415537322590853, 0.148498774122011, 0.045015742997482, 
    0.0728228727907875, 0.0763671830934277, 0.000625753326390824, 
    -0.0432869954615651, 0.0859576301808161, -0.0427299484684677, 
    0.092614515678829, 0.014278460672561, -0.0339679894655559, 
    0.0742750317248251, 0.0683990062576902, 0.147094858821046, 
    0.187211235984884, 0.817070341622215, -0.00380348023692627, 
    0.0271100286319751, 0.105519330253122, 0.25743166485415, 
    -0.0622649562610468, 0.0191289446807367, 0.135145582896583
    ), MEsteelblue = c(0.0496514378945234, -0.0119028777509424, 
    0.0876026179283109, 0.875168424597013, 0.113111751301955, 
    0.0512419512431396, -0.00415862479258981, -0.0287581359673004, 
    0.0358772065144821, -0.0233613685194822, 0.0245461112657854, 
    0.0338562304377162, -0.0315874613922273, 0.030394516232703, 
    0.0555994037601733, 0.160637881942329, 0.169118254533511, 
    0.0451606357014289, -0.0145989327568692, 0.0252714145226534, 
    0.0839064560962295, 0.159428227426239, -0.0573138459939694, 
    0.0174199687282867, 0.11287454763798), MEmidnightblue = c(0.261366892829522, 
    0.023044681576429, 0.0343889442489335, 0.132848541119855, 
    0.0451576879950088, 0.0252827715295774, -0.0337324509562343, 
    -0.0317626799281452, 0.00867375015130735, -0.0355601371114707, 
    -0.00444014493366716, 0.0524201198652068, -0.0465892341718296, 
    0.53368866448374, 0.40299004894058, 0.226878425330428, 0.288891850461152, 
    0.0034111639191928, -0.0218911490874513, 0.0428414277129276, 
    0.127759568873117, 0.0230208606028655, -0.0486763743391364, 
    -0.000393935612089922, 0.0651813145953543), MEcyan = c(0.14712352890204, 
    -0.0225389566680152, 0.310239714084796, 0.266828682037704, 
    0.274085380006878, 0.0198325328800958, -0.0271481393021675, 
    -0.024480016276833, 0.361036065881631, -0.0310804478509462, 
    0.104903141200727, -0.00844783885620602, -0.0423320596946433, 
    0.217939441329577, 0.168597379421396, 0.174848423174792, 
    0.17116192322786, 0.145536587676942, -0.0085695012138382, 
    0.262571866404432, 0.116885684620837, 0.298472250629788, 
    -0.0455865890454148, -0.0198367637146339, 0.209007602108883
    ), MEsienna3 = c(0.0364613522451339, -0.0150044936323261, 
    0.0859786195398347, 0.106731994744255, 0.3676154185844, 0.0176360451265258, 
    -0.0163146904234233, -0.0235733528486296, 0.0142637017953146, 
    -0.0313496090372881, 0.0554025449971393, -0.00886560890289934, 
    -0.0299155299683427, 0.0802190450199411, 0.0531084986705855, 
    0.132177853079289, 0.115753358405972, 0.04683928504613, -0.0224627603109401, 
    0.483305710073052, 0.0502197126088502, 0.0753150865546981, 
    -0.0487254418019003, -0.000161377685444758, 0.44443648889449
    ), MEyellowgreen = c(0.0115359152267024, 0.135057278002594, 
    -0.163986652388384, 0.0330253189145193, -0.0646237426605537, 
    -0.182159469390447, -0.0763758202479116, 0.00753002768998373, 
    -0.175745378130036, -0.0866930520900523, -0.127613619675027, 
    -0.0832229515648747, -0.0379533464493758, 0.227986268308109, 
    0.103786513478538, -0.111497522959011, 0.0543128016169437, 
    -0.168835985541294, -0.0443617981956915, 0.0497044203429988, 
    -0.0846269823241523, -0.161465337778303, -0.0345036685471383, 
    -0.0961578498644668, -0.103085026146051), MElightcyan = c(0.0496191101107336, 
    0.130845431420586, 0.0520264149008036, 0.0854617949112739, 
    0.0153143285568461, 0.0138577418822467, -0.146526829901649, 
    -0.0388445912643835, 0.16637132352514, -0.036790968426816, 
    0.136179898679897, 0.0325362917451082, -0.0862509925988111, 
    0.134280378238923, 0.0481757419670939, -0.0678217105237136, 
    -0.0980229321521949, 0.0660774319688092, 0.0686963951231444, 
    0.127712350792151, -0.0437788600734283, 0.0878538693816119, 
    -0.0370044484031624, 0.0774977578587763, -0.031750256452673
    ), MEorange = c(0.13722224885649, 0.348756408712165, -0.0800936623582766, 
    0.197824913378728, -0.0205788858009016, -0.126818727577524, 
    -0.0865505994454585, -0.0596441543425443, -0.0197970499720824, 
    -0.0463019712805513, -0.0334182781567987, 0.122694391378806, 
    -0.0578620147308185, 0.136041922205044, 0.0626293391953756, 
    0.0316228992508401, 0.051048170154005, -0.0938622475936843, 
    -0.0136841309266074, 0.29538347151955, 0.0672243499977651, 
    -0.081023944076598, -0.0707293257868871, 0.0650574935030528, 
    -0.0126799698551899), MEblack = c(0.0669111171346558, 0.0837057669788319, 
    -0.164559526573629, 0.014702020473466, -0.123047193449949, 
    -0.0291251094597731, -0.156231277020043, -0.0447495590042895, 
    -0.137596515322486, -0.0266068779713139, -0.130298868117392, 
    0.0501740645662331, -0.0848560252717673, 0.162625652137377, 
    0.0936054374640849, -0.0220460671613258, -0.0311431986113967, 
    -0.174860138606855, 0.0508889727241686, 0.013307684883397, 
    -0.0389735225998367, -0.146220072707352, -0.072458305736215, 
    -0.0163412223207896, -0.0634155967712594), MEdarkmagenta = c(0.0981791947286194, 
    0.138464419108534, -0.138443536660989, 0.0735849457821136, 
    -0.0989132475093273, 0.208435014282372, -0.196962446030651, 
    -0.0187764726316799, 0.0279066357560171, 0.107299478700084, 
    -0.0836441885372265, 0.0346409967849602, -0.0962524864123106, 
    0.142618931084639, 0.0750906041071312, 0.0800820894150817, 
    -0.0388956049610418, -0.0862962942007109, 0.125617514770139, 
    0.109800363695881, -0.0603003835784385, 0.00858662657497652, 
    0.0529975055493171, 0.0427784887634529, 0.0211453409000538
    ), MEdarkorange = c(-0.0389613203162392, 0.0812780201455584, 
    0.0750911866557248, 0.00750993227102546, -0.00170616028160571, 
    0.0678048499345556, 0.0631589127461073, -0.00903712074086093, 
    0.10349869021427, -0.0824956520330546, 0.0616051849769035, 
    -0.15434803287655, -0.029264436424772, 0.0201543005265066, 
    -0.0670127845248307, -0.0516851755136453, -0.4145788128165, 
    0.131425827634174, -0.0302549933173993, 0.01867736005915, 
    -0.0125070668068291, 0.0698915480466011, 0.0784835008404346, 
    0.0203252856416219, -0.00210726593791533), MEwhite = c(0.0290935398852734, 
    0.0422842196727377, 0.0695406138759151, 0.120865984617736, 
    0.159270489022687, 0.175941528117507, 0.0559958673176756, 
    -0.0960882619193223, 0.0681820267892018, -0.0899077237106928, 
    0.0624521908300418, -0.0619794085515802, -0.0976850447934499, 
    0.0868355955174896, 0.00534865194514006, -0.0489642356559877, 
    -0.234375104882794, 0.171063805316584, -0.128968065240522, 
    -0.0264488709945445, -0.0163951034436283, 0.0578930638008963, 
    -0.08895666012489, 0.0709316976503018, 0.133020812016434), 
    MEblue = c(-0.0438160100250189, 0.0205864110567424, -0.089574297986365, 
    -0.0228697246325195, -0.0478684201028521, 0.0315178886185285, 
    0.0997019543929526, 0.0522665035834491, 0.111573175132434, 
    -0.039766523067667, 0.0554814245199621, -0.0916893423364658, 
    0.0705662146799376, 0.0156334233571506, -0.107396855651202, 
    -0.302131304020196, -0.247578337048839, 0.043361259025573, 
    -0.0104425537088264, 0.0443072405388741, -0.198865108634832, 
    -0.0361698433062441, 0.0821076401458689, -0.0978577689161953, 
    -0.197746247022991), MEgrey60 = c(-0.00136880839558318, -0.0275833699067186, 
    -0.039882440735729, -0.0525869028464486, -0.00912419686053642, 
    0.0928788723567378, 0.0734655244111471, 0.132922206619663, 
    0.117756463773648, -0.0416205429323441, 0.0878530983399299, 
    -0.0600973853406165, 0.140077921831975, 0.0160988482647548, 
    -0.0553621242005487, -0.131331494202082, -0.142532621940606, 
    0.100721216689661, -0.100883207816199, 0.0597345076546271, 
    -0.105322855790332, 0.039735865024859, 0.0952310616043726, 
    -0.106615569178441, -0.0996015659492354), MEdarkgreen = c(0.0274020843334667, 
    0.0436385774800176, 0.0947005842374533, 0.0575400257478901, 
    0.120931034418584, 0.174210568563443, 0.13572478502157, -0.0311255678482926, 
    0.194745284926632, -0.102137593170246, 0.261056084621793, 
    -0.0403664444724046, 0.0787608796858007, 0.134775433556818, 
    0.017729034036735, -0.101597869034928, -0.121335386372983, 
    0.167218651293673, -0.0509483741931395, 0.17923174058135, 
    -0.0861912933809606, 0.0965421906363849, -0.00511227897621758, 
    -0.0575646092870182, -0.0916627743675571), MEred = c(0.00684939198719674, 
    0.013557838077012, 0.191954503171545, 0.0132835577290769, 
    0.0456079404330869, 0.19777154880118, 0.197929991500107, 
    -0.0505822456570982, 0.253001323274958, -0.0981601294837628, 
    0.192635505850396, -0.0522121852056791, 0.124362208531841, 
    -0.0849374786734087, -0.124823316491311, -0.0593347866019663, 
    -0.160654145093744, 0.277260325248897, -0.0887701479804753, 
    -0.00466328615275768, 0.0153802201669976, 0.0480954401161867, 
    0.0642172097701228, 0.00333365773780607, -0.0309829945285656
    ), MEgrey = c(-0.00533499927967739, -0.0866434191241955, 
    0.133801184209863, -0.0124432897797533, 0.0922499906965556, 
    0.0953795979215922, 0.0548824355446993, -0.0283109788329285, 
    -0.00931881479985485, 0.0184344848243561, 0.0313248766224585, 
    0.106731086518589, -0.000578668939631188, -0.0923485894819629, 
    0.0387579566695894, 0.209642899356913, 0.292344147721993, 
    0.08801305387923, 0.000499791539282575, -0.070360812595406, 
    0.145743119891815, 0.120846559493449, -0.0820460485075853, 
    0.0804668976442401, 0.152772139607461)), row.names = c("TCGA.02.0003.01", 
"TCGA.02.0004.01", "TCGA.02.0007.01", "TCGA.02.0009.01", "TCGA.02.0010.01", 
"TCGA.02.0011.01", "TCGA.02.0014.01", "TCGA.02.0016.01", "TCGA.02.0021.01", 
"TCGA.02.0023.01", "TCGA.02.0024.01", "TCGA.02.0025.01", "TCGA.02.0026.01", 
"TCGA.02.0027.01", "TCGA.02.0028.01", "TCGA.02.0033.01", "TCGA.02.0034.01", 
"TCGA.02.0038.01", "TCGA.02.0039.01", "TCGA.02.0043.01", "TCGA.02.0046.01", 
"TCGA.02.0047.01", "TCGA.02.0048.01", "TCGA.02.0051.01", "TCGA.02.0054.01"
), class = "data.frame")

I now want to extract the genes present in each individual module. What shall be the most effective way for the same? I tried searching from the tutorial, but it didn't work out.

Please help me extract the genes from individual modules specific to my case?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source