Error when performing permutation tests in scantwo()

178 views
Skip to first unread message

Elisa Zhang

unread,
May 17, 2012, 6:34:46 PM5/17/12
to R/qtl discussion
Hi,

I'm running scantwo() on an F2 intercross with the "binary" model. The
highest LOD scores I get are 5-6 in both the hk and em method. (both
are LOD scores for the full model of two-QTL)

So, I'm trying to do permutations to find what the significance
threshold is. However, I get the following error message when I try to
use scantwo() to do permutations and the output value is never made:

> operm2.hk <- scantwo(data2.binary, method="hk", model="binary", n.perm=100, verbose=FALSE)
Error in if (totmar(x) != ncol(x$rf)) x <- clean(x) else { :
argument is of length zero
In addition: There were 50 or more warnings (use warnings() to see the
first 50). #the error messages say: "didn't converge"
> operm2.em <- scantwo(data2.binary, method="em", model="binary", n.perm=100, verbose=FALSE)
Error in if (totmar(x) != ncol(x$rf)) x <- clean(x) else { :
argument is of length zero


I'd be very grateful if someone could provide some help as to why this
is happening. I did this whole process in scanone() without any
problems; the highest LOD scores I got from that were at the 26%
significance level.

Thanks so much!

Elisa


P.S. The details of my cross object are here:
> summary(data2.binary)
F2 intercross

No. individuals: 148

No. phenotypes: 1
Percent phenotyped: 100

No. chromosomes: 39
Autosomes: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
19 20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39

Total markers: 115
No. markers: 8 6 7 11 4 5 8 3 5 3 2 4 2 3 3 3 4 2 3 4 2 3 2
2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Percent genotyped: 86.1
Genotypes (%): AA:24 AB:46.4 BB:24.5 not BB:3 not AA:2.1

Karl Broman

unread,
May 17, 2012, 10:49:07 PM5/17/12
to rqtl...@googlegroups.com
It's hard to tell what's going wrong without seeing the data, but the error message suggests that there's something odd within the data2.binary object.

Try doing

data2.binary$rf <- NULL

and then try running the scantwo permutations again.

karl
> --
> You received this message because you are subscribed to the Google Groups "R/qtl discussion" group.
> To post to this group, send email to rqtl...@googlegroups.com.
> To unsubscribe from this group, send email to rqtl-disc+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rqtl-disc?hl=en.
>

Elisa Zhang

unread,
May 21, 2012, 4:15:11 PM5/21/12
to R/qtl discussion
Hi Karl,

Thanks! It seemed to work; I no longer got an error message.

So, I'm trying to run scantwo() permutation again, but on a non-binary
version (normal version) of the data. I successfully ran scantwo(),
but again I ran into an error when I use scantwo() to do permutations.

I got a different error message this time:

> data2_operm2 <- scantwo(data2, method="hk", n.perm=100,
verbose=FALSE)
Error in `diag<-`(`*tmp*`, value = 0.169086967416604) :
only matrix diagonals can be replaced

I tried doing data2.binary$rf <- NULL, but it didn't seem to help:

> data2$rf <- NULL
> data2_operm2 <- scantwo(data2, method="hk", n.perm=100,
verbose=FALSE)
Error in `diag<-`(`*tmp*`, value = 0.113453641975696) :
only matrix diagonals can be replaced

Any advice on what this error message means would be appreciated.
Thank you again!

Elisa

Karl Broman

unread,
May 21, 2012, 8:06:31 PM5/21/12
to rqtl...@googlegroups.com
I can't tell what's going on; could you send the data or more detail of the code?
If you restrict the analysis to the chromosomes with more markers, do you still get the error?
For example:

data2_operm2 <- scantwo(data2, method="hk", n.perm=100, verbose=FALSE, chr=1:5)

karl

Karl Broman

unread,
May 25, 2012, 12:23:13 AM5/25/12
to rqtl...@googlegroups.com
There's a definite bug here.  It happens for chromosomes with markers that span less than the step size used in calc.genoprob.
It will take a while to resolve.

In the meantime, try using incl.markers=TRUE

data2_operm2 <- scantwo(data2, method="hk", n.perm=100, verbose=FALSE,
                                    incl.markers=TRUE) 

karl
Reply all
Reply to author
Forward
0 new messages