Single marker analysis with R/qtl

1,342 views
Skip to first unread message

Ramesh Bhat

unread,
Mar 29, 2019, 7:27:39 AM3/29/19
to R/qtl discussion
Hi,

Can we do single marker analysis with R/qtl?

Please suggest the functions and scripts.

Kind regards,

Karl Broman

unread,
Mar 29, 2019, 7:34:40 AM3/29/19
to rqtl...@googlegroups.com
It is not recommended, but you can use scanone() with method="mr" for
"marker regression".
Best to use method="em" or method="hk".

karl

Ramesh Bhat

unread,
Mar 29, 2019, 8:08:07 AM3/29/19
to R/qtl discussion

Are the codes and sample data file available for single marker analysis?

Karl Broman

unread,
Mar 29, 2019, 8:13:47 AM3/29/19
to rqtl...@googlegroups.com
The data file would be the same; sample data files at http://rqtl.org/sampledata

Marker discussion is discussed at the beginning of chapter 4 of the R/qtl book, http://rqtl.org/book/

It’s not discussed in the tutorials (http://rqtl.org/tutorials), because I strongly recommend against it.

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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.

Ramesh Bhat

unread,
Mar 29, 2019, 8:53:28 AM3/29/19
to R/qtl discussion
Where can I get hyper.csv file?

Karl Broman

unread,
Mar 29, 2019, 9:32:33 AM3/29/19
to rqtl...@googlegroups.com
The hyper data are included with R/qtl, in its internal format:

  library(qtl)
  data(hyper)
  ls()

We don't have a CSV file available, but you could write it to a file
with write.cross():

  write.cross(hyper, "csv", "hyper")

this will create a file "hyper.csv" in your R working directory.

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
> <mailto:rqtl-disc+...@googlegroups.com>.
> To post to this group, send email to rqtl...@googlegroups.com
> <mailto:rqtl...@googlegroups.com>.

Ramesh Bhat

unread,
Mar 29, 2019, 9:48:28 AM3/29/19
to R/qtl discussion
Thanks.

You are simply great.

kind regards,


On Friday, March 29, 2019 at 4:57:39 PM UTC+5:30, Ramesh Bhat wrote:

Ramesh Bhat

unread,
Mar 29, 2019, 11:36:44 AM3/29/19
to rqtl...@googlegroups.com
How about single marker analysis for many traits? Should we do it separately or can we do it with reiteration?

May I know the codes?

Karl Broman

unread,
Mar 29, 2019, 11:41:51 AM3/29/19
to rqtl...@googlegroups.com
You can analyze them individually or together. See page 5 of http://rqtl.org/tutorials/rqtltour2.pdf

karl

Ramesh Bhat

unread,
Mar 29, 2019, 11:53:13 AM3/29/19
to rqtl...@googlegroups.com
Thanks. If I have the trait values in col 2 to 10, can I club them like phono.col2:10?

  1. out.hr <- scanone(sug, pheno.col=2:10, method="hk)
    


Ramesh Bhat

unread,
Apr 3, 2019, 10:08:25 AM4/3/19
to rqtl...@googlegroups.com
D
SMA.csv

Karl Broman

unread,
Apr 3, 2019, 11:22:28 AM4/3/19
to rqtl...@googlegroups.com
R/qtl is not the appropriate software for such data.

karl

On Apr 3, 2019, at 4:08 PM, Ramesh Bhat <bhatra...@gmail.com> wrote:

Dear Dr. Karl,

Here is a sample file with two traits (trait1 and trait2) and three markers (marker1, marker2 and marker3).

Can you please provide me the codes for single marker analysis (trait1~marker1, trait1~marker2, trait1~marker3, trait2~marker1, trait2~marker2 and trait2~marker3)?

Kind regards,

Ramesh Bhat

unread,
Apr 5, 2019, 10:12:51 PM4/5/19
to rqtl...@googlegroups.com
With respect to the sample data file “sug.csv”, should we mention CC, BB or CB? or can we give it as C, B or H?

Karl Broman

unread,
Apr 6, 2019, 8:57:47 AM4/6/19
to rqtl...@googlegroups.com
You can use any encoding provided that you are consistent across all markers. You indicate your genotype codes with the ‘genotype’ argument in read.cross().

karl

Ramesh Bhat

unread,
Apr 7, 2019, 9:38:49 AM4/7/19
to rqtl...@googlegroups.com
How does scanone function varies from single marker analysis?

Ramesh Bhat

unread,
Apr 7, 2019, 9:41:47 AM4/7/19
to rqtl...@googlegroups.com
How does scanone function vary/differ from single marker analysis?

Karl Broman

unread,
Apr 8, 2019, 9:14:05 AM4/8/19
to rqtl...@googlegroups.com
scanone performs a genome scan with a single-QTL model, considering each
location in the genome, one at a time, as the possible QTL.
The genome scan can be performed by multiple methods.

In "single marker analysis", one would consider each marker one at a
time, but would have to omit any individuals that have missing genotype
at the marker.

An improvement on that is interval mapping (Lander and Botstein 1989),
which uses information at surrounding markers to essentially infer
genotype for the individuals with missing marker genotype. This method
also allows you to interrogate positions between markers.

For more details, see Chapter 4 of the R/qtl book
(http://rqtl.org/book), or this review:

https://www.biostat.wisc.edu/~kbroman/publications/labanimal.pdf

karl

On 4/7/19 8:38 AM, Ramesh Bhat wrote:
> How does scanone function varies from single marker analysis?
>
>
>
>> On 06-04-2019, at 6:27 PM, Karl Broman <kbr...@gmail.com
>> <mailto:kbr...@gmail.com>> wrote:
>>
>> You can use any encoding provided that you are consistent across all
>> markers. You indicate your genotype codes with the ‘genotype’
>> argument in read.cross().
>>
>> karl
>>
>> On Apr 5, 2019, at 9:12 PM, Ramesh Bhat <bhatra...@gmail.com
>> <mailto:bhatra...@gmail.com>> wrote:
>>
>>> With respect to the sample data file “sug.csv”, should we mention
>>> CC, BB or CB? or can we give it as C, B or H?
>>>
>>>
>>>
>>>> On 03-04-2019, at 8:52 PM, Karl Broman <kbr...@gmail.com
>>>> <mailto:kbr...@gmail.com>> wrote:
>>>>
>>>> R/qtl is not the appropriate software for such data.
>>>>
>>>> karl
>>>>
>>>> On Apr 3, 2019, at 4:08 PM, Ramesh Bhat <bhatra...@gmail.com
>>>> <mailto:bhatra...@gmail.com>> wrote:
>>>>
>>>>> Dear Dr. Karl,
>>>>>
>>>>> Here is a sample file with two traits (trait1 and trait2) and
>>>>> three markers (marker1, marker2 and marker3).
>>>>>
>>>>> Can you please provide me the codes for single marker analysis
>>>>> (trait1~marker1, trait1~marker2, trait1~marker3, trait2~marker1,
>>>>> trait2~marker2 and trait2~marker3)?
>>>>>
>>>>> Kind regards,
>>>>>
>>>>>> On 29-Mar-2019, at 9:11 PM, Karl Broman <kbr...@gmail.com
>>>>>> <mailto:kbr...@gmail.com>> wrote:
>>>>>>
>>>>>> You can analyze them individually or together. See page 5 of
>>>>>> http://rqtl.org/tutorials/rqtltour2.pdf
>>>>>>
>>>>>> karl
>>>>>>
>>>>>> On Mar 29, 2019, at 10:36 AM, Ramesh Bhat <bhatra...@gmail.com
>>>>>> <mailto:bhatra...@gmail.com>> wrote:
>>>>>>
>>>>>>> How about single marker analysis for many traits? Should we do
>>>>>>> it separately or can we do it with reiteration?
>>>>>>>
>>>>>>> May I know the codes?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On 29-Mar-2019, at 5:43 PM, Karl Broman <kbr...@gmail.com
>>>>>>>> <mailto:kbr...@gmail.com>> wrote:
>>>>>>>>
>>>>>>>> The data file would be the same; sample data files at
>>>>>>>> http://rqtl.org/sampledata
>>>>>>>>
>>>>>>>> Marker discussion is discussed at the beginning of chapter 4 of
>>>>>>>> the R/qtl book, http://rqtl.org/book/
>>>>>>>>
>>>>>>>> It’s not discussed in the tutorials
>>>>>>>> (http://rqtl.org/tutorials), because I strongly recommend
>>>>>>>> against it.
>>>>>>>>
>>>>>>>> karl
>>>>>>>>
>>>>>>>> On Mar 29, 2019, at 7:08 AM, Ramesh Bhat
>>>>>>>> <bhatra...@gmail.com <mailto:bhatra...@gmail.com>> wrote:
>>>>>>>>
>>>>>>>>> On Friday, March 29, 2019 at 5:04:40 PM UTC+5:30, Karl Broman
>>>>>>>>> wrote:
>>>>>>>>>> It is not recommended, but you can use scanone() with
>>>>>>>>>> method="mr" for
>>>>>>>>>> "marker regression".
>>>>>>>>>> Best to use method="em" or method="hk".
>>>>>>>>>>
>>>>>>>>>> karl
>>>>>>>>>>
>>>>>>>>>> On 3/29/19 6:27 AM, Ramesh Bhat wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Can we do single marker analysis with R/qtl?
>>>>>>>>>>>
>>>>>>>>>>> Please suggest the functions and scripts.
>>>>>>>>>>>
>>>>>>>>>>> Kind regards,
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Are the codes and sample data file available for single marker
>>>>>>>>> analysis?
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> 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
>>>>>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>>>>>> To post to this group, send email to
>>>>>>>>> rqtl...@googlegroups.com <mailto:rqtl...@googlegroups.com>.
>>>>>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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
>>>>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>>>>> To post to this group, send email to rqtl...@googlegroups.com
>>>>>>>> <mailto:rqtl...@googlegroups.com>.
>>>>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> 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
>>>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>>>> To post to this group, send email to rqtl...@googlegroups.com
>>>>>>> <mailto:rqtl...@googlegroups.com>.
>>>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>> --
>>>>>> 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
>>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>>> To post to this group, send email to rqtl...@googlegroups.com
>>>>>> <mailto:rqtl...@googlegroups.com>.
>>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>> To post to this group, send email to rqtl...@googlegroups.com
>>>>> <mailto:rqtl...@googlegroups.com>.
>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>>> 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
>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>> To post to this group, send email to rqtl...@googlegroups.com
>>>> <mailto:rqtl...@googlegroups.com>.
>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
>>> 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
>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>> To post to this group, send email to rqtl...@googlegroups.com
>>> <mailto:rqtl...@googlegroups.com>.
>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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
>> <mailto:rqtl-disc+...@googlegroups.com>.
>> To post to this group, send email to rqtl...@googlegroups.com
>> <mailto:rqtl...@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/rqtl-disc.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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
> <mailto:rqtl-disc+...@googlegroups.com>.
> To post to this group, send email to rqtl...@googlegroups.com
> <mailto:rqtl...@googlegroups.com>.

Ramesh Bhat

unread,
Apr 10, 2019, 11:11:13 AM4/10/19
to rqtl...@googlegroups.com

Dear Dr. Broman,

Can I expect an improvement in R/qtl for

1. Better quality of the figure for genetic map

2. Exporting the map order of the markers on the chromosome to a csv or txt file.

Bhat


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.

Karl Broman

unread,
Apr 10, 2019, 11:29:34 AM4/10/19
to R/qtl discussion


On Wednesday, April 10, 2019 at 10:11:13 AM UTC-5, Ramesh Bhat wrote:
Can I expect an improvement in R/qtl for

1. Better quality of the figure for genetic map


No, I'm not planning to put any more effort into plotting genetic maps.
 

2. Exporting the map order of the markers on the chromosome to a csv or txt file.



You can currently use pull.map() and map2table() to get the genetic map as a data frame. You can then use write.csv() to write it to a csv file.

karl

Ramesh Bhat

unread,
Apr 10, 2019, 11:39:11 AM4/10/19
to rqtl...@googlegroups.com
Thanks.

Sorry to know that you are not planning to improve the map. Any other clear alternative method do you suggest?

Can you please provide me some more details on the use of pull.map() and map2table() to get the genetic map as a data frame?

Is the write.csv() for pull.map and map2table?

Regards,

Ramesh Bhat

unread,
Apr 10, 2019, 11:43:37 AM4/10/19
to rqtl...@googlegroups.com
I purchased your book on R/qtl today.

Regards,


Ramesh Bhat

unread,
Apr 10, 2019, 12:01:11 PM4/10/19
to rqtl...@googlegroups.com
Thanks.

Sorry to know that you are not planning to improve the map. Any other clear alternative method do y

Can you please provide me some more details on the use of pull.map() and map2table() to get the genetic map as a data frame?

Is the write.csv() for pull.map and map2table?

Regards,

Karl Broman

unread,
Apr 10, 2019, 12:23:51 PM4/10/19
to rqtl...@googlegroups.com


On 4/10/19 10:39 AM, Ramesh Bhat wrote:
>
> Sorry to know that you are not planning to improve the map. Any other
> clear alternative method do you suggest?
>

Maybe look at LinkageMapView,
https://cran.r-project.org/package=LinkageMapView

> Can you please provide me some more details on the use of pull.map()
> and map2table() to get the genetic map as a data frame?

    data(hyper)
    map <- pull.map(hyper)
    map_as_table <- map2table(map)


>
> Is the write.csv() for pull.map and map2table?
>
>

write.csv() is a base R function for writing an object to a CSV file.

    write.csv(map_as_table, "map.csv")

write.table() is a bit more flexible.

    write.table(map_as_table, "map.csv", row.names=TRUE,
col.names=TRUE, sep=",", quote=FALSE)

karl

Ramesh Bhat

unread,
Apr 11, 2019, 2:39:19 AM4/11/19
to rqtl...@googlegroups.com
Hi Karl,

Please find the attached file with the scripts for genetic map construction.

There are multiple scripts with pull.map() even for the same chromosome (for example; two for chr 5, four for chr 4 etc). Which one should I consider for the following function

data(mapthis)
map <- pull.map(mapthis, chr=5)
map_as_table <- map2table(map)

write.csv(map_as_table, "map.csv")


 Regards,



--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.


--
Ramesh S. Bhat
Professor and Head
Department of Biotechnology
University of Agricultural Sciences, Dharwad
PIN: 580 005, Dharwad, Karnataka, India
Ph: +91-836-2214457, Mobile: +91-9945667300
Map construction.docx

Ramesh Bhat

unread,
Apr 11, 2019, 5:17:37 AM4/11/19
to rqtl...@googlegroups.com
Dear Karl,
I have the following questions.
1. Does "summary(rip5lik)” show only the best order?
                                        LOD chrlen
Initial  1 2 3 4 5 6 7 8 9     0.0   38.2
1        1 2 3 4 5 6 7 9 8     0.1   38.4 
2. How to get the list of unmapped markers?
3. If window is equal to the number of markers on the chromosome, how to indicate in the following script 
rip5 <- ripple(mapthis, chr=5, window=7)
4. Reduced assumed genotyping error rate lead to increased map length: Is it always so, why?
5. Can I see all the orders in
summary(rip5)
                                      obligXO
Initial  1 2 3 4 5 6 7 8 9     215
1        1 2 3 4 5 6 7 9 8     216
2        1 2 3 4 6 5 7 8 9     217

6. Can I see a particular order (say order number 101), and is the order 1 the best among the 18000 in terms of obligXO in


rip4 <- ripple(mapthis, chr=4, window=7) 18000 total orders > summary(rip4) obligXO Initial 1 2 3 4 5 6 7 8 9 10 326 1 1 2 3 4 5 6 7 8 10 9 326
Bhat


Ramesh Bhat

unread,
Apr 11, 2019, 6:33:04 AM4/11/19
to rqtl...@googlegroups.com
Where can I find the following functions decried in chapter 4 of your book

plot.pxg(hyper, "D4Mit214")

plot.pxg(hyper, "D12Mit20")

I get the following error message
Error in plot.pxg(hyper, "D12Mit20") : could not find function “plot.pxg"


Karl Broman

unread,
Apr 11, 2019, 9:03:30 AM4/11/19
to rqtl...@googlegroups.com
Use plotPXG(). A number of functions had to be renamed; see http://rqtl.org/book/#errata

karl

Karl Broman

unread,
Apr 11, 2019, 9:04:28 AM4/11/19
to rqtl...@googlegroups.com
Use whichever one has the markers in the order that you want to save.

karl
<Map construction.docx>

Karl Broman

unread,
Apr 11, 2019, 9:09:45 AM4/11/19
to rqtl...@googlegroups.com

1. Does "summary(rip5lik)” show only the best order?
                                        LOD chrlen
Initial  1 2 3 4 5 6 7 8 9     0.0   38.2
1        1 2 3 4 5 6 7 9 8     0.1   38.4 

The summary shows the initial and any orders that appear better.

2. How to get the list of unmapped markers?
I’m not sure what you mean.

3. If window is equal to the number of markers on the chromosome, how to indicate in the following script 
rip5 <- ripple(mapthis, chr=5, window=7)
I’m not sure what you mean.
4. Reduced assumed genotyping error rate lead to increased map length: Is it always so, why?
I wouldn’t say always, but generally if you lower the assumed genotyping error rate, there will be more things viewed as double-crossovers that otherwise might be viewed as genotyping errors.

5. Can I see all the orders in
summary(rip5)
                                      obligXO
Initial  1 2 3 4 5 6 7 8 9     215
1        1 2 3 4 5 6 7 9 8     216
2        1 2 3 4 6 5 7 8 9     217

The output of ripple is a big matrix/data frame with each row being a different order.
If you type the name you’ll see all of them.

6. Can I see a particular order (say order number 101), and is the order 1 the best among the 18000 in terms of obligXO in


rip4 <- ripple(mapthis, chr=4, window=7) 18000 total orders > summary(rip4) obligXO Initial 1 2 3 4 5 6 7 8 9 10 326 1 1 2 3 4 5 6 7 8 10 9 326
Try rip4[101,]

karl

Ramesh Bhat

unread,
Apr 11, 2019, 9:25:36 AM4/11/19
to rqtl...@googlegroups.com

 

How to get the list of unmapped markers?

I’m not sure what you mean.

If there are 100 markers for mapping, say only 90 are mapped on the chromosomes. We say 10 are unmapped. Ex; C5M2 not mapped on chr 5 in “Mapthis”. Can we get a list of makers which are not mapped on any of the chromosomes?



If window is equal to the number of markers on the chromosome, how to indicate in the following script

rip5 <- ripple(mapthis, chr=5, window=7)

I’m not sure what you mean.

I do not want a window size of 7, instead I want all the markers on chr 5 for ripple. What change is to be made in the above script? Why do we fix a window size?

 

Bhat


Karl Broman

unread,
Apr 11, 2019, 9:36:13 AM4/11/19
to rqtl...@googlegroups.com


 

How to get the list of unmapped markers?

I’m not sure what you mean.

If there are 100 markers for mapping, say only 90 are mapped on the chromosomes. We say 10 are unmapped. Ex; C5M2 not mapped on chr 5 in “Mapthis”. Can we get a list of makers which are not mapped on any of the chromosomes?


You've maybe leave them on the last chromosome, and can get a list using markernames().




If window is equal to the number of markers on the chromosome, how to indicate in the following script

rip5 <- ripple(mapthis, chr=5, window=7)

I’m not sure what you mean.

I do not want a window size of 7, instead I want all the markers on chr 5 for ripple. What change is to be made in the above script? Why do we fix a window size?

 


change 7 to some other number. You fix a window size because if you have a chromosome with a lot of markers, the total number of possible orders will be too large. With window=7, you're only considered reordering 7 adjacent markers at a time.

karl

Ramesh Bhat

unread,
Apr 11, 2019, 9:52:55 AM4/11/19
to rqtl...@googlegroups.com
If there are several hundreds of markers, and many are unmapped, how to put them on the last chromosome?


Sent from my iPad
--
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/ZPwcHhO0T6Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rqtl-disc+...@googlegroups.com.

Karl Broman

unread,
Apr 11, 2019, 9:54:47 AM4/11/19
to rqtl...@googlegroups.com
You can use movemarker()

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.

Ramesh Bhat

unread,
Apr 11, 2019, 10:14:06 AM4/11/19
to rqtl...@googlegroups.com
Sorry, any example of movemarker()?
Say moving C5M2 to chro 4 (from chr 5).





Sent from my iPad

Karl Broman

unread,
Apr 11, 2019, 10:14:48 AM4/11/19
to rqtl...@googlegroups.com
Every function has a help file which includes examples.
Within R, type

  ?movemarker

karl

Ramesh Bhat

unread,
Apr 11, 2019, 10:48:14 AM4/11/19
to rqtl...@googlegroups.com
Can we know the position of the marker to be moved to a new chr?
Otherwise, it will be placed at the end of the chromosome.

Sent from my iPad

Karl Broman

unread,
Apr 11, 2019, 10:58:42 AM4/11/19
to rqtl...@googlegroups.com
you can specify the position to which you want to move it, or you can just have it placed some arbitrary distance off the end.

karl

Ramesh Bhat

unread,
Apr 11, 2019, 11:10:55 AM4/11/19
to rqtl...@googlegroups.com
Specifying a position on a new chromosome while moving a marker is possible if we know it.

Unless, we move, we will not know the position. Am I right?

In scanone, can we get the significance and effect for a marker?

In scanone, does the position of a marker influence the significance, LOd and effect?

Ramesh Bhat

unread,
Apr 12, 2019, 12:54:07 AM4/12/19
to rqtl...@googlegroups.com
Dear Karl,

Following are the scripts for Single-QTL analysis. The only change I made is to call the "hyper" file from my working directory. "hyperm" is identical to "hyper"

library(qtl)

hyper<-read.cross("csv",  file="hyperm.csv", crosstype="bc", genotypes=c(“AA”,”BB”, "AB"))

par(mfrow=c(1,2))

plotPXG(hyper, "D4Mit214")

plotPXG(hyper, "D12Mit20")

out.mr <- scanone(hyper, method="mr")

out.mr[ out.mr$chr == 12, ]

summary(out.mr, threshold=3)

max(out.mr)

plot(out.mr, chr=c(4, 12), ylab="LOD score")


But I get the following errors

summary(out.mr, threshold=3)

There were no LOD peaks above the threshold.


max(out.mr)

There were no LOD peaks above the threshold.


Kindly help me.


Ramesh Bhat

unread,
Apr 12, 2019, 5:19:33 AM4/12/19
to rqtl...@googlegroups.com
I am attempting map construction with my own data.

What do the numbers (marked red) in the following scripts mean?

mapthis <- subset(mapthis, ind=(ntyped(mapthis)>50))

todrop <- names(nt.bymar[nt.bymar < 200])

hist(cg[lower.tri(cg)], breaks=seq(0, 1, len=101), xlab="No. matching genotypes")

plot(dropone, lod=1, ylim=c(-100,0))

mapthis <- subset(mapthis, ind=(countXO(mapthis) < 50))


Should I change for my data?


On Thu, Apr 11, 2019 at 8:28 PM Karl Broman <kbr...@gmail.com> wrote:


--

Karl Broman

unread,
Apr 12, 2019, 7:12:38 AM4/12/19
to rqtl...@googlegroups.com


On 4/11/19 10:10 AM, Ramesh Bhat wrote:
> Specifying a position on a new chromosome while moving a marker is
> possible if we know it.
>
> Unless, we move, we will not know the position. Am I right?

you might move a set of markers onto a common chromosome, in an
arbitrary order, and then try to figure out the order.

>
> In scanone, can we get the significance and effect for a marker?
>
> In scanone, does the position of a marker influence the significance,
> LOd and effect?
>
>

We determine significance with a permutation test, using scanone() with
n.perm specified.
To get estimated effects at markers, you need to use makeqtl() and fitqtl().

The positions of the markers are extremely important.

karl

Karl Broman

unread,
Apr 12, 2019, 7:14:15 AM4/12/19
to rqtl...@googlegroups.com
Don't use method="mr". Marker regression performs badly when there is a
lot of missing genotype information.

karl

On 4/11/19 11:53 PM, Ramesh Bhat wrote:
> Dear Karl,
>
> Following are the scripts for Single-QTL analysis. The only change I
> made is to call the "hyper" file from my working directory. "hyperm"
> is identical to "hyper"
>
> library(qtl)
>
> hyper<-read.cross("csv",  file="hyperm.csv", crosstype="bc",
> genotypes=c(“AA”,”BB”, "AB"))
>
> par(mfrow=c(1,2))
>
> plotPXG(hyper, "D4Mit214")
>
> plotPXG(hyper, "D12Mit20")
>
> out.mr <http://out.mr> <- scanone(hyper, method="mr")
>
> out.mr <http://out.mr>[ out.mr <http://out.mr>$chr == 12, ]
>
> summary(out.mr <http://out.mr>, threshold=3)
>
> max(out.mr <http://out.mr>)
>
> plot(out.mr <http://out.mr>, chr=c(4, 12), ylab="LOD score")
>
>
> But I get the following errors
>
> summary(out.mr <http://out.mr>, threshold=3)
>
> There were no LOD peaks above the threshold.
>
>
> max(out.mr <http://out.mr>)
>
> There were no LOD peaks above the threshold.
>
>
> Kindly help me.
>
>
>
> On Thu, Apr 11, 2019 at 8:28 PM Karl Broman <kbr...@gmail.com
> <mailto:kbr...@gmail.com>> wrote:
>
> you can specify the position to which you want to move it, or you
> can just have it placed some arbitrary distance off the end.
>
> karl
>
> On 4/11/19 9:47 AM, Ramesh Bhat wrote:
>> Can we know the position of the marker to be moved to a new chr?
>> Otherwise, it will be placed at the end of the chromosome.
>>
>> Sent from my iPad
>>
>> On 11-Apr-2019, at 7:44 PM, Karl Broman <kbr...@gmail.com
>> <mailto:kbr...@gmail.com>> wrote:
>>
>>> Every function has a help file which includes examples.
>>> Within R, type
>>>
>>>   ?movemarker
>>>
>>> karl
>>>
>>> On 4/11/19 9:13 AM, Ramesh Bhat wrote:
>>>> Sorry, any example of movemarker()?
>>>> Say moving C5M2 to chro 4 (from chr 5).
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On 11-Apr-2019, at 7:24 PM, Karl Broman <kbr...@gmail.com
>>>> <mailto:kbr...@gmail.com>> wrote:
>>>>
>>>>> You can use movemarker()
>>>>>
>>>>> karl
>>>>>
>>>>> On 4/11/19 8:52 AM, Ramesh Bhat wrote:
>>>>>> If there are several hundreds of markers, and many are
>>>>>> unmapped, how to put them on the last chromosome?
>>>>>>
>>>>>>
>>>>>> Sent from my iPad
>>>>>>
>>>>>> On 11-Apr-2019, at 7:06 PM, Karl Broman <kbr...@gmail.com
>>>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>>>> To post to this group, send email to
>>>>>>> rqtl...@googlegroups.com <mailto:rqtl...@googlegroups.com>.
>>>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>> --
>>>>>> 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
>>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>>> To post to this group, send email to
>>>>>> rqtl...@googlegroups.com <mailto:rqtl...@googlegroups.com>.
>>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>> --
>>>>> 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
>>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>>> To post to this group, send email to
>>>>> rqtl...@googlegroups.com <mailto:rqtl...@googlegroups.com>.
>>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>> --
>>>> 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
>>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>>> To post to this group, send email to rqtl...@googlegroups.com
>>>> <mailto:rqtl...@googlegroups.com>.
>>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> 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
>>> <mailto:rqtl-disc+...@googlegroups.com>.
>>> To post to this group, send email to rqtl...@googlegroups.com
>>> <mailto:rqtl...@googlegroups.com>.
>>> Visit this group at https://groups.google.com/group/rqtl-disc.
>>> For more options, visit https://groups.google.com/d/optout.
>> --
>> 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
>> <mailto:rqtl-disc+...@googlegroups.com>.
>> To post to this group, send email to rqtl...@googlegroups.com
>> <mailto:rqtl...@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/rqtl-disc.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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
> <mailto:rqtl-disc+...@googlegroups.com>.
> To post to this group, send email to rqtl...@googlegroups.com
> <mailto:rqtl...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/rqtl-disc.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Ramesh S. Bhat
> Professor and Head
> Department of Biotechnology
> University of Agricultural Sciences, Dharwad
> PIN: 580 005, Dharwad, Karnataka, India
> Ph: +91-836-2214457, Mobile: +91-9945667300
> email: bha...@uasd.in <mailto:bha...@uasd.in>
>
> --
> 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
> <mailto:rqtl-disc+...@googlegroups.com>.
> To post to this group, send email to rqtl...@googlegroups.com
> <mailto:rqtl...@googlegroups.com>.

Karl Broman

unread,
Apr 12, 2019, 7:17:33 AM4/12/19
to rqtl...@googlegroups.com


On 4/12/19 4:18 AM, Ramesh Bhat wrote:
> I am attempting map construction with my own data.
>
> What do the numbers (marked red) in the following scripts mean?
>
> mapthis <- subset(mapthis, ind=(ntyped(mapthis)>50))
>
subsetting to individuals who have genotype data for >50 markers.

> todrop <- names(nt.bymar[nt.bymar < 200])
>

determining markers that have fewer than 200 genotypes.

> hist(cg[lower.tri(cg)], breaks=seq(0, 1, len=101), xlab="No. matching
> genotypes")
>

making a histogram with 100 bins

> plot(dropone, lod=1, ylim=c(-100,0))
>
cutoff for the y-axis limit

> mapthis <- subset(mapthis, ind=(countXO(mapthis) < 50))
>
>
subsetting to individuals with <50 crossovers.

> Should I change for my data?
>
>

yes


karl

Ramesh Bhat

unread,
Apr 12, 2019, 7:19:15 AM4/12/19
to rqtl...@googlegroups.com
The question is hyper does not work, but hyper works thought the contents are exactly same.

Which one one do you suggest instead of “mr"?
> 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.

Ramesh Bhat

unread,
Apr 12, 2019, 7:25:49 AM4/12/19
to rqtl...@googlegroups.com
Okay, I shall try with method="em" or method="hk”.
> 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.

Ramesh Bhat

unread,
Apr 12, 2019, 7:37:32 AM4/12/19
to rqtl...@googlegroups.com
“em”, “mr” and “hk” methods work for the data(hyper). But do not work when I use the same file “hyper” from my working directory.

Please help.
> 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.

Ramesh Bhat

unread,
Apr 12, 2019, 7:48:00 AM4/12/19
to rqtl...@googlegroups.com
A marker listed under
todrop <- names(nt.bymar[nt.bymar < 200])

but appears in the final
plotMap(mapthis, show.marker.names=TRUE)

Is it not dropped from mapping?




--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.

Karl Broman

unread,
Apr 12, 2019, 7:55:37 AM4/12/19
to rqtl...@googlegroups.com
I don’t know what’s gone wrong.

karl

Karl Broman

unread,
Apr 12, 2019, 7:57:07 AM4/12/19
to rqtl...@googlegroups.com
Did you skip the step

    mapthis <- drop.markers(mapthis, todrop)

karl

Ramesh Bhat

unread,
Apr 12, 2019, 7:58:24 AM4/12/19
to rqtl...@googlegroups.com
No, it was included.

Ramesh Bhat

unread,
Apr 12, 2019, 7:59:14 AM4/12/19
to rqtl...@googlegroups.com
“hyper” file which was used from my working directory is here.

hyper.csv

Karl Broman

unread,
Apr 12, 2019, 8:00:57 AM4/12/19
to rqtl...@googlegroups.com
The genotypes are coded BB and BA so you need to use genotypes=c(“BB”, “BA”) when you call read.cross()

karl

> On Apr 12, 2019, at 6:59 AM, Ramesh Bhat <bhatra...@gmail.com> wrote:
>
> “hyper” file which was used from my working directory is here.
>
> --
> 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 https://groups.google.com/group/rqtl-disc.
> For more options, visit https://groups.google.com/d/optout.
> <hyper.csv>

Ramesh Bhat

unread,
Apr 12, 2019, 8:01:47 AM4/12/19
to rqtl...@googlegroups.com
I am working on peanut (2n=4x=40), accordingly modified the chromosome numbers.


Ramesh Bhat

unread,
Apr 12, 2019, 8:05:33 AM4/12/19
to rqtl...@googlegroups.com
Yes, it worked now. Thanks.

Ramesh Bhat

unread,
Apr 12, 2019, 8:06:18 AM4/12/19
to rqtl...@googlegroups.com
Shall I send you my input file?

Ramesh Bhat

unread,
Apr 12, 2019, 11:28:21 AM4/12/19
to rqtl...@googlegroups.com
Is there a way for pull.map() for all the chromosomes with a single script?

Karl Broman

unread,
Apr 12, 2019, 11:40:31 AM4/12/19
to rqtl...@googlegroups.com
The default is for pull.map() to pull out the map for all chromosomes.

karl

Ramesh Bhat

unread,
Apr 12, 2019, 11:43:56 AM4/12/19
to rqtl...@googlegroups.com
Should I go for

pull.map(mapthis)

Ramesh Bhat

unread,
Apr 13, 2019, 5:21:02 AM4/13/19
to rqtl...@googlegroups.com
Following is a script along with the result in QTL analysis.

 summary(out.all, threshold=3)
               chr  pos   bp    hr    bw     heart_wt
c7.loc45   7 47.7 6.11 0.208 0.531    0.473
c15.loc8  15 12.0 5.29 1.616 5.423    1.216

Does this mean that these are the only two QTL with LOD more than 3 across at least one out of the four phenotypes?

Ramesh

--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.


--

Ramesh Bhat

unread,
Apr 13, 2019, 5:37:18 AM4/13/19
to rqtl...@googlegroups.com
I get the following errors in two-dimensional, two-QTL scans

> plot(out2)
Error in plot.new() : figure margins too large

> plot(out2, lower="fv1")
Error in .External.graphics(C_layout, num.rows, num.cols, mat, as.integer(num.figures),  : 
  invalid graphics state

> plot(out2, lower="fv1", upper="av1")
Error in .External.graphics(C_layout, num.rows, num.cols, mat, as.integer(num.figures),  : 
  invalid graphics state


> operm2 <- scantwo(out2, method="hk", n.perm=5)
Error in scantwo(out2, method = "hk", n.perm = 5) : 
  Input should have class "cross".

> summary(out2, perms=operm2, alpha=0.2, pvalues=TRUE)
Error in summary.scantwo(out2, perms = operm2, alpha = 0.2, pvalues = TRUE) : 
  object 'operm2' not found


--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.


--

Ramesh Bhat

unread,
Apr 13, 2019, 5:47:59 AM4/13/19
to rqtl...@googlegroups.com
Getting the following errors in multiple QTL analyses.

> print(pen <- calc.penalties(operm2))
Error in "scantwoperm" %in% class(perms) : object 'operm2' not found

> out.sq <- stepwiseqtl(sug, max.qtl=5, penalties=pen, method="hk", verbose=2)
Error in stepwiseqtl(sug, max.qtl = 5, penalties = pen, method = "hk",  : 
  object 'pen' not found

> out.sq
Error: object 'out.sq' not found


--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.


--

Karl Broman

unread,
Apr 13, 2019, 10:17:28 AM4/13/19
to rqtl...@googlegroups.com
If you use summary() without other options, it’s only looking at the first LOD score column, and so here you’re just getting the chromosomes where the LOD score for “bp” exceeded 3. 

Use, for example, format=“tabByCol” to get QTL for all LOD score columns.

karl

Karl Broman

unread,
Apr 13, 2019, 10:18:23 AM4/13/19
to rqtl...@googlegroups.com
If you get an error “object ‘x’ not found”, that means the object x doesn’t exist. 
You skipped some steps.

karl

Ramesh Bhat

unread,
Apr 13, 2019, 10:32:25 AM4/13/19
to rqtl...@googlegroups.com
I shall re-check, and come back to you.

Kind regards,

Ramesh Bhat

unread,
Apr 13, 2019, 11:44:25 AM4/13/19
to rqtl...@googlegroups.com
Where can I find the meaning of these headings?

pos1f pos2f lod.full pval lod.fv1 pval lod.int pval     pos1a pos2a
lod.add pval lod.av1 pval

Ramesh Bhat

unread,
Apr 13, 2019, 12:47:30 PM4/13/19
to rqtl...@googlegroups.com
It worked now. Earlier, I used the scripts from the manual not from the codes. Now I used the scripts from the codes.



Sent from my iPad

Karl Broman

unread,
Apr 13, 2019, 10:00:17 PM4/13/19
to R/qtl discussion
See the help file for summary.scantwo:

  ?summary.scantwo


Or chapter 8 of the R/qtl book, http://rqtl.org/book

karl

Ramesh Bhat

unread,
Apr 14, 2019, 5:23:30 AM4/14/19
to rqtl...@googlegroups.com
In 

rip5 <- ripple(mapthis, chr=5, window=7)

Once, the first window of 7 markers is completed, how to go to the next set of markers on the same chromosome, if the the same chromosome has more than 7 markers?

Karl Broman

unread,
Apr 14, 2019, 11:20:00 AM4/14/19
to rqtl...@googlegroups.com
ripple() uses a sliding window of markers; with window=7 it will look at all possible orders for the first 7 markers and then slide over one to look at all possible orders of markers 2-8, then slide over one and look at all possible orders of markers 3-9. It continues to do that until it has considered all possible orders of the last 7 markers.

So, if the chromosome has 8 markers, with window=7 ripple() looks at a total of 9,360 marker orders. If there are say 11 markers, it looks at 22,320 orders, and if there are 20 markers, it looks at 61,200 orders. (I determined these numbers by trying it out with the hyper data.)

   data(hyper)

   nmar(hyper)
   #  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19  X
   # 22  8  6 20 14 11  7  6  5  5 14  5  5  5 11  6 12  4  4  4

   rip2 <- ripple(hyper, chr=2, window=7)
   #    9360 total orders

   rip7 <- ripple(hyper, chr=6, window=7)
   #    22320 total orders

   rip4 <- ripple(hyper, chr=4, window=7)
   #    61200 total orders

karl

Ramesh Bhat

unread,
Apr 14, 2019, 11:32:18 AM4/14/19
to rqtl...@googlegroups.com
Thanks Karl.

Kind regards,


Ramesh Bhat

unread,
Apr 14, 2019, 11:59:28 AM4/14/19
to rqtl...@googlegroups.com

The manual says “By default in scanone, we consider the first phenotype in the input cross object. Other phenotypes, include the parallel consideration of multiple phenotypes, can be considered via the argument pheno.col.”

If my input file has phenotypes in the first 10 columns, can I go directly for 

out.all <- scanone(sug, pheno.col=1:10, method="hk")

instead of 

out.em <- scanone(sug)


Ramesh Bhat

unread,
Apr 15, 2019, 8:00:28 AM4/15/19
to rqtl...@googlegroups.com

plot(sug)

gives the following plots in a single Quartz window, like


Can I get only the Genetic map on a single Quartz window?


Ramesh Bhat

unread,
Apr 15, 2019, 8:06:30 AM4/15/19
to rqtl...@googlegroups.com
The following scripts could work

library(qtl)

sug <- read.cross("csv", "http://www.rqtl.org", "sug.csv",

genotypes=c("CC", "CB", "BB"), alleles=c("C", "B"))

sug <- calc.genoprob(sug, step=1)

out.all <- scanone(sug, pheno.col=1:4, method="hk")

summary(out.all, threshold=3, format="tabByCol")

summary(out.all, threshold=3, format="tabByChr”)


But I do not know whether it is the right way or not! Kindly suggest.


Begin forwarded message:

Karl Broman

unread,
Apr 15, 2019, 10:22:46 AM4/15/19
to rqtl...@googlegroups.com
Use plotMap(sug)

karl

> On Apr 15, 2019, at 7:00 AM, Ramesh Bhat <bhatra...@gmail.com> wrote:
>
> plot(sug)
>
> gives the following plots in a single Quartz window, like
> <PastedGraphic-1.png>

Ramesh Bhat

unread,
Apr 15, 2019, 10:59:19 AM4/15/19
to rqtl...@googlegroups.com
I got only the map now, but the sizer remains the same. Big window, but small picture!

Karl Broman

unread,
Apr 15, 2019, 11:00:57 AM4/15/19
to rqtl...@googlegroups.com
try

par(mfrow=c(1,1)) # to reset to a single large plot
plotMap(sug)



> On Apr 15, 2019, at 9:59 AM, Ramesh Bhat <bhatra...@gmail.com> wrote:
>
> I got only the map now, but the sizer remains the same. Big window, but small picture!
>
> <PastedGraphic-2.png>

Ramesh Bhat

unread,
Apr 15, 2019, 12:03:57 PM4/15/19
to rqtl...@googlegroups.com
Yes, it works.

Can we get the marker name on this plot?

Ramesh Bhat

unread,
Apr 18, 2019, 1:14:00 AM4/18/19
to rqtl...@googlegroups.com
Dear Karl,

1. This is relating to QTL effect (page # 122 in your book).
For a RIL population, where we have only two genotypes, we calculate only additive effect as (mean of BB - mean of AA)/2. So the positive value would indicate superiority of BB individuals over AA individuals. Am I correct?

off<-effectplot(hyper, mname=“D4Mit164”, draw=FALSE)

would give the effect for only D4Mit164. If I want the additive effect for all the QTL, then which code should I use?


2. This is relating to the phenotypic variance explained by the QTL (heritability due to QTL) (page # 122 in your book).

Can I know the code for calculating the phenotypic variance explained (heritability) for all the QTL with LOD more than a set value, say 3? Also, how can I get residual variance?


3. Can I get a QTL map (genetic map with significant QTL) for the traits?

Kind regards,

Karl Broman

unread,
Apr 18, 2019, 10:31:43 AM4/18/19
to rqtl...@googlegroups.com
>
> 1. This is relating to QTL effect (page # 122 in your book).
> For a RIL population, where we have only two genotypes, we calculate only additive effect as (mean of BB - mean of AA)/2. So the positive value would indicate superiority of BB individuals over AA individuals. Am I correct?
>

Yes.


> off<-effectplot(hyper, mname=“D4Mit164”, draw=FALSE)
>
> would give the effect for only D4Mit164. If I want the additive effect for all the QTL, then which code should I use?
>

Repeat that for other QTL, or use makeqtl() and fitqtl(), the latter with get.ests=TRUE, for a multiple-QTL model.

>
> 2. This is relating to the phenotypic variance explained by the QTL (heritability due to QTL) (page # 122 in your book).
>
> Can I know the code for calculating the phenotypic variance explained (heritability) for all the QTL with LOD more than a set value, say 3?

The relationship between the LOD score and the percent variance explained is shown in the last full paragraph on page 77.

h^2 = 1 - 10^{- 2 LOD / n}

You can use that to determine the heritability that would correspond to LOD = 3.

> Also, how can I get residual variance?
>

I don't think there's an R/qtl function that gives the residual variance.



> 3. Can I get a QTL map (genetic map with significant QTL) for the traits?
>

If you create a QTL object with makeqtl(), you can display their locations on the map with plot().

data(fake.f2)
fake.f2 <- calc.genoprob(fake.f2, step=1)
out <- scanone(fake.f2, method="hk")
operm <- scanone(fake.f2, method="hk", n.perm=1000, perm.Xsp=TRUE)
out_summary <- summary(out, perms=operm, alpha=0.05)
qtl <- makeqtl(fake.f2, chr=out_summary$chr, pos=out_summary$pos, what="prob")
plot(qtl)

karl

Ramesh Bhat

unread,
Apr 18, 2019, 11:23:50 AM4/18/19
to rqtl...@googlegroups.com

2. This is relating to the phenotypic variance explained by the QTL (heritability due to QTL) (page # 122 in your book).

Can I know the code for calculating the phenotypic variance explained (heritability) for all the QTL with LOD more than a set value, say 3?


The relationship between the LOD score and the percent variance explained is shown in the last full paragraph on page 77.

h^2 = 1 - 10^{- 2 LOD / n}

You can use that to determine the heritability that would correspond to LOD = 3. 

 

This means, for a population of n samples, two or more QTL with same LOD will have same PVE/estimated heritability. Am I correct?

Can that happen?


Karl Broman

unread,
Apr 18, 2019, 11:37:32 AM4/18/19
to rqtl...@googlegroups.com


> On Apr 18, 2019, at 10:23 AM, Ramesh Bhat <bhatra...@gmail.com> wrote:
>
> 2. This is relating to the phenotypic variance explained by the QTL (heritability due to QTL) (page # 122 in your book).
>
> Can I know the code for calculating the phenotypic variance explained (heritability) for all the QTL with LOD more than a set value, say 3?
>
>
> The relationship between the LOD score and the percent variance explained is shown in the last full paragraph on page 77.
>
> h^2 = 1 - 10^{- 2 LOD / n}
>
> You can use that to determine the heritability that would correspond to LOD = 3.
>
>
> This means, for a population of n samples, two or more QTL with same LOD will have same PVE/estimated heritability. Am I correct?
>
> Can that happen?
>

estimated heritability is like r^2 in a regression, and the LOD score is another measure of strength of association, like the F statistic for a regression. For a given sample size, there is a direct relationship between r^2 and the LOD score, like the direct relationship between r^2 and the F statistic.

So yeah, for a given sample size, if two QTL show the same LOD score, the estimated heritability will also be the same.

karl

Ramesh Bhat

unread,
Apr 18, 2019, 11:53:06 AM4/18/19
to rqtl...@googlegroups.com
LOD indicates only the strength of QTL detection, but PVE indicates the extent of the influence of that QTL on phenotype, Is this statement correct?

LOD of 3, 2 or 1, with n=100, would give 100% heritability.

Not able to understand!

Karl Broman

unread,
Apr 18, 2019, 12:49:13 PM4/18/19
to rqtl...@googlegroups.com


On 4/18/19 10:52 AM, Ramesh Bhat wrote:
> LOD indicates only the strength of QTL detection, but PVE indicates the extent of the influence of that QTL on phenotype, Is this statement correct?

yes

> LOD of 3, 2 or 1, with n=100, would give 100% heritability.
>
> Not able to understand!
>
>
>

n=100 and LOD=1 would give h^2 = 1 - 10^(-2/100) = 0.045
n=100 and LOD=2 would give h^2 = 1 - 10^(-4/100) = 0.088
n=100 and LOD=3 would give h^2 = 1 - 10^(-6/100) = 0.129

karl

Ramesh Bhat

unread,
Apr 18, 2019, 1:00:11 PM4/18/19
to rqtl...@googlegroups.com
Thanks for correcting me.

Ramesh Bhat

unread,
Apr 18, 2019, 1:12:26 PM4/18/19
to rqtl...@googlegroups.com
Is this rule true for QTLCartographer or any other QTL mapping software also? Any idea?

I shall also check.

Kind regards,

Ramesh Bhat

unread,
Apr 18, 2019, 10:12:28 PM4/18/19
to rqtl...@googlegroups.com
Is the following statement true?

LOD = F statistic for a regression = F statistic from the ANOVA for an intercross

Karl Broman

unread,
Apr 19, 2019, 12:04:24 AM4/19/19
to rqtl...@googlegroups.com
No they're not the same. They serve similar purposes, but the values
will be different.
The relationship between the LOD score and the F statistic is shown on
page 77 of the R/qtl book;
see attached.

karl
lod_fstat.png

Ramesh Bhat

unread,
Apr 19, 2019, 12:13:39 AM4/19/19
to rqtl...@googlegroups.com
Thanks.
Whether the relation between "LOD and F statistic for a regression" is same as the relation between "LOD and F statistic from the ANOVA for an intercross"?




--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.

Karl Broman

unread,
Apr 19, 2019, 12:15:29 AM4/19/19
to rqtl...@googlegroups.com
F statistic from ANOVA. is the same as that for regression.

Ramesh Bhat

unread,
Apr 19, 2019, 12:25:02 AM4/19/19
to rqtl...@googlegroups.com
So, we can calculate LOD using F statistic, and we can calculate estimated heritability (PVE) using LOD.

Karl Broman

unread,
Apr 19, 2019, 12:23:21 PM4/19/19
to rqtl...@googlegroups.com


> On Apr 18, 2019, at 11:24 PM, Ramesh Bhat wrote:
>
> So, we can calculate LOD using F statistic, and we can calculate estimated heritability (PVE) using LOD.

yes

Ramesh Bhat

unread,
Apr 19, 2019, 12:32:42 PM4/19/19
to rqtl...@googlegroups.com
Thanks Karl.

Ramesh Bhat

unread,
May 13, 2019, 4:52:09 AM5/13/19
to rqtl...@googlegroups.com
Can we get the result shown below as the csv file (attached) with single digits of map distance?
image.png

--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.
Map.csv

Karl Broman

unread,
May 13, 2019, 6:47:57 AM5/13/19
to rqtl...@googlegroups.com
You can use the function round(). But it applies to vectors; to use it on a list of vectors, use lapply(), as follows:

map <- pull.map(mapthis)
lapply(mapthis, round, 1)

The 1 here is to round to tenths. Replace with 0 to round to nearest unit.

karl

On May 13, 2019, at 3:51 AM, Ramesh Bhat <bhatra...@gmail.com> wrote:

Can we get the result shown below as the csv file (attached) with single digits of map distance?
<image.png>

On Fri, Apr 19, 2019 at 9:53 PM Karl Broman <kbr...@gmail.com> wrote:


> On Apr 18, 2019, at 11:24 PM, Ramesh Bhat wrote:
>
> So, we can calculate LOD using F statistic, and we can calculate estimated heritability (PVE) using LOD.

yes

--
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 https://groups.google.com/group/rqtl-disc.
For more options, visit https://groups.google.com/d/optout.


--
Ramesh S. Bhat
Professor and Head
Department of Biotechnology
University of Agricultural Sciences, Dharwad
PIN: 580 005, Dharwad, Karnataka, India
Ph: +91-836-2214457, Mobile: +91-9945667300

--
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 https://groups.google.com/group/rqtl-disc.

For more options, visit https://groups.google.com/d/optout.
<Map.csv>

Ramesh Bhat

unread,
May 13, 2019, 6:53:32 AM5/13/19
to rqtl...@googlegroups.com
I get the following error

lapply(mapthis, round, 1)
Error in FUN(X[[i]], ...) : non-numeric argument to mathematical function



For more options, visit https://groups.google.com/d/optout.

Karl Broman

unread,
May 13, 2019, 7:12:11 AM5/13/19
to rqtl...@googlegroups.com
Oops I should have written

map <- pull.map(mapthis)
lapply(map, round, 1)

karl

Ramesh Bhat

unread,
May 13, 2019, 7:19:03 AM5/13/19
to rqtl...@googlegroups.com
That gives the following
$`1`
seq19D09  seq19G7   TC4F02  Ah-4-04 seq18A5B    GM745   AC3D07      PM3 
     0.0     31.9     43.7     46.8     49.7     50.7     55.1     61.4 
   PM434   TC2C07 seq13E06 
    65.0     89.8    125.6 
attr(,"loglik")
[1] -1058.867
attr(,"class")
[1] "A"

What are the red marked ones?




For more options, visit https://groups.google.com/d/optout.

Karl Broman

unread,
May 13, 2019, 7:21:31 AM5/13/19
to rqtl...@googlegroups.com
we store the log likelihood as an attribute. Also, whether the chromosome is an autosome or the X chromosome.

karl

Ramesh Bhat

unread,
May 13, 2019, 7:26:45 AM5/13/19
to rqtl...@googlegroups.com
I tried writing map to a csv file using 

write.csv(map, "Nmap.csv")

But got the following error


Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :  cannot coerce class ‘"map"’ to a data.frame    


If the chromosome number and the map positions can directly go to two rows of a csv file (file attached in my first email today), we save a lot of time.




For more options, visit https://groups.google.com/d/optout.

Ramesh Bhat

unread,
May 13, 2019, 7:42:40 AM5/13/19
to rqtl...@googlegroups.com

The following codes detect the regions with LOD 4.04.

sug <- calc.genoprob(sug, step=1)

out.all <- scanone(sug, pheno.col=1:4, method="hk")

summary(out.all, threshold=3, format="tabByCol")

 

lls2:

         chr pos ci.low ci.high  lod

c3.loc15   3  15      3      36 4.04

 

But the following codes fail to detect the regions with LOD ore than 3

out.all <- scanone(sug, pheno.col=1:4, method="hk")

summary(out.all, threshold=3)

There were no LOD peaks above the threshold.


Why is it so?



For more options, visit https://groups.google.com/d/optout.
It is loading more messages.
0 new messages