ggloor / ALDEx2_dev

ALDEx tool to examine compositional high-throughput sequence data with Welch's t-test
GNU Affero General Public License v3.0
12 stars 6 forks source link

Problem in calculating the differential OTU abundance based on ALDEx2 #14

Closed tilaknayak closed 4 years ago

tilaknayak commented 4 years ago

I am trying to calculating the differential OTU abundance, for this I am trying this code I attached my file also ENV_aldex.txt OTU_table_final.txt

" ] Script: OTU_FL <- OTU[ , ENV$Water_type == "Radon OTU_FL <- OTU_FL[ rowSums(OTU_FL) > 0, ] relOTU_FL <- prop.table(as.matrix(OTU_FL), 2) * 100 ENV_FL <- ENV[ colnames(OTU_FL), ] OTU_FL.sub <- OTU_FL[apply(OTU_FL, 1, function(x) { max(table(ENV_FL$Type[x > 0])) >=3 } ) & apply(relOTU_FL, 1, function(x) { max(x) >= 1 } ), ] clrOTU_FL_mc <- aldex.clr(OTU_FL.sub, mc.samples = 128) clrOTU_FL <- t(sapply(getMonteCarloInstances(clrOTU_FL_mc), function(x) {apply(x, 1, median)})) glmOTU_FL <- aldex.glm(clrOTU_FL_mc, conditions = ENV_FL$Type)

but I got an error that Error in lr2glm(mci_lr, conditions, ...) : Please define the aldex.clr object for a model.matrix 'conditions'. In addition: Warning message: In if (class(conditions) != "matrix" & !("assign" %in% names(attributes(conditions)))) { : the condition has length > 1 and only the first element will be used Please help me to solve this error.

ggloor commented 4 years ago

you need to define a model matrix object. See the example in ?aldex.glm

tilaknayak commented 4 years ago

Thanks a lot.

On Sat, Feb 8, 2020 at 9:32 PM Greg Gloor notifications@github.com wrote:

Closed #14 https://github.com/ggloor/ALDEx2_dev/issues/14.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ggloor/ALDEx2_dev/issues/14?email_source=notifications&email_token=AK6USWQBIGSTUM3HKNA6ITDRB3JQ5A5CNFSM4KCVVM52YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWQAWPHY#event-3019990943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK6USWXMBDV4B6UVCZTNEPDRB3JQ5ANCNFSM4KCVVM5Q .

mbaloza commented 2 years ago

I have a similar problem

OTU_table=read.csv("PS118_physeq.csv", h=T) OTU_St1_St4_2_3=OTU_table[,c(38,44,50,98,104,110)]

OTU_St1_St4_2_3=OTU_St1_St4_2_3[rowSums(OTU_St1_St4_2_3[])>0,]

Conds<-c(rep("St4",3),rep("St1",3))

St1St4_2_3=aldex(OTU_St1_St4_2_3, Conds, mc.samples=128, test="glm", effect=FALSE, include.sample.summary=FALSE, verbose=FALSE)

I got this error:

aldex.clr: generating Monte-Carlo instances and clr values operating in serial mode computing center with all features aldex.glm: doing glm test based on a model matrix Error in lr2glm(mci_lr, conditions, ...) : Please define the aldex.clr object for a model.matrix 'conditions'.

I am using R version 4 and ALDEX2 version 1.20.0