I want to plot a heatplot in r using the library(ComplexHeatmap).
The reason for a complex heatmap is I want to use the function column_split() and create four sections along the x-axis of the heatmap based on the condition of the entry present in one of the columns.
Similar entries should be clubbed together into a section while the other ones should be similarly sectioned together.
I'm attaching an example of what I'm intending to visualize:
The example has two sections along the x-axis, I want to get four sections along the x-axis.
The sample of my dataset can be found here (sectioning should be performed based on the entry present in the X1 column):
dput(tdfdarkmagenta[,c(60:67)])
structure(list(TNFRSF14 = c("6.763211", "5.284519", "7.490921",
"4.609269", "5.269974", "4.647631", "6.179634", "5.441948", "4.829410",
"5.030580", "6.438149", "4.845201", "4.637916", "4.906468", "5.100337",
"4.880591", "4.561752", "4.552504", "4.553884", "5.307149", "5.006392",
"4.517924", "4.607045", "4.595832", "4.989570", "4.538372", "5.533871",
"4.950450", "5.013243", "4.520570", "5.274152", "4.666649", "4.400845",
"4.928714", "4.673502", "4.448475", "4.722818", "4.740990", "4.610013",
"5.116222", "4.489558", "4.393089", "4.478270", "4.522442", "4.648611",
"4.780437", "4.554242", "4.319169", "4.390447", "5.377440", "4.389846",
"4.807811", "4.513020", "5.489868", "4.905822", "4.859534", "5.645562",
"5.346741", "5.612692", "5.260830", "5.039774", "4.691940", "5.090038",
"5.175798", "4.944519", "4.844526", "4.681809", "4.792616", "4.986805",
"4.821405", "5.350937", "5.168791", "4.752665", "5.054333", "4.918840",
"4.708671", "5.269936", "4.859859", "4.690761", "4.607971", "6.197512",
"5.535270", "5.109438", "5.202073", "6.846271", "4.521108", "5.427523",
"4.896707", "4.881706", "4.898868", "5.553587", "4.761078", "5.387781",
"5.033667", "5.186906", "5.219224", "5.289800", "5.108414", "4.810671",
"4.975923", "5.000025", "5.497612", "5.085484", "5.747220", "4.821348",
"4.552635", "5.108517", "4.372822", "4.886677", "4.550540", "4.535185",
"4.571301", "5.135246", "4.721852", "5.315297", "5.344703", "4.732211",
"5.636453", "5.726499", "5.492068", "6.608274", "4.586360", "5.434929",
"5.550500", "6.364833", "5.023511", "5.741130", "5.279884", "4.697330",
"5.351020", "5.455380", "5.356322", "6.314431", "6.054811", "5.034309",
"5.413860", "5.335178", "5.102029", "6.000984", "5.932897", "5.689009",
"5.391170", "5.951435", "5.043789", "4.817887", "5.691450", "4.634035",
"4.596461", "5.293566", "5.137780", "5.673469", "5.681756", "5.422228",
"5.586516", "5.534513", "5.627834", "5.014984", "5.604038", "5.676470",
"4.594406", "5.257321", "4.842386", "5.576247", "5.195238", "5.239197",
"5.464640", "5.142982", "5.824495", "5.390776", "5.440580", "5.244292"
), TRIM21 = c("6.431994", "5.042253", "7.222424", "4.828634",
"5.948891", "5.123265", "6.642031", "5.904441", "5.475596", "5.353339",
"6.738790", "5.117833", "5.301989", "5.252409", "5.173978", "5.142840",
"4.936253", "5.161623", "5.070000", "5.901228", "5.454423", "5.879939",
"5.602029", "5.516002", "5.522428", "5.775431", "6.118189", "5.915588",
"6.163597", "5.296870", "5.695514", "5.823336", "5.542973", "5.212203",
"5.361452", "5.374471", "5.842928", "5.192644", "4.835399", "6.006584",
"5.229373", "5.456365", "5.252248", "5.401239", "5.140290", "5.452533",
"5.803037", "5.572374", "4.951891", "5.207188", "5.298013", "5.338679",
"4.564718", "6.732028", "6.111744", "7.474183", "6.661202", "6.403443",
"6.545940", "5.888248", "4.997507", "7.016605", "4.935572", "6.126647",
"5.677001", "5.945327", "6.589629", "6.031521", "5.866332", "5.788022",
"6.111872", "6.087375", "5.808597", "6.178624", "5.713949", "5.942519",
"5.637996", "5.424581", "5.599873", "5.284653", "6.609202", "5.435754",
"5.544703", "6.009451", "7.202513", "5.386335", "6.621233", "5.594111",
"6.312540", "5.485936", "5.419595", "6.150265", "5.899882", "5.058617",
"5.659748", "5.437870", "6.509740", "6.433295", "5.310995", "5.498675",
"5.414997", "6.637328", "5.677507", "6.835608", "5.686684", "5.897316",
"6.756414", "5.453264", "5.800830", "5.561556", "4.749356", "5.704908",
"6.355550", "5.415819", "5.515227", "6.149568", "5.638447", "6.283533",
"6.215459", "5.822403", "5.923719", "7.099936", "5.843381", "5.550354",
"5.903016", "5.778041", "7.081189", "5.768080", "5.901516", "6.312023",
"6.633226", "5.521853", "7.176372", "6.286262", "6.375185", "5.486260",
"6.130937", "7.210972", "6.227496", "7.215501", "6.709982", "6.009789",
"7.490369", "6.343237", "5.865556", "6.000012", "6.421068", "6.164297",
"5.938543", "6.017242", "5.973925", "6.084213", "6.213892", "6.936647",
"5.923585", "6.074540", "5.998629", "6.330441", "5.810274", "6.269363",
"6.010916", "6.208866", "6.034612", "5.810491", "7.147822", "6.265278",
"6.126955", "6.750558", "5.901326", "5.473538", "5.564613"),
TRIM5 = c("5.822737", "6.222604", "7.563662", "4.086133",
"6.349595", "5.150263", "5.881708", "5.091480", "6.354464",
"6.116619", "6.843245", "5.452570", "5.382441", "4.725757",
"5.534072", "5.395174", "4.324291", "4.415694", "5.203558",
"6.048923", "5.316767", "5.224266", "5.066764", "4.736292",
"6.042426", "5.373095", "6.645612", "5.533974", "5.672580",
"4.617023", "6.108689", "5.591934", "5.657896", "5.125809",
"4.438850", "5.272771", "5.736807", "4.714584", "4.534244",
"6.058367", "5.177258", "5.877033", "4.202193", "5.724201",
"5.118208", "5.401561", "5.772003", "5.051045", "5.503369",
"5.329664", "4.494426", "5.497274", "4.960003", "6.501349",
"5.650884", "6.528032", "6.182357", "5.462596", "6.706200",
"6.332626", "4.731002", "5.851416", "4.344378", "6.538150",
"6.229104", "5.635625", "6.488791", "6.223015", "6.602510",
"5.836704", "6.691600", "5.369458", "5.291462", "5.941188",
"4.132055", "5.708936", "5.616086", "6.466687", "5.597564",
"5.148402", "6.323588", "6.397155", "5.669944", "5.992870",
"6.851263", "4.895652", "6.447487", "6.193882", "6.497912",
"6.088267", "5.990293", "5.924586", "6.226032", "5.204277",
"6.660849", "5.652528", "6.479109", "6.302167", "6.004851",
"6.195296", "5.109325", "6.352197", "5.672728", "7.059679",
"5.923266", "6.404251", "6.602810", "6.258576", "5.919479",
"5.757714", "5.825573", "5.627942", "6.553201", "5.082112",
"5.894984", "6.323995", "6.144249", "6.898566", "5.889947",
"5.671488", "5.802962", "6.639332", "5.640718", "5.174362",
"5.871434", "5.267289", "5.707974", "5.866471", "5.563334",
"5.553383", "6.389321", "5.926533", "6.543673", "5.936929",
"5.545558", "5.767185", "5.950059", "6.745602", "6.031510",
"6.617051", "5.894231", "5.973619", "6.213449", "5.936016",
"5.073035", "6.029362", "5.904277", "5.537748", "5.253370",
"5.884172", "6.505674", "6.222989", "5.987814", "6.576203",
"6.096379", "6.457036", "5.855024", "6.353923", "5.861205",
"5.971539", "6.049779", "6.087083", "6.038771", "5.251336",
"5.491827", "5.842702", "5.693123", "6.314864", "5.706161",
"5.482341", "5.768043"), TRIM6.TRIM34 = c("5.937611", "5.275868",
"7.353534", "4.622495", "5.361770", "4.988066", "5.897324",
"5.285014", "5.447992", "5.810304", "6.786004", "4.703763",
"5.568188", "4.792179", "5.615872", "5.127782", "4.634241",
"4.618630", "4.463709", "5.662091", "5.081924", "4.953603",
"4.644899", "4.769084", "5.982892", "5.102814", "6.187155",
"5.885339", "6.319735", "5.172348", "5.555390", "5.268740",
"4.959861", "4.972108", "4.841870", "4.970467", "5.420196",
"4.663467", "4.732499", "6.289717", "4.963199", "5.549709",
"5.731115", "5.600103", "4.892902", "5.290226", "5.230376",
"5.383842", "4.936702", "4.556545", "4.631922", "4.863811",
"4.428710", "6.852612", "6.168029", "7.286804", "6.648190",
"5.934927", "6.919225", "6.138611", "4.925052", "7.138950",
"5.066954", "5.944666", "5.793288", "6.403477", "6.796306",
"5.687106", "6.513611", "5.444718", "6.539260", "6.040825",
"5.881115", "6.168548", "5.199162", "6.246036", "6.270044",
"6.218608", "5.681608", "5.328573", "6.097843", "5.467480",
"6.475331", "5.929094", "7.047796", "4.719675", "6.922534",
"5.383393", "5.964221", "4.714213", "5.262174", "5.279408",
"4.957118", "4.849338", "5.763230", "4.493443", "6.405372",
"5.613615", "5.209032", "5.536535", "4.857154", "6.090186",
"5.347670", "6.471024", "5.546441", "5.841984", "7.123798",
"5.616489", "5.810949", "5.142709", "4.597169", "4.683310",
"5.750587", "5.294417", "5.190489", "6.222733", "5.495578",
"6.871896", "5.589133", "6.662429", "5.352042", "6.384046",
"5.383347", "5.525282", "5.671085", "5.460051", "6.395001",
"5.907310", "5.467635", "6.104199", "6.492492", "5.920352",
"6.184735", "7.269542", "5.486369", "5.295680", "5.775933",
"5.957229", "5.837581", "7.105300", "7.495025", "5.566982",
"6.186198", "5.663092", "5.084674", "5.236772", "5.962017",
"5.167454", "4.593162", "5.992850", "5.726368", "5.688865",
"6.202907", "6.341310", "5.873099", "5.816448", "5.829305",
"6.236659", "5.513989", "5.765652", "6.056901", "5.421313",
"6.418777", "5.676975", "5.469386", "6.062755", "6.048360",
"6.200852", "5.727262", "5.469546", "5.748829"), USP18 = c("5.718693",
"6.682403", "6.357125", "5.679496", "4.106625", "4.414581",
"5.064882", "4.957291", "5.548682", "6.278062", "5.276683",
"4.422013", "4.309918", "5.111803", "4.572404", "4.542438",
"5.131603", "5.379931", "5.028311", "4.796386", "4.596530",
"5.155584", "5.456809", "4.761863", "5.198166", "5.441030",
"4.921847", "5.113289", "7.009444", "4.439582", "4.768433",
"4.833512", "4.660273", "4.808394", "5.555523", "4.531055",
"5.582966", "4.526851", "4.649801", "5.198746", "4.810157",
"5.778164", "4.847919", "5.455516", "5.113708", "5.719224",
"4.810561", "5.406566", "4.338842", "6.350501", "4.948599",
"5.231380", "4.335305", "5.381577", "5.311190", "7.202314",
"6.005184", "4.434290", "5.784484", "5.264276", "4.705270",
"5.120882", "4.668959", "4.922306", "4.675179", "4.626882",
"7.446586", "4.729425", "6.223997", "5.281221", "5.392587",
"4.811235", "4.825120", "5.207328", "5.197467", "5.460064",
"4.728236", "5.575803", "4.586449", "5.538034", "4.982738",
"4.920202", "6.770434", "5.961021", "5.766194", "5.137988",
"6.130135", "5.241656", "4.946761", "5.028543", "5.104713",
"5.036523", "4.974109", "4.772592", "4.999752", "4.324340",
"6.213396", "5.517294", "4.692500", "4.742078", "4.593844",
"5.795447", "4.638634", "5.984280", "4.755189", "5.667815",
"6.674394", "5.058963", "5.437060", "4.559434", "4.893805",
"4.797785", "5.374581", "4.495744", "5.057857", "5.600783",
"5.107624", "6.849587", "4.523906", "5.792761", "4.598304",
"5.727816", "5.180632", "5.094581", "6.094168", "4.898104",
"4.862862", "4.776479", "5.155643", "4.943359", "4.734378",
"5.096641", "5.702587", "4.918131", "4.773704", "3.890195",
"4.838250", "5.977761", "4.329212", "6.860318", "4.447631",
"4.712405", "5.392524", "6.063264", "4.936670", "4.882573",
"4.647908", "4.431911", "5.103765", "4.921930", "4.536905",
"4.856455", "4.667513", "4.759260", "4.850679", "4.633649",
"4.686094", "5.126613", "6.473523", "4.649449", "5.036461",
"5.462401", "4.640192", "5.158638", "4.810653", "5.129531",
"4.116244", "4.860353", "4.754640", "5.079082", "4.486192"
), WARS = c(" 9.741085", " 7.705491", "10.358481", " 7.590207",
" 9.337360", " 7.651537", " 9.658838", " 7.700906", " 9.144902",
" 7.704850", " 9.600405", " 6.170229", " 7.413422", " 6.514774",
" 7.886173", " 7.360641", " 5.806572", " 8.378613", " 7.494757",
" 7.876629", " 6.862292", " 8.070094", " 7.309813", " 5.811267",
" 7.574229", " 8.506426", " 8.846700", " 7.531968", " 8.280646",
" 6.830683", " 7.132248", " 7.842201", " 7.805041", " 7.525088",
" 7.210482", " 7.037882", " 7.802182", " 8.031236", " 7.705962",
" 8.336039", " 7.728969", " 7.379578", " 7.024331", " 8.732033",
" 7.894324", " 7.850012", " 9.187318", " 7.530023", " 6.954335",
" 8.453595", " 7.571864", " 7.459042", " 7.719722", " 8.787680",
" 6.740085", " 8.728310", " 8.523625", " 8.393748", " 8.661276",
" 6.579634", " 7.395377", " 7.935308", " 7.322103", " 7.212903",
" 8.356472", " 8.390128", " 7.632168", " 8.357761", " 8.271615",
" 7.471954", " 8.106076", " 7.073513", " 7.578518", " 8.297072",
" 6.849216", " 8.158288", " 7.206605", " 7.681974", " 6.778407",
" 8.272037", " 8.182982", " 7.378438", " 7.716711", " 8.512143",
"10.716291", " 8.820795", " 8.121732", " 8.436596", " 9.147759",
" 6.893998", " 7.259598", " 8.330251", " 8.315300", " 5.920632",
" 7.070069", " 7.281612", " 8.554079", " 9.142981", " 7.950271",
" 7.562227", " 6.715376", "10.280994", " 7.605400", " 9.554562",
" 7.978580", " 8.346153", " 9.568928", " 8.010549", " 8.742179",
" 7.982264", " 6.089002", " 8.265322", " 9.395761", " 7.916445",
" 7.760482", " 8.051640", " 7.734232", " 8.644975", " 7.554951",
" 6.861567", " 7.968219", " 8.652426", " 7.602107", " 7.395093",
" 9.027995", " 8.386802", "10.027226", " 7.902295", " 9.087707",
" 8.789210", " 7.984577", " 8.224228", " 8.709374", " 8.580686",
" 8.745083", " 6.777630", " 7.978246", "10.020118", " 8.364781",
" 8.539831", " 8.263803", " 8.107275", " 9.916640", " 8.512989",
" 7.057656", " 8.755297", " 8.717764", " 8.466065", " 7.787823",
" 8.103300", " 7.461842", " 8.445302", " 7.790692", " 8.475600",
" 7.720987", " 8.306191", " 9.288390", " 7.711786", " 7.908223",
" 8.632697", " 7.570594", " 8.941366", " 8.272476", " 8.846527",
" 7.762084", " 8.358732", " 8.008650", " 8.841305", " 7.768422",
" 7.979987", " 7.296068"), XAF1 = c(" 7.204336", " 4.676853",
" 8.461538", " 4.970523", " 4.757121", " 5.646469", " 6.941820",
" 5.332072", " 4.894905", " 9.288142", " 7.185457", " 5.648606",
" 5.498739", " 4.955205", " 6.115092", " 5.048723", " 5.473210",
" 5.189232", " 5.009301", " 4.940164", " 6.189979", " 5.492820",
" 6.522928", " 4.583334", " 4.768236", " 5.385628", " 6.153866",
" 6.110116", " 8.693712", " 5.400515", " 6.456129", " 5.645278",
" 4.918446", " 6.186246", " 6.612541", " 5.076613", " 5.149972",
" 5.243527", " 4.802256", " 8.295490", " 6.441114", " 7.321974",
" 5.441317", " 5.674706", " 5.010786", " 6.008704", " 7.002941",
" 5.785526", " 5.013941", " 5.039298", " 4.768318", " 6.526325",
" 5.238632", " 8.058764", " 8.498692", " 8.999449", " 7.495898",
" 6.122763", " 7.863722", " 5.514492", " 5.440231", " 6.260331",
" 5.845690", " 5.690694", " 4.753152", " 6.636006", " 8.046649",
" 5.578944", " 6.356472", " 7.718760", " 7.648011", " 6.766714",
" 5.531841", " 6.713646", " 7.022129", " 7.703428", " 5.565680",
" 5.796008", " 4.993859", " 4.810499", " 6.990522", " 9.967345",
" 4.348337", " 9.314201", " 7.574084", " 4.747644", " 7.997477",
" 9.112394", " 6.699651", " 7.482104", " 8.548686", " 6.483866",
" 7.194462", " 5.999078", " 7.251500", " 8.250832", " 7.763383",
" 7.552806", " 8.274743", " 8.746934", " 5.248179", " 7.968312",
" 5.104672", " 7.761367", " 5.763023", " 7.112653", " 9.984765",
" 5.396954", " 8.274371", " 5.353193", " 5.648747", " 6.129513",
" 7.872605", " 4.797765", " 7.341686", " 7.192397", " 5.095878",
" 8.178023", " 7.110888", " 6.506158", " 5.233231", " 9.526941",
" 6.608939", " 5.997255", " 7.838331", " 6.833276", " 9.318884",
" 6.816009", " 5.778280", " 6.535346", " 5.960834", " 6.577319",
" 7.445455", " 8.068162", " 6.985303", " 6.037019", " 6.048727",
"10.166330", " 8.883953", " 9.440612", " 7.105944", " 7.351310",
" 7.450230", " 8.073638", " 7.250787", " 6.771193", " 5.873439",
" 5.426779", " 5.337160", " 6.399303", " 5.838342", " 7.407744",
" 6.558704", " 6.943017", " 6.376653", " 5.095157", " 6.691384",
" 7.734144", " 5.813734", " 7.271785", " 8.273823", " 9.423574",
" 5.930291", " 7.297977", " 4.916875", " 7.328354", " 6.662784",
" 7.581749", " 6.125870", " 7.011328", " 6.461728"), X1 = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L), .Label = c("Proneural", "Neural", "Classical",
"Mesenchymal"), class = "factor")), class = "data.frame", row.names = c("TCGA.02.0003.01",
"TCGA.02.0010.01", "TCGA.02.0011.01", "TCGA.02.0014.01", "TCGA.02.0024.01",
"TCGA.02.0026.01", "TCGA.02.0028.01", "TCGA.02.0046.01", "TCGA.02.0047.01",
"TCGA.02.0048.01", "TCGA.02.0060.01", "TCGA.02.0069.01", "TCGA.02.0074.01",
"TCGA.02.0080.01", "TCGA.02.0084.01", "TCGA.02.0087.01", "TCGA.02.0104.01",
"TCGA.02.0114.01", "TCGA.02.0281.01", "TCGA.02.0321.01", "TCGA.02.0325.01",
"TCGA.02.0338.01", "TCGA.02.0339.01", "TCGA.02.0432.01", "TCGA.02.0439.01",
"TCGA.02.0440.01", "TCGA.02.0446.01", "TCGA.06.0128.01", "TCGA.06.0129.01",
"TCGA.06.0146.01", "TCGA.06.0156.01", "TCGA.06.0166.01", "TCGA.06.0174.01",
"TCGA.06.0177.01", "TCGA.06.0238.01", "TCGA.06.0241.01", "TCGA.06.0410.01",
"TCGA.06.0413.01", "TCGA.06.0414.01", "TCGA.06.0646.01", "TCGA.06.0648.01",
"TCGA.08.0245.01", "TCGA.08.0344.01", "TCGA.08.0347.01", "TCGA.08.0348.01",
"TCGA.08.0350.01", "TCGA.08.0353.01", "TCGA.08.0359.01", "TCGA.08.0385.01",
"TCGA.08.0517.01", "TCGA.08.0524.01", "TCGA.12.0616.01", "TCGA.12.0618.01",
"TCGA.02.0089.01", "TCGA.02.0113.01", "TCGA.02.0115.01", "TCGA.02.0451.01",
"TCGA.06.0132.01", "TCGA.06.0133.01", "TCGA.06.0138.01", "TCGA.06.0160.01",
"TCGA.06.0162.01", "TCGA.06.0167.01", "TCGA.06.0171.01", "TCGA.06.0173.01",
"TCGA.06.0179.01", "TCGA.06.0182.01", "TCGA.06.0185.01", "TCGA.06.0195.01",
"TCGA.06.0208.01", "TCGA.06.0214.01", "TCGA.06.0219.01", "TCGA.06.0221.01",
"TCGA.06.0237.01", "TCGA.06.0240.01", "TCGA.08.0349.01", "TCGA.08.0380.01",
"TCGA.08.0386.01", "TCGA.08.0520.01", "TCGA.02.0007.01", "TCGA.02.0009.01",
"TCGA.02.0016.01", "TCGA.02.0021.01", "TCGA.02.0023.01", "TCGA.02.0027.01",
"TCGA.02.0038.01", "TCGA.02.0043.01", "TCGA.02.0070.01", "TCGA.02.0102.01",
"TCGA.02.0260.01", "TCGA.02.0269.01", "TCGA.02.0285.01", "TCGA.02.0289.01",
"TCGA.02.0290.01", "TCGA.02.0317.01", "TCGA.02.0333.01", "TCGA.02.0422.01",
"TCGA.02.0430.01", "TCGA.06.0125.01", "TCGA.06.0126.01", "TCGA.06.0137.01",
"TCGA.06.0145.01", "TCGA.06.0148.01", "TCGA.06.0187.01", "TCGA.06.0211.01",
"TCGA.06.0402.01", "TCGA.08.0246.01", "TCGA.08.0354.01", "TCGA.08.0355.01",
"TCGA.08.0357.01", "TCGA.08.0358.01", "TCGA.08.0375.01", "TCGA.08.0511.01",
"TCGA.08.0514.01", "TCGA.08.0518.01", "TCGA.08.0529.01", "TCGA.08.0531.01",
"TCGA.02.0004.01", "TCGA.02.0025.01", "TCGA.02.0033.01", "TCGA.02.0034.01",
"TCGA.02.0039.01", "TCGA.02.0051.01", "TCGA.02.0054.01", "TCGA.02.0057.01",
"TCGA.02.0059.01", "TCGA.02.0064.01", "TCGA.02.0075.01", "TCGA.02.0079.01",
"TCGA.02.0085.01", "TCGA.02.0086.01", "TCGA.02.0099.01", "TCGA.02.0106.01",
"TCGA.02.0107.01", "TCGA.02.0111.01", "TCGA.02.0326.01", "TCGA.02.0337.01",
"TCGA.06.0122.01", "TCGA.06.0124.01", "TCGA.06.0130.01", "TCGA.06.0139.01",
"TCGA.06.0143.01", "TCGA.06.0147.01", "TCGA.06.0149.01", "TCGA.06.0152.01",
"TCGA.06.0154.01", "TCGA.06.0164.01", "TCGA.06.0175.01", "TCGA.06.0176.01",
"TCGA.06.0184.01", "TCGA.06.0189.01", "TCGA.06.0190.01", "TCGA.06.0194.01",
"TCGA.06.0197.01", "TCGA.06.0210.01", "TCGA.06.0397.01", "TCGA.06.0409.01",
"TCGA.06.0412.01", "TCGA.06.0644.01", "TCGA.06.0645.01", "TCGA.08.0346.01",
"TCGA.08.0352.01", "TCGA.08.0360.01", "TCGA.08.0390.01", "TCGA.08.0392.01",
"TCGA.08.0509.01", "TCGA.08.0510.01", "TCGA.08.0512.01", "TCGA.08.0522.01",
"TCGA.12.0619.01", "TCGA.12.0620.01"))
My attempt has been:
Heatmap(data.matrix(tdfdarkgrey), column_split =tdfdarkgrey, show_row_names = FALSE, show_row_dend = FALSE, show_column_dend = FALSE, show_column_names = FALSE,
show_parent_dend_line = FALSE, cluster_rows = FALSE, cluster_columns = FALSE, column_title = NULL,
heatmap_legend_param = list(title= c("Scale")))
Any suggestions shall be helpful.
CodePudding user response:
Given your data provided by dput
(in the example, this would be called tdfdarkgrey
), you would need to transpose your matrix to get a column gap. I provided the column_split vector separately from the matrix to be drawn and exaggerated the the column_gap for better visibility.
Example below:
library(ComplexHeatmap)
Heatmap(t(data.matrix(tdfdarkgrey[,grep("^X1$", colnames(tdfdarkgrey), invert = TRUE)])),
column_split =tdfdarkgrey$X1, show_row_names = FALSE, show_row_dend = FALSE, show_column_dend = FALSE, show_column_names = FALSE,
show_parent_dend_line = FALSE, cluster_rows = FALSE, cluster_columns = FALSE, column_title = NULL,
heatmap_legend_param = list(title= c("Scale")),
column_gap=unit(.05, "npc"))
Created on 2022-06-20 by the reprex package (v2.0.1)