Thanks @Kevin, after applying anova pval < 0.001 I got 497 genes. Then to do multinomial penalised regression I followed your comprehensive reply in this post and did every step as you said and now after applying this chunk of the script:
g1 <- rownamesco.se$S1)[whichco.se$S1 != 0)]
g2 <- rownamesco.se$S2)[whichco.se$S2 != 0)]
g3 <- rownamesco.se$S3)[whichco.se$S3 != 0)]
g4 <- rownamesco.se$S4)[whichco.se$S4 != 0)]
I have 121 genes as best predictors (g1=30, g2=30, g3=34, g4=27). Now for downstream applications here: (Can I build my predictive model by all 121 genes or still needs more filtering?)
finalLasso <- glm(modellingLasso$Type ~ all 121 gene,
data=modellingLasso,
family=binomial(link="logit"))
Many thanks for any help and suggestion!


As @Kevin said here I used ANOVA to find genes which are significantly expressed across my four subtypes. To apply ANOVA on all my 580 genes I used this function:
Then I filtered based on pval <0.05, now I have 514 genes that is still quite high and don't give a good heatmap that shows discrimination between 4 groups. I just want to keep those genes which are expressing significantly in each group but not in 3 others. Any help or suggestion? Many thanks in advance!