kbroman / qtl

R/qtl: A QTL mapping environment
https://rqtl.org
GNU General Public License v3.0
77 stars 45 forks source link

reduce2grid error #99

Closed webbchen closed 2 years ago

webbchen commented 2 years ago

Dear Karl

I've got an F2 cross as sen below and I was trying to reduce the number of markers using reduce2grid. Here's the cross:

> mycross
  This is an object of class "cross".
  It is too complex to print, so we provide just this summary.
    F2 intercross

    No. individuals:    169 

    No. phenotypes:     14 
    Percent phenotyped: 100 100 100 100 100 100 100 100 100 100 100 100 100 100 

    No. chromosomes:    7 
        Autosomes:      LG1 LG2 LG3 LG4 LG5.1 LG5.2 LG6 

    Total markers:      6755 
    No. markers:        1942 1156 1028 1089 455 255 830 
    Percent genotyped:  99.5 
    Genotypes (%):      AA:26.0  AB:50.0  BB:23.9  not BB:0.0  not AA:0.0 
Warning messages:
1: In summary.cross(x) :
  Some markers at the same position on chr LG1,LG2,LG3,LG4,LG5.1,LG5.2,LG6; use jittermap().
2: In summary.cross(x) :
  Some markers at the same position on chr LG1,LG2,LG3,LG4,LG5.1,LG5.2,LG6; use jittermap().

That's what I've run:

> mycross<- calc.genoprob(mycross, step=2.5, map.function="kosambi", error.prob=0.07)
> mycross2 <- reduce2grid(mycross)

with reduce2grid yielding the following error:

Error in seq.default(min(map), max(map), by = step) : 
  invalid '(to - from)/by'

I can't make head or tail of the error because when I ran it with a slightly different, less well ordered, version of the map within the cross it all worked fine! A search of the r/qtl google group yielded no hints or I've looked in the wrong places..

Kind regards,

anne

kbroman commented 2 years ago

It’s maybe related to markers being in identical positions? Try using jittermap() as mentioned in that warning message.

Would you be willing to share your data, so that I can figure out what’s going on?

webbchen commented 2 years ago

Update: running sim.geno(mycross) as well as calc.genoprob(mycross) when both had previously been calculated made the error go away. It might be worth mentioning in the manuals, that if both had previously been calculated they both need to be redone before running reduced2grid. Thanks for the quick reply!