Hi Karl,
As in my PhD, I'm working
together with several companies, the data is confidential, so not sure
if I can share the real data here.
But I can share with you the code/script I used:
So I start with the read.cross function, and then the jittermap function:
stuntRIL
<- read.cross("csv", file="newmapXX.csv", genotypes = c ("AA", "AB",
"BB"), na.strings="-", alleles=c("A", "B"), crosstype="riself")
stuntRIL2 <- jittermap(stuntRIL)
Then I add the covariate I work with:
covarAB <- cbind(Area, Block)
(I use a blocking design in my experiment, so I use the Block as a
covariate, and then also size of the individuals as another covariate)
Then I perform the scanone, with and without the covariate:
out.0 <-scanone(stuntRIL2, method="em", pheno.col=1)
perm.0 <- scanone(stuntRIL2, method="em", pheno.col=1, n.perm=500, n.cluster=8)
summary(perm.0, a=c(0.05,0.01))
plot(out.0, ylab="LOD score", ylim=c(0,5)) + abline(h=2.7)
out.AB <-scanone(stuntRIL2, method="em", pheno.col=1, addcovar=covarAB)
perm.AB <- scanone(stuntRIL2, method="em", pheno.col=1, addcovar=covarAB, n.perm=1000, n.cluster=8)
summary(perm.AB, a=c(0.05,0.01))
plot(out.AB, ylab="LOD score", ylim=c(0,5)) + abline(h=2.85)
Until
so far, I get no errors. In both with and withouth the covariate, I get
several peaks, but only one reaches over the lod-treshold with a top
value of around 2.9. So really not much strong evidence for QTLs. That
could be because the phenotype I work with has a high degree of
variability.
Then I performed the scantwo function:
out2.0 <- scantwo(stuntRIL2, verbose=TRUE, pheno.col=1)
max(out2.0)
summary(out2.0, perms=Perm0, alphas=c(0.05, 0.05, 0.05, 0.05, 0.05), pvalues=TRUE, clean.output=TRUE)
Also
there no problems. As results I get one pair of QTLs when I set the
permutation treshold at a=0.05 (with LODs just slightly higher than the
treshold). I get 2 pairs when I set the threshold at a=0.10.
The problems then start when I start to build the multiple QTL model with the following script:
stuntRIL2 <- sim.geno(RIL2, step=2, n.draws=400, err=0.01)
qtl2.a
<- makeqtl(RIL2, chr=c(), pos=c()) (Chr. numbers and positions I
cannot publicly post on google due to the confidentiality of my project)
out.fqB2.a
<- fitqtl(RIL2, qtl=qtl2.a, formula=y~Q1+Q2+Q3+Q4+Q5+Q6 +Q1*Q2 +
Q3*Q4 +Covar1 +Block, dropone=TRUE, get.ests=TRUE, pheno.col=1,
covar=covarAB)
summary(out.fqB2.a)
result.a <- summary(out.fqB2.a)
rqtl2.a
<-refineqtl(RIL2, qtl=qtl2.a, formula=y~Q1+Q2+Q3+Q4+Q5+Q6 +Q1*Q2 +
Q3*Q4 +Covar1+Block, verbose=FALSE, pheno.col=1, covar=covarAB)
rqtl2.a
plot(rqtl2.a)
summary(rqtl2.a)
out.fqB3.a
<- fitqtl(RIL2, qtl=rqtl2.a, formula=y~Q1+Q2+Q3+Q4+Q5+Q6 +Q1*Q2 +
Q3*Q4 +Covar1+Block, dropone=TRUE, get.ests=TRUE, pheno.col=1,
covar=covarAB)
summary(out.fqB3.a)
Everything
seems to go OK, except when I run the refineqtl command. There I get
twice the error. I do still get the estimates end results from the
summary(out.fqB3.a) command, but not sure how reliable they still are
after these errors?Warning messages:
1: In min(diff(a)) : no non-missing arguments to min; returning Inf
2: In min(diff(a)) : no non-missing arguments to min; returning Inf
For the stepwiseQTL I use the following script:
As you can see I do the stepwise both without giving it the qtl model I built above, and with giving it the qtl model.
In both cases I get the same min(diff(a) errors.
stepperm.0 <- PermStep0
print(pen.0 <- calc.penalties(stepperm.0))
calc.penalties(stepperm.0, alpha=c(0.05, 0.20))
outsw.0 <- stepwiseqtl(stunt2, max.qtl=10, penalties=pen.0, verbose=TRUE, pheno.col=1)
outsw.0qtl <- stepwiseqtl(stunt2, qtl=rqtl2.0, max.qtl=10, penalties=pen.0, verbose=TRUE, pheno.col=1)
summary(outsw.0)
The output from the stepwiseQTL then looks like this:
-Initial scan
initial lod: 2.827926
no.qtl = 1 pLOD = -0.02451691 formula: y ~ Q1
-Step 1
---Scanning for additive qtl
plod = -0.7469474
---Scanning for QTL interacting with Q1
plod = -0.7027394
---Refining positions
no.qtl = 2 pLOD = -0.7027394 formula: y ~ Q1 + Q2 + Q1:Q2
-Step 2
---Scanning for additive qtl
plod = -0.8842487
---Scanning for QTL interacting with Q1
plod = -3.9645
---Scanning for QTL interacting with Q2
plod = -3.536162
---Look for additional interactions
---Refining positions
no.qtl = 3 pLOD = -0.8842487 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3
-Step 3
---Scanning for additive qtl
plod = -0.9683736
---Scanning for QTL interacting with Q1
plod = -4.418579
---Scanning for QTL interacting with Q2
plod = -3.000589
---Scanning for QTL interacting with Q3
plod = -1.843037
---Look for additional interactions
plod = -4.548217
---Refining positions
--- Moved a bit
no.qtl = 4 pLOD = -0.8705013 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4
-Step 4
---Scanning for additive qtl
plod = -1.536615
---Scanning for QTL interacting with Q1
plod = -3.438925
---Scanning for QTL interacting with Q2
plod = -3.742803
---Scanning for QTL interacting with Q3
plod = -2.029572
---Scanning for QTL interacting with Q4
plod = -2.143622
---Look for additional interactions
plod = -3.4315
---Refining positions
--- Moved a bit
no.qtl = 5 pLOD = -1.528168 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5
-Step 5
---Scanning for additive qtl
plod = -2.205181
---Scanning for QTL interacting with Q1
plod = -4.196796
---Scanning for QTL interacting with Q2
plod = -4.487766
---Scanning for QTL interacting with Q3
plod = -2.627724
---Scanning for QTL interacting with Q4
plod = -2.986355
---Scanning for QTL interacting with Q5
plod = -3.173026
---Look for additional interactions
plod = -4.233457
---Refining positions
no.qtl = 6 pLOD = -2.205181 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5 + Q6
-Step 6
---Scanning for additive qtl
plod = -2.210587
---Scanning for QTL interacting with Q1
plod = -5.279551
---Scanning for QTL interacting with Q2
plod = -5.481877
---Scanning for QTL interacting with Q3
plod = -2.606345
---Scanning for QTL interacting with Q4
plod = -3.372474
---Scanning for QTL interacting with Q5
plod = -3.319364
---Scanning for QTL interacting with Q6
plod = -2.43476
---Look for additional interactions
plod = -4.891239
---Refining positions
no.qtl = 7 pLOD = -2.210587 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5 + Q6 + Q7
-Step 7
---Scanning for additive qtl
plod = -3.011286
---Scanning for QTL interacting with Q1
plod = -5.882255
---Scanning for QTL interacting with Q2
plod = -6.259255
---Scanning for QTL interacting with Q3
plod = -3.850898
---Scanning for QTL interacting with Q4
plod = -3.32442
---Scanning for QTL interacting with Q5
plod = -4.061947
---Scanning for QTL interacting with Q6
plod = -3.870089
---Scanning for QTL interacting with Q7
plod = -3.236299
---Look for additional interactions
plod = -2.43476
---Refining positions
--- Moved a bit
no.qtl = 7 pLOD = -2.393031 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q6:Q7
-Step 8
---Scanning for additive qtl
plod = -3.384163
---Scanning for QTL interacting with Q1
plod = -6.58248
---Scanning for QTL interacting with Q2
plod = -6.881917
---Scanning for QTL interacting with Q3
plod = -3.774467
---Scanning for QTL interacting with Q4
plod = -3.79439
---Scanning for QTL interacting with Q5
plod = -4.45029
---Scanning for QTL interacting with Q6
plod = -6.782717
---Scanning for QTL interacting with Q7
plod = -6.343433
---Look for additional interactions
plod = -5.314793
---Refining positions
--- Moved a bit
no.qtl = 8 pLOD = -3.370052 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q6:Q7 + Q8
-Step 9
---Scanning for additive qtl
plod = -4.526974
---Scanning for QTL interacting with Q1
plod = -8.207325
---Scanning for QTL interacting with Q2
plod = -7.945324
---Scanning for QTL interacting with Q3
plod = -5.24144
---Scanning for QTL interacting with Q4
plod = -5.849364
---Scanning for QTL interacting with Q5
plod = -5.465123
---Scanning for QTL interacting with Q6
plod = -7.640773
---Scanning for QTL interacting with Q7
plod = -7.445907
---Scanning for QTL interacting with Q8
plod = -4.67991
---Look for additional interactions
plod = -3.729001
---Refining positions
--- Moved a bit
no.qtl = 8 pLOD = -3.661782 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q6:Q7 + Q8 + Q4:Q8
-Step 10
---Scanning for additive qtl
plod = -4.873168
---Scanning for QTL interacting with Q1
plod = -8.180601
---Scanning for QTL interacting with Q2
plod = -8.263317
---Scanning for QTL interacting with Q3
plod = -5.238266
---Scanning for QTL interacting with Q4
plod = -8.317964
---Scanning for QTL interacting with Q5
plod = -5.953323
---Scanning for QTL interacting with Q6
plod = -8.145952
---Scanning for QTL interacting with Q7
plod = -7.804813
---Scanning for QTL interacting with Q8
plod = -7.050537
---Look for additional interactions
plod = -8.659158
---Refining positions
--- Moved a bit
no.qtl = 9 pLOD = -4.469088 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q6:Q7 + Q8 + Q4:Q8 + Q9
-Step 11
---Scanning for additive qtl
plod = -5.49663
---Scanning for QTL interacting with Q1
plod = -9.108128
---Scanning for QTL interacting with Q2
plod = -9.09262
---Scanning for QTL interacting with Q3
plod = -6.356448
---Scanning for QTL interacting with Q4
plod = -8.828459
---Scanning for QTL interacting with Q5
plod = -6.570825
---Scanning for QTL interacting with Q6
plod = -8.600178
---Scanning for QTL interacting with Q7
plod = -8.184486
---Scanning for QTL interacting with Q8
plod = -7.973686
---Scanning for QTL interacting with Q9
plod = -6.521231
---Look for additional interactions
plod = -9.21341
---Refining positions
--- Moved a bit
no.qtl = 10 pLOD = -5.327537 formula: y ~ Q1 + Q2 + Q1:Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q6:Q7 + Q8 + Q4:Q8 + Q9 + Q10
-Starting backward deletion
---Dropping Q9
no.qtl = 9 pLOD = -4.20007 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q8 + Q9 + Q1:Q2 + Q6:Q7 + Q4:Q8
---Refining positions
--- Moved a bit
---Dropping Q6:Q7
no.qtl = 9 pLOD = -3.798451 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q8 + Q9 + Q1:Q2 + Q4:Q8
---Refining positions
--- Moved a bit
---Dropping Q3
no.qtl = 8 pLOD = -3.119903 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q8 + Q1:Q2 + Q3:Q7
---Refining positions
--- Moved a bit
---Dropping Q3:Q7
no.qtl = 8 pLOD = -2.705104 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q8 + Q1:Q2
---Refining positions
--- Moved a bit
---Dropping Q5
no.qtl = 7 pLOD = -2.223793 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q1:Q2
---Refining positions
--- Moved a bit
---Dropping Q5
no.qtl = 6 pLOD = -1.703857 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q1:Q2
---Refining positions
---Dropping Q3
no.qtl = 5 pLOD = -1.106742 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q1:Q2
---Refining positions
--- Moved a bit
---Dropping Q4
no.qtl = 4 pLOD = -1.222707 formula: y ~ Q1 + Q2 + Q3 + Q4 + Q1:Q2
---Refining positions
--- Moved a bit
---Dropping Q3
no.qtl = 3 pLOD = -0.8842487 formula: y ~ Q1 + Q2 + Q3 + Q1:Q2
---Refining positions
---Dropping Q3
no.qtl = 2 pLOD = -0.7027394 formula: y ~ Q1 + Q2 + Q1:Q2
---Refining positions
---Dropping Q2
no.qtl = 1 pLOD = -0.02451691 formula: y ~ Q1
---Refining positions
After that, I get 44 warnings, all the "same min(diff(a): no non-missing arguments to min; returning Inf" message.
I also did the stepwise analysis again with my covariates included, and still get the same errors.
Does this information help?
Thanks!
Jasper
Op maandag 16 september 2019 22:02:48 UTC+2 schreef Karl Broman: