Zooming in on plot_coefCC

66 views
Skip to first unread message

Mark Sfeir

unread,
Jul 28, 2022, 3:54:48 PM7/28/22
to R/qtl2 discussion

Is there a way to use the plot_coefCC() function to zoom in on the effects in a small interval of a chromosome? I tried indexing the coefficients/LOD/map input to the plot_coefCC function, but received an error.

Context:

For a DO mouse study, when calculating QTL effects coefficients using scan1coef and then plotting with plot_coefCC(), I've encountered a situation where the LOD peak of interest (and corresponding effects coefficients) are so far to one end of the marker interval on the chromosome that it is hard to see on the standard plot_coefCC() plot, which shows the effects across an entire chromosome.

I'm attaching a snapshot of my terminal ("LOD_max_position_capture.png") that shows how the max lod score of interest is at a position near one end of chromosome 10 in terms of cM position, in addition to the same phenotype's corresponding QTL effect coefficients/LOD plot ("w12_HFD_fat_g_no13_coefCC.png") where the max LOD region can't be seen.

Not sure what it means when a QTL is very close to an end of a chromosome.

-Mark

LOD_max_position_capture.PNG
w12_HFD_fat_g_no13_coefCC.png

Dan Gatti

unread,
Jul 28, 2022, 3:54:57 PM7/28/22
to rqtl2...@googlegroups.com

Can you use xlim = c(start, end) in plot_coefCC()?

--
You received this message because you are subscribed to the Google Groups "R/qtl2 discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rqtl2-disc+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rqtl2-disc/a913da78-d88d-4fcf-a3d8-5b94f799f721n%40googlegroups.com.

---

The information in this email, including attachments, may be confidential and is intended solely for the addressee(s). If you believe you received this email by mistake, please notify the sender by return email as soon as possible.

Karl Broman

unread,
Jul 28, 2022, 6:34:54 PM7/28/22
to R/qtl2 discussion
Yes, as Dan suggests, you can use xlim in the call to plot_coefCC(). Here's an example:

library(qtl2)
DOex <- read_cross2(file)
pr <- calc_genoprob(DOex, error_prob=0.002, cores=0)
apr <- genoprob_to_alleleprob(pr)
sex <- setNames( (DOex$covar$Sex == "male")*1, rownames(DOex$covar) )
k <- calc_kinship(apr, "loco")
out <- scan1(apr, DOex$pheno, k, sex)
coef_c2 <- scan1coef(apr[,"2"], DOex$pheno, k[["2"]], sex)
plot_coefCC(coef_c2, DOex$gmap["2"], bgcolor="gray95", legend="bottomleft", xlim=c(50, 55))

Personally, I prefer to make a plot of the estimated effects at the estimated QTL location. Like this:

qtl_pos <- max(out, DOex$gmap)
apr_at_qtl <- pull_genoprobpos(apr, DOex$gmap, qtl_pos$chr, qtl_pos$pos)
out_fit1 <- fit1(apr_at_qtl, DOex$pheno, k[[qtl_pos$chr]], sex)

library(broman)
ciplot(out_fit1$coef[1:8], out_fit1$SE[1:8], xlab="QTL allele")

Mark Sfeir

unread,
Jul 29, 2022, 2:35:39 PM7/29/22
to R/qtl2 discussion
Thank you both! How convenient. 

Mark Sfeir

unread,
Sep 2, 2022, 3:23:14 PM9/2/22
to R/qtl2 discussion
I am having trouble using plot_coefCC() with the mfrow plotting parameter for multiple qtl effects plots in a frame. Any guidance here? I'm not sure if an mfrow method or something like it exists for this plotting function? 

Karl Broman

unread,
Sep 2, 2022, 4:37:33 PM9/2/22
to R/qtl2 discussion
The problem is like that if you use options that create multiple panels, they're using the equivalent of mfrow to create the layout, and you can't nest two of those.

For example, if you want coefficients and lod curves, it'll pass you to plot_coef_and_lod(), which uses layout(), which is a fancier version of par(mfrow).


So I think you're stuck using the small pieces and assembling them yourself.

karl

Mark Sfeir

unread,
Sep 6, 2022, 10:18:50 AM9/6/22
to rqtl2...@googlegroups.com
That makes sense. Thank you!

You received this message because you are subscribed to a topic in the Google Groups "R/qtl2 discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rqtl2-disc/33zps2BDKEw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rqtl2-disc+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rqtl2-disc/99e066a2-2881-4ea8-be93-04a626f06d43n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages