[R] rename and color a list of list of list of values
Karim Mezhoud
kmezhoud at gmail.com
Fri Jun 5 18:31:22 CEST 2015
Hi all,
I have a list like this
expBefore <-
list(HM450=list(brac_tcga=list("ATM"=0.19,"ATR"=0.02,"BRCA1"=0.02,"BRCA2"=0.89,"CHEK1"=0.71,"CHEK2"=0.03),
gbm_tcga=list("ATM"=0.19,"ATR"=0.02,"BRCA1"=0.02,"BRCA2"=0.89,"CHEK1"=0.71,"CHEK2"=0.03)
),
HM27=list(brac_tcga=list("ATM"=0.19,"ATR"=0.02,"BRCA1"=0.02,"BRCA2"=0.89,"CHEK1"=0.71,"CHEK2"=0.03),
gbm_tcga=list("ATM"=0.19,"ATR"=0.02,"BRCA1"=0.02,"BRCA2"=0.89,"CHEK1"=0.71,"CHEK2"=0.03)
)
)
and I would convert it to
expAfter <-list(
list(
name="HM450",
children=list(
list(name="brca_tcga",
children=list(
list(name="ATM", colour="110000"),
list(name="ATR", colour="330000"),
list(name="BRCA1", colour="550000"),
list(name="BRCA2", colour="770000"),
list(name="CHEK1", colour="990000"),
list(name="CHEK2", colour="bb0000")
), colour="aa0000" # brca_tcga
),
list(name="gbm_tcga",
children=list(
list(name="ATM", colour="001100"),
list(name="ATR", colour="003300"),
list(name="BRCA1", colour="005500"),
list(name="BRCA2", colour="007700"),
list(name="CHEK1", colour="009900"),
list(name="CHEK2", colour="00bb00")
), colour="345345" # gbm_tcga
)
), colour="ffa500" # HM450
),
list(
name="HM27",
children=list(
list(name="brca_tcga",
children=list(
list(name="ATM", colour="110000"),
list(name="ATR", colour="330000"),
list(name="BRCA1", colour="550000"),
list(name="BRCA2", colour="770000"),
list(name="CHEK1", colour="990000"),
list(name="CHEK2", colour="bb0000")
), colour="aa0000" ##brca_tcga
),
list(name="gbm_tcga",
children=list(
list(name="ATM", colour="001100"),
list(name="ATR", colour="003300"),
list(name="BRCA1", colour="005500"),
list(name="BRCA2", colour="007700"),
list(name="CHEK1", colour="009900"),
list(name="CHEK2", colour="00bb00")
), colour="345345") #gbm_tcga
), colour="ff00ff" #HM27
)
);
any suggestion?
Thanks
[[alternative HTML version deleted]]
More information about the R-help
mailing list