I have this information in a large data frame (so each sample has different number of altered genes).
Samp3 BRAF Samp1 RAS Samp2 RAS,TP53