"logical subscript too long" when running permutations

375 views
Skip to first unread message

Paul Tanger

unread,
May 19, 2015, 1:02:55 PM5/19/15
to rqtl...@googlegroups.com
Hi all,

I'm trying to run scanone permutations for several phenotypes.  This code works fine on my mac, but not on our linux server and I can't figure out why or exactly what this error is.  I tried to create a reproducible example, but neither hyper or listeria have multiple numerical phenotypes to test this with.  Any ideas or suggestions?

Thanks!

For various reasons we have an older version of R (3.0.2) and Rqtl (1.33-7) on both systems.

on the mac, runs fine:

> # calculate permutations
> perms = 10
> method = "hk"
> nodes = 1
>
> # get a list of phenotypes..
> phenos = as.data.frame(colnames(cross$pheno), stringsAsFactors=F)

> # don't include ID column..
> phenos = phenos[-1,]
>
> ptm <- proc.time()
> earlyqtlpermsscan1 = scanone(cross, pheno.col=phenos[1:2], method=method, n.perm=perms, n.cluster=nodes, addcovar=NULL, verbose=T)
Permutation 1
Permutation 2
Permutation 3
Permutation 4
Permutation 5
Permutation 6
Permutation 7
Permutation 8
Permutation 9
Permutation 10
> proc.time() - ptm
   user  system elapsed
 
6.067   2.563   8.651

    but on the server:
  
> ptm <- proc.time()
> earlyqtlpermsscan1 = scanone(cross, pheno.col=phenos[1:2], method=method, n.perm=perms, n.cluster=nodes, addcovar=NULL, verbose=T)
Permutation 1
Permutation 2
Permutation 3
Permutation 4
Permutation 5
Permutation 6
Permutation 7
Permutation 8
Permutation 9
Permutation 10
> proc.time() - ptm
   user  system elapsed
 
7.732   0.321   8.045
<simpleError in unclass(x)[repl, lodcolumn, drop = FALSE]: (subscript) logical subscript too long>

Karl Broman

unread,
May 19, 2015, 1:16:43 PM5/19/15
to rqtl...@googlegroups.com
It seems like the problem occurs in this line in subset.scanoneperm:

https://github.com/kbroman/qtl/blob/master/R/summary.scanone.R#L1127

Somehow one of the two index vectors is too long. But I can't tell why that would happen, or why it would be different between the two OSs.

karl
> --
> You received this message because you are subscribed to the Google Groups "R/qtl discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rqtl-disc+...@googlegroups.com.
> To post to this group, send email to rqtl...@googlegroups.com.
> Visit this group at http://groups.google.com/group/rqtl-disc.
> For more options, visit https://groups.google.com/d/optout.

Paul Tanger

unread,
May 19, 2015, 1:23:22 PM5/19/15
to rqtl...@googlegroups.com
As in my phenotype column names are too long?  How long is "too long"?

You received this message because you are subscribed to a topic in the Google Groups "R/qtl discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rqtl-disc/DTyaRFwq87I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rqtl-disc+...@googlegroups.com.

Karl Broman

unread,
May 19, 2015, 1:24:47 PM5/19/15
to rqtl...@googlegroups.com
No it's something worse than that... something like x is a matrix with 5 rows and repl is a logical vector with length > 5.

karl

> On May 19, 2015, at 12:02 PM, Paul Tanger <pault...@gmail.com> wrote:
>

Karl Broman

unread,
May 19, 2015, 1:25:26 PM5/19/15
to rqtl...@googlegroups.com
Can you try installing the latest version of R/qtl (1.36-6) and see if the problem still occurs?

karl

> On May 19, 2015, at 12:02 PM, Paul Tanger <pault...@gmail.com> wrote:
>

Paul Tanger

unread,
May 19, 2015, 2:34:03 PM5/19/15
to rqtl...@googlegroups.com
Interesting.  It works with the updated Rqtl 1.36-6. 
I did a little more testing, and it appears to be an issue with the R version.  
If I try R 3.1.2 with old Rqtl 1.33-7 it works, but R 3.0.2 and any version of Rqtl it doesn't work.

I'm not sure what I should do because I don't want to update R with people in mid-projects but Rstudio Server doesn't work with multiple R versions.

But thanks for helping me get this far!

You received this message because you are subscribed to a topic in the Google Groups "R/qtl discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rqtl-disc/DTyaRFwq87I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rqtl-disc+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages