MTPC Error in v3.0.0

49 views
Skip to first unread message

jrusse...@gmail.com

unread,
Oct 13, 2020, 9:24:57 AM10/13/20
to brainGraph-help
Hi Chris,

Using mtpc in v3 (in R 3.6.3), I receive an error -
"Error in dimnames(null.max.all) <- `*vtmp*` : 'dimnames' must be a list". 

Here's my call below (purposefully simple):

mtpc(g, thresholds, covars=covars[,1:2], measure='strength', contrasts=c(0,-2), con.type='t', 
     level="vertex", N=10000, alt="less", con.name=c("test1"))

I'm trying to match things as closely to section 9.4 in the manual as possible, but can't get past this error.  Traceback just shows me the mtpc call I provide above.  Thoughts?  Happy to send along any additional information.  Thanks for an awesome package!


Chris Watson

unread,
Oct 13, 2020, 11:42:15 AM10/13/20
to brainGr...@googlegroups.com
It's possible that there is an issue with assigning dimnames to only one
dimension of an array when the others are unnamed. I thought I came across this
in another function. Try excluding the "con.name" argument from your function
call. I don't know if it will work anyway, so I will try to look into this bug
over the next few days.

On Tue, Oct 13, 2020 at 08:24 AM, jrusse...@gmail.com <jrusse...@gmail.com> wrote:

> from: "jrusse...@gmail.com" <jrusse...@gmail.com>
> date: Tue, Oct 13 06:24 AM -07:00 2020
> to: brainGraph-help <brainGr...@googlegroups.com>
> reply-to: brainGr...@googlegroups.com
> subject: [brainGraph-help] MTPC Error in v3.0.0
> --
> You received this message because you are subscribed to the Google Groups "brainGraph-help" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-he...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/098a5934-c4a1-4301-babc-04b7824844a6n%40googlegroups.com.

jrusse...@gmail.com

unread,
Oct 15, 2020, 10:15:44 AM10/15/20
to brainGraph-help
Just a follow-up that excluding the con.name argument didn't help.  Thanks for your help!!

Chris Watson

unread,
Oct 15, 2020, 10:54:03 PM10/15/20
to brainGr...@googlegroups.com
Yes, I confirmed this bug and will try to get a fix out this weekend.

Chris

On Thu, Oct 15, 2020 at 09:15 AM, jrusse...@gmail.com <jrusse...@gmail.com> wrote:

> from: "jrusse...@gmail.com" <jrusse...@gmail.com>
> date: Thu, Oct 15 07:15 AM -07:00 2020
> to: brainGraph-help <brainGr...@googlegroups.com>
> reply-to: brainGr...@googlegroups.com
> subject: Re: [brainGraph-help] MTPC Error in v3.0.0
> To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/48d8aaa0-6678-48c6-b5ea-1a17384543f8n%40googlegroups.com.

jrusse...@gmail.com

unread,
Oct 19, 2020, 5:26:26 PM10/19/20
to brainGraph-help
Thanks so much for the rapid bug fix!!  Unfortunately, instead of the dimnames error, I'm now receiving the following:
Error in `[.data.table`(mtpc.stats, , `:=`(tau.mtpc, mtpc.all[mtpc.stats, : Supplied 3 items to be assigned to 1 items of column 'tau.mtpc'. If you wish to 'recycle' the RHS please use rep() to make this intent clear to readers of your code.

Here's the traceback:
3: `[.data.table`(mtpc.stats, , `:=`(tau.mtpc, mtpc.all[mtpc.stats, .SD[S.mtpc == stat, threshold]]))
2: mtpc.stats[, `:=`(tau.mtpc, mtpc.all[mtpc.stats, .SD[S.mtpc == stat, threshold]])]
1: mtpc(g, thresholds, covars = covars[, 1:2], measure = y, contrasts = mtpcContrast, con.type = "t", level = x, N = mtpcVars[.(x, y), N], perms = mtpcPerms[[x]], alt = mtpcVars[.(x, y), alt])

Chris Watson

unread,
Oct 19, 2020, 6:36:04 PM10/19/20
to brainGr...@googlegroups.com
I haven't seen that bug on my system. Please send me all the data necessary to reproduce the bug (as a "rda" file), and the code (as an "R" file).
Chris

Chris Watson

unread,
Oct 23, 2020, 6:25:13 PM10/23/20
to brainGr...@googlegroups.com
I've looked at your data. Across thresholds, there is essentially no difference among the graphs. That is, graph 1 has the same density for all thresholds; graph 2 has the same density for all thresholds (which may or may not be different from graph 1's density); etc.

This means that your thresholds were not chosen correctly. You must choose sensible thresholds and that should take care of the "bug" in MTPC. It is not really a bug because it occurs in cases like this when the contrast statistics are (nearly) identical across thresholds which should never happen in practice.

Chris
Reply all
Reply to author
Forward
0 new messages