Changing Reference Level

124 views
Skip to first unread message

Christina Adler

unread,
Nov 3, 2018, 8:09:16 PM11/3/18
to MaAsLin-users
Hi Maaslin Users Group,

Has anyone been able to change the reference level in their Maaslin analyses?

Basically in my Condition of interest there are 4 levels, hence I need to re-run maaslin a few times with a different reference level to get all the comparisons of interest. Just running once, only gives me the sig. values between one level and the other 3 in the model.

Re-levelling is easy in a standard linear model in R, but with Maaslin reading the tsv file straight in, I can't see an option in the R script to modify this.

Anybody been able to do this?

Thanks in advance for any help
Christina


Phil Rouge

unread,
Feb 19, 2019, 2:01:55 PM2/19/19
to MaAsLin-users
Hi,

Is there any update on that? Even with Maaslin2, where you can directly feed an R data frame, it ignores the factor order and just follows the alphabetical order...

Jeremy Wilkinson

unread,
Mar 14, 2019, 11:51:52 AM3/14/19
to MaAsLin-users
Adding a character prefix to your level names will do the trick. For example, if you have a variable with 4 levels: Healthy Control, Crohns, Colitis, Unk IBD, MaAsLin will read it in the following order, alphabetically: Colitis, Crohns, Healthy Control, Unk IBD. To correct this, add a_, b_, c_, d_ to the front of your level names in the order you want it. For example: a_Healthy Control, b_Crohns, c_Colitis, d_Unk IBD. If your level names are too long you may just want to change them to simply A, B, C, D and keep a metadata catalog of the assignments.


-Jeremy
Reply all
Reply to author
Forward
0 new messages