Inbred Based Populations

Statistical Genetics Lab
Department of Genetics
Luiz de Queiroz College of Agriculture
University of São Paulo

2020-02-15

Starting in version 2.0-0, OneMap can also deal with inbred-based populations, that is, populations that have homozygous parental lines in the genealogy (F2s, backcrosses and RILs). As a consequence, linkage phases do not need to be estimated.

In this vignette we explain how to proceed the analysis in an F2 population. The same procedure can be used for backcrosses and RILs as well, and therefore users should not have any difficulty in analyzing their data. However, there are a number of differences from genetic mapping in outcrossing species; please read the proper vignette.

If you are not familiar with R, we recommend first the reading of vignette Introduction to R. You do not need to be an expert in R to build your linkage map, but some concepts are necessary and will help you through the process.

There is a github OneMap version which is constantly improved, we strong recommend all users to try this version. In augusto-garcia/onemap github page you can find instructions to install the package from github and also more fancy tutorials.

Creating the data file

For F2s, backcrosses and RILs, two input formats are accepted. The user can choose between the standard {} file format or the same raw file used by MAPMAKER/EXP (Lander et al., 1987). Therefore, one should have no difficulty in using data sets already available for MAPMAKER/EXP when deciding to try OneMap.

Both types of raw file can contain phenotypic information, but this will not be used during map construction, that requires only genotypic information (made available by molecular markers).

Creating MAPMAKER/EXP data file

The MAPMAKER/EXP raw file, combined with the map file produced by OneMap, can be readily used for QTL mapping using R/qtl (Broman et al., 2008) or QTL Cartographer (Wang et al., 2010), among others.

Here, we briefly present how to set up this data file. For more detailed information see the MAPMAKER/EXP manual (Lincon et al., 1993), available here.

The first line of your data file should be:

data type xxxx

where xxxx is one of the following data types:

xxxx Population type
f2 backcross Backcross
f2 intercross F2
ri self RIL, produced by selfing
ri sib RIL, produced by sib mating

The second line should contain the number of individuals in the progeny, the number of markers and the number of quantitative traits. So, for example, a valid line would be

10 5 2

for a data set with 10 individuals (yes, very small, but this is just an example), 5 markers and 2 traits evaluated.

Then, the genotype information is included for each marker. The character * indicates the beginning of information of a marker, followed by the marker name. For instance, here is an example of such a file for an F2 population with 10 individuals, 5 markers and 2 quantitative traits:

data type f2 intercross
10 5 2

*M1 A B H H A - B A A B
*M2 C - C C C - - C C A
*M3 D B D D - - B D D B
*M4 C C C - A C C A A C
*M5 C C C C C C C C C C

*weight 10.2 - 9.4 11.3 11.9 8.9 - 11.2 7.8 8.1 
*length 1.7 2.1 - 1.8 2.0 1.0 - 1.7 1.0 1.1

The codification for genotypes is the following:

Code Meaning
A homozygous for allele A (from parent 1 - AA)
B homozygous for allele B (from parent 2 - BB)
H heterozygous carrying both alleles (AB)
C Not homozygous for allele A (Not AA)
D Not homozygous for allele B (Not BB)
- Missing data for the individual at this marker

The symbols option (not included in this example), used in MAPMAKER/EXP files, is also accepted (please, see its manual for details).

The quantitative trait data should come after the genotypic data and has a similar format, except the trait values for each individual must be separated by at least one space, a tab or a line break. A dash (-) indicates missing data.

This file must be saved in plain text format using a simple text editor such as notepad on Microsoft Windows. Historically, MAPMAKER/EXP uses the .raw extension for this file; however, you can use any other extensions, such as .txt.

If you want to see more examples about this file type, open mapmaker_example_bc.raw and mapmaker_example_f2.raw, both available with OneMap and saved in the directory extdata on your computer, in the folder where you installed OneMap (use system.file(package="onemap") to see where it is located on your computer).

Now, let us load OneMap:

library(onemap)
#> Registered S3 methods overwritten by 'car':
#>   method                          from
#>   influence.merMod                lme4
#>   cooks.distance.influence.merMod lme4
#>   dfbeta.influence.merMod         lme4
#>   dfbetas.influence.merMod        lme4

To save your project anytime, type:

save.image("C:/.../yourfile.RData")

if you are using Windows; otherwise, adapt the code. Notice that you need to specify where to save and the name of the file. You can also use the toolbar, of course.

Creating OneMap data file

The OneMap data file has few differences compared to MAPMAKER/EXP format. As MAPMAKER/EXP format, the input OneMap file is a text file, where the first line indicates the cross type and the second line provides information about the number of individuals and the number of markers, but, because the format aldo supports to keep physical markers locations informations, the followed numbers indicate the presence/absence (1/0) of chromossome and position informations and, after the presence/absence(1/0) of phenotypic data.

The third line contains sample IDs. Then, the genotype information is included separately for each marker. The character * indicates the beginning of information input for a new marker, followed by the marker name. Next, there is a code indicating the marker type according with:

Code Type
A.H.B Codominant marker
C.A Dominant marker for allele B
D.B Dominant marker for allele A
A.H Marker for backcross
A.B Marker for ril self/sib cross

Finally, after each marker type, comes the genotype data for the segregating population. Missing data are indicated with the character - (minus sign) and an empty space separates the information for each individual. Positions and phenotype information, if present, follows genotypic data with a similar structure. Details are found in the help of function read_onemap.

Here is an example of such file for 10 individuals and 5 markers (the three zeros in the second line indicate that there is no chromosome information, physical position information or phenotypic data, respectively). It is very similar to a MAPMAKER/EXP file, but has additional information about the crosstype.

data type f2 intercross
10 5 1 0 1
I1 I2 I3 I4 I5 I6 I7 I8 I9 I10
*M1 A.H.B  ab a - ab b a ab - ab b
*M2 A.H.B  a - ab ab - b a - a ab
*M3 C.A    c a a c c - a c a c
*M4 A.H.B  ab b - ab a b ab b - a
*M5 D.B    b b d - b d b b b d
*CHROM 1 1 1 2 2 2 3 3 3 3
*fen1 10.3 11.2 11.1 - 9.8 8.9 11.0 10.7 - 10.1
*fen2 42 49 - 45 51 42 28 32 38 40

The input file must be saved in text format, with extensions like .raw. It is a good idea to open the text file called onemap_example_f2.raw (available in extdata with OneMap and saved in the directory you installed it) to see how this file should be. You can see where OneMap is installed using the command

Importing data

From MAPMAKER/EXP file

Once you created your data file with raw data, you can use OneMap function read_mapmaker to import it to OneMap:

mapmaker_example_f2 <- read_mapmaker(dir="C:/workingdirectory", 
                                file="your_data_file.raw")

The first argument is the directory where the input file is located, so modify it accordingly. The second one is the data file name.

In this example, an object named mapmaker_example_f2.raw was created. Notice that if you leave the argument dir blank, the file will be read from your current working directory. To set a working directory, see Introduction to R (Importing and Exporting Data).

mapmaker_example_f2 <- read_mapmaker(file= system.file("extdata/mapmaker_example_f2.raw", 
                                                       package = "onemap"))

For this example, we will use a simulated data set from an F2 population which is distributed along with OneMap. Because this particular data set is distributed along with the package, you can load it typing

data("mapmaker_example_f2")

To see what this data set is about, type

mapmaker_example_f2
#>   This is an object of class 'onemap'
#>     Type of cross:      f2 
#>     No. individuals:    200 
#>     No. markers:        66 
#>     CHROM information:  no 
#>     POS information:    no 
#>     Percent genotyped:  85 
#> 
#>     Segregation types:
#>        AA : AB : BB -->  36
#>         Not AA : AA -->  15
#>         Not BB : BB -->  15
#> 
#>     No. traits:         1 
#>     Missing trait values: 
#>   Trait_1: 0

As you can see, the data consists of a sample of 200 individuals genotyped for 66 markers (36 co-dominant (AA, AB or BB), 15 dominant in one parent (Not AA or AA) and 15 dominant in the other parent (Not BB or BB) with 15% of missing data. You can also see that there is phenotypic information for one trait in the data set, that can be used for QTL mapping.

From OneMap raw file

The same procedure is made for OneMap raw file, but, instead of using the function read_mapmaker we use read_onemap to read the OneMap format.

onemap_example_f2 <- read_onemap(dir="C:/workingdirectory", 
                                inputfile = "your_data_file.raw")

In this example, an object named onemap_example_f2.raw was created. The data set containg the same markers and individual of the mapmaker_example_f2.raw file. Would be a good idea to open this two files in a text editor and compare them to better understand the differences between the two kinds of input files. We can read the onemap_example_f2.raw using:

onemap_example_f2 <- read_onemap(inputfile= system.file("extdata/onemap_example_f2.raw", 
                                                       package = "onemap"))

Or, because this particular data are available together with OneMap package:

data("onemap_example_f2")

To see what this data set is about, type

onemap_example_f2
#>   This is an object of class 'onemap'
#>     Type of cross:      f2 
#>     No. individuals:    200 
#>     No. markers:        66 
#>     CHROM information:  no 
#>     POS information:    no 
#>     Percent genotyped:  85 
#> 
#>     Segregation types:
#>        AA : AB : BB -->  36
#>         Not AA : AA -->  15
#>         Not BB : BB -->  15
#> 
#>     No. traits:         1 
#>     Missing trait values: 
#>   Trait_1: 0

As you can see, the mean difference in the output object is that read_onemap function keeps chromossome and position informations. Because the objetcs mapmaker_example_f2 and onemap_example_f2 are pratically the same, from now we will use only onemap_example_f2.

Importing data from VCF file

If you are working with biallelic markers, as SNPs and indels (only codominant markers A.H.B), in VCF (Variant Call Format) files, you can import information from VCF to OneMap using onemap_read_vcfR function.

With the onemap_read_vcfR you can convert the object from vcfR package directly to onemap. The onemap_read_vcfR function keeps chromosome and position information for each marker at the end of raw file.

We will use the same example file vcf_example_f2.vcf to show how it works.

First, we convert the VCF file to vcfR object:

library(vcfR)
vcfR.object <- read.vcfR(system.file("extdata/vcf_example_f2.vcf", package = "onemap"))

As described in the vcfR package vignette, memory use is a important consideration when using vcfR. Depending of your dataset, the object created can be very large and occupy a lot of memory.

After, you can use onemap_read_vcfR function to convert this object to onemap object. The parameters used is the vcfR.object we just created, the identification of each parent (here you must define only one sample for each parent) and the cross type.

vcf_example_f2 <- onemap_read_vcfR(vcfR.object = vcfR.object,
                                   parent1 = "P1", 
                                   parent2 = "P2", 
                                   cross = "f2 intercross")

Depending of your dataset, this function can take some time to run.

After the convertion, we can save the vcfR.object as a .RData and to remove it from the workspace, once it can occupy a lot of memory and turn the other process too slow.

save(vcfR.object, file = "vcfR.object.RData") 
rm(vcfR.object)

From version 2.0.6 to 2.1.1005, OneMap had the vcf2raw function to convert vcf to .raw. Now, this function is defunct, but it can be replaced by a combination of onemap_read_vcfR and write_onemap_raw functions.

Visualization of raw data

Before building your linkage map, you should take a look at your data set. First, notice that by reading the raw data into OneMap, an object of classes onemap and f2 was produced:

class(onemap_example_f2)
#> [1] "onemap" "f2"
class(vcf_example_f2)
#> [1] "onemap" "f2"

In fact, functions read_mapmaker and read_onemap will produce objects of classes backcross, riself, risib or f2, according to the information in the data file for inbred-based populations. Therefore, you can use OneMap’s version of function plot to produce a graphic with information about the raw data. It will automatically recognize the class of the object and produce the graphic. To see it in action, try:

plot(onemap_example_f2)

plot(vcf_example_f2)

The graphic is self-explanatory. If you want to save it, see the help for function plot.onemap:

?plot.onemap

This graphic shows that missing data is somehow randomly distributed; also, the proportion of dominant markers is relatively high for this data set. In Onemap’s notation, co-dominant markers are classified as of B type; dominant ones, by C type (for details about this notation, see the vignette for outcrossing species). You can see the number of loci within each type using funcion plot_by_segreg_type:

plot_by_segreg_type(onemap_example_f2)

plot_by_segreg_type(vcf_example_f2)

So, as shown before, the object onemap_example_f2 has 36 codominant markers and 30 dominant ones and the vcf_example_f2has only codominant markers.

Combining OneMap objects

If you have more than one dataset of markers, all from the same cross type, you can use the function combine_onemap to merge them into only one onemap object.

In our example, we have two onemap objects:

The combine_function recognizes the correspondent individuals by the ID, thus, it is important define exactly same IDs to respective individuals in both raw files. Compared with the first file, the second file do not have markers informations for 8 individuals. The combine_onemap will complete those informations with NA.

In our examples, we have only genotypic information, but the function can also merge the phenotipic information if it exists.

comb_example <- combine_onemap(onemap_example_f2, vcf_example_f2)
comb_example
#>   This is an object of class 'onemap'
#>     Type of cross:      f2 
#>     No. individuals:    200 
#>     No. markers:        91 
#>     CHROM information:  yes 
#>     POS information:    yes 
#>     Percent genotyped:  84 
#> 
#>     Segregation types:
#>        AA : AB : BB -->  61
#>         Not AA : AA -->  15
#>         Not BB : BB -->  15
#> 
#>     No. traits:         1 
#>     Missing trait values: 
#>   Trait_1: 0

The function arguments are the names of the onemap objects you want to combine.

Plotting markers genotypes from the outputted onemap object, we can see that there are more missing data - (black vertical lines) for some individuals, because they were missing in the second file.

plot(comb_example)

Exporting .raw file from onemap object

The functions onemap_read_vcfR generates new onemap objects without use a input .raw file. Also, the function combine_onemap manipulates the information of the original .raw file and creates a new data set. In both cases, you do not have a input file .raw that contains the same informations of the analysed data. If you want to create a new input file with the data set you are working after using this functions, you can use the function write_onemap_raw.

write_onemap_raw(comb_example, file.name = "new_dataset.raw", cross="f2 intercross")

The file new_dataset.raw will be generated in your working directory. In our example, it contains markers from onemap_example_f2 and vcf_example_f2 data sets.

Segregation tests

Now, it should be interesting to see if markers are segregating following what is expected by Mendel’s law. You first need to use function test_segregation using as argument an object of class onemap.

f2_test <- test_segregation(comb_example)

This will produce an object of class onemap_segreg_test:

class(f2_test)
#> [1] "onemap_segreg_test"

You cannot see the results if you simply type the object name; use Onemap’s version of the print function for objects of class onemap_segreg_test:

f2_test

(Nothing is shown!)

print(f2_test)
#>    Marker    H0  Chi-square     p-value % genot.
#> 1      M1 1:2:1 0.206896552 0.901722662     87.0
#> 2      M2   3:1 0.292682927 0.588506355     82.0
#> 3      M3   3:1 0.124031008 0.724703003     86.0
#> 4      M4   3:1 0.292682927 0.588506355     82.0
#> 5      M5   3:1 0.159763314 0.689374522     84.5
#> 6      M6   3:1 0.620689655 0.430791121     87.0
#> 7      M7 1:2:1 3.185185185 0.203397600     81.0
#> 8      M8   3:1 0.165644172 0.684012345     81.5
#> 9      M9   3:1 0.126984127 0.721579725     84.0
#> 10    M10 1:2:1 1.721893491 0.422761645     84.5
#> 11    M11   3:1 1.390946502 0.238245323     81.0
#> 12    M12 1:2:1 1.678160920 0.432107681     87.0
#> 13    M13   3:1 0.154285714 0.694472964     87.5
#> 14    M14 1:2:1 5.337209302 0.069348924     86.0
#> 15    M15   3:1 0.403292181 0.525393917     81.0
#> 16    M16 1:2:1 2.036144578 0.361290733     83.0
#> 17    M17 1:2:1 1.000000000 0.606530660     81.0
#> 18    M18 1:2:1 3.413793103 0.181427972     87.0
#> 19    M19   3:1 0.279069767 0.597311573     86.0
#> 20    M20   3:1 4.462626263 0.034644194     82.5
#> 21    M21 1:2:1 4.892857143 0.086602329     84.0
#> 22    M22 1:2:1 2.862068966 0.239061489     87.0
#> 23    M23   3:1 0.008032129 0.928587488     83.0
#> 24    M24   3:1 8.649325626 0.003271824     86.5
#> 25    M25 1:2:1 0.686746988 0.709373215     83.0
#> 26    M26 1:2:1 7.022598870 0.029858091     88.5
#> 27    M27 1:2:1 0.108433735 0.947226662     83.0
#> 28    M28 1:2:1 3.319526627 0.190183989     84.5
#> 29    M29 1:2:1 0.161676647 0.922342801     83.5
#> 30    M30 1:2:1 0.607142857 0.738177160     84.0
#> 31    M31   3:1 0.007843137 0.929430415     85.0
#> 32    M32   3:1 0.016949153 0.896416968     88.5
#> 33    M33 1:2:1 0.640718563 0.725888192     83.5
#> 34    M34   3:1 0.235867446 0.627206926     85.5
#> 35    M35   3:1 0.606741573 0.436017310     89.0
#> 36    M36   3:1 0.272727273 0.601508134     88.0
#> 37    M37 1:2:1 3.169491525 0.204999905     88.5
#> 38    M38 1:2:1 3.055555556 0.217017393     90.0
#> 39    M39   3:1 0.163636364 0.685830434     82.5
#> 40    M40 1:2:1 4.872093023 0.087506123     86.0
#> 41    M41 1:2:1 4.253012048 0.119253235     83.0
#> 42    M42   3:1 0.124031008 0.724703003     86.0
#> 43    M43 1:2:1 0.927272727 0.628992237     82.5
#> 44    M44 1:2:1 2.000000000 0.367879441     86.0
#> 45    M45   3:1 0.008032129 0.928587488     83.0
#> 46    M46 1:2:1 0.740112994 0.690695307     88.5
#> 47    M47 1:2:1 0.758620690 0.684333200     87.0
#> 48    M48 1:2:1 2.122807018 0.345969898     85.5
#> 49    M49   3:1 1.190476190 0.275233524     87.5
#> 50    M50   3:1 1.068686869 0.301242240     82.5
#> 51    M51   3:1 0.031746032 0.858586201     84.0
#> 52    M52 1:2:1 2.684848485 0.261211660     82.5
#> 53    M53   3:1 0.017142857 0.895830102     87.5
#> 54    M54 1:2:1 0.772455090 0.679615865     83.5
#> 55    M55 1:2:1 0.655172414 0.720661163     87.0
#> 56    M56 1:2:1 2.310734463 0.314941859     88.5
#> 57    M57 1:2:1 6.159763314 0.045964696     84.5
#> 58    M58   3:1 2.050847458 0.152121494     88.5
#> 59    M59   3:1 0.074074074 0.785494747     81.0
#> 60    M60   3:1 0.050505051 0.822186767     82.5
#> 61    M61 1:2:1 0.655172414 0.720661163     87.0
#> 62    M62 1:2:1 1.047337278 0.592343463     84.5
#> 63    M63 1:2:1 2.147928994 0.341651353     84.5
#> 64    M64   3:1 0.238658777 0.625176499     84.5
#> 65    M65 1:2:1 4.571428571 0.101701392     84.0
#> 66    M66 1:2:1 0.452513966 0.797513128     89.5
#> 67   SNP1 1:2:1 1.278787879 0.527612092     82.5
#> 68   SNP2 1:2:1 1.559523810 0.458515169     84.0
#> 69   SNP3 1:2:1 0.503105590 0.777592404     80.5
#> 70   SNP5 1:2:1 4.450000000 0.108067419     80.0
#> 71   SNP6 1:2:1 2.641975309 0.266871595     81.0
#> 72   SNP7 1:2:1 3.745341615 0.153712576     80.5
#> 73   SNP8 1:2:1 4.164705882 0.124636604     85.0
#> 74   SNP9 1:2:1 2.578313253 0.275503037     83.0
#> 75  SNP10 1:2:1 3.359281437 0.186440949     83.5
#> 76  SNP11 1:2:1 2.395061728 0.301938820     81.0
#> 77  SNP12 1:2:1 4.731707317 0.093869134     82.0
#> 78  SNP13 1:2:1 2.963855422 0.227199291     83.0
#> 79  SNP14 1:2:1 7.123456790 0.028389714     81.0
#> 80  SNP15 1:2:1 3.109090909 0.211285400     82.5
#> 81  SNP16 1:2:1 2.751552795 0.252643368     80.5
#> 82  SNP17 1:2:1 5.850299401 0.053656659     83.5
#> 83  SNP18 1:2:1 3.108433735 0.211354837     83.0
#> 84  SNP19 1:2:1 3.335403727 0.188680181     80.5
#> 85  SNP20 1:2:1 3.867469880 0.144607090     83.0
#> 86  SNP21 1:2:1 3.238095238 0.198087264     84.0
#> 87  SNP22 1:2:1 4.455621302 0.107764105     84.5
#> 88  SNP23 1:2:1 2.847058824 0.240862412     85.0
#> 89  SNP24 1:2:1 1.778443114 0.410975549     83.5
#> 90  SNP25 1:2:1 1.778443114 0.410975549     83.5
#> 91  SNP26 1:2:1 1.981595092 0.371280460     81.5

This shows the results of the Chi-square test for the expected Mendelian segregation pattern of each marker locus. This depends of course on marker type, because co-dominant markers can show heterozygous genotypes. The appropriate null hypothesis is selected by the function. The proportion of individuals genotyped is also shown.

To declare statistical significance, remember that you should consider that multiple tests are being performed. To guide you in the analysis, function Bonferroni_alpha shows the alpha value that should be considered for this number of loci if applying Bonferroni’s correction with global alpha of 0.05:

Bonferroni_alpha(f2_test)
#> [1] 0.0005494505

You can subset object f2_test to see which markers are distorted under Bonferroni’s criterion, but it is easier to see the proportion of markers that are distorted by drawing a graphic using OneMap’s version of the function plot for objects of class onemap_segreg_test:

plot(f2_test)

The graphic is self-explanatory: p-values were transformed by using -log10(p-values) for better visualization. A vertical line shows the threshold for tests if Bonferroni’s correction is applied. Significant and non-significant tests are identified. In this particular example, no test was statistically significant, so none will be discarded.

Please, remember that Bonferroni’s correction is conservative, and also that discarding marker data might not be a good approach to your analysis. This graphic is just to suggest a criterion, so use it with caution.

You can see a list of markers with non-distorted segregation using function select_segreg:

select_segreg(f2_test)
#>  [1] "M1"    "M2"    "M3"    "M4"    "M5"    "M6"    "M7"    "M8"    "M9"   
#> [10] "M10"   "M11"   "M12"   "M13"   "M14"   "M15"   "M16"   "M17"   "M18"  
#> [19] "M19"   "M20"   "M21"   "M22"   "M23"   "M24"   "M25"   "M26"   "M27"  
#> [28] "M28"   "M29"   "M30"   "M31"   "M32"   "M33"   "M34"   "M35"   "M36"  
#> [37] "M37"   "M38"   "M39"   "M40"   "M41"   "M42"   "M43"   "M44"   "M45"  
#> [46] "M46"   "M47"   "M48"   "M49"   "M50"   "M51"   "M52"   "M53"   "M54"  
#> [55] "M55"   "M56"   "M57"   "M58"   "M59"   "M60"   "M61"   "M62"   "M63"  
#> [64] "M64"   "M65"   "M66"   "SNP1"  "SNP2"  "SNP3"  "SNP5"  "SNP6"  "SNP7" 
#> [73] "SNP8"  "SNP9"  "SNP10" "SNP11" "SNP12" "SNP13" "SNP14" "SNP15" "SNP16"
#> [82] "SNP17" "SNP18" "SNP19" "SNP20" "SNP21" "SNP22" "SNP23" "SNP24" "SNP25"
#> [91] "SNP26"

To get a list of distorted ones (none in this example):

select_segreg(f2_test, distorted = TRUE)
#> character(0)

It is not recommended, but you can define a different threshold value changing the threshold argument of the function select_segreg.

For the next steps will be useful to know the numbers of each markers with segregation distortion, so then you can keep those out of your map building analysis. These numbers refer to the lines where markers are located on the data file.

To access the corresponding number for of this markers you can change the numbers argument:

no_dist <- select_segreg(f2_test, distorted = FALSE, numbers = TRUE) #to show the markers numbers without segregation distortion
no_dist
#>  [1]  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] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
#> [51] 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
#> [76] 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

dist <- select_segreg(f2_test, distorted = TRUE, numbers = TRUE) #to show the markers numbers with segregation distortion
dist
#> integer(0)

Estimating two-point recombination fractions

After visualizing raw data and checking for segregation distortion, let us now estimate recombination fractions between all pairs of markers (two-point tests). This is necessary to allow us to test which markers are linked. At this point, you should pay no attention if markers show segregation distortion or not, that is, simply use all of them.

twopts_f2 <- rf_2pts(comb_example)

There are two optional arguments in function rf_2pts: LOD and max.rf which indicate the minimum LOD Score and the maximum recombination fraction to declare linkage (they default to 3.0 and 0.5, respectively).

The default for the recombination fraction is easy to understand, because if max.rf < 0.5 we could state that markers are linked. The LOD Score is the statistic used to evaluate the significance of the test for max.rf = 0.50. This needs to take into consideration the number of tests performed, which of course depends on the number of markers. Function suggest_lod can help users to find an initial value to use for their linkage test. For this example:

(LOD_sug <- suggest_lod(comb_example))
#> [1] 4.155071

Thus, one should consider using LOD = 4.155 for the tests. Please, notice that this is just a guide, not a value to take without any further consideration. For now, we will keep the default values, but later will show that results do not change in our example by using LOD = 3 or LOD = 4.155.

If you want to see the results for a single pair of markers, say M12 and M42, use:

print(twopts_f2, c("M12", "M42"))
#>   Results of the 2-point analysis for markers: M12 and M42 
#>   Criteria: LOD =  3 , Maximum recombination fraction =  0.5 
#> 
#>        rf       LOD 
#> 0.3575533 1.9430940

This was possible because OneMap has a version of the print function that can be applied to objects of class rf_2pts:

class(twopts_f2)
#> [1] "rf_2pts" "f2"

However, objects of this type are too complex to print if you do not specify a pair of markers:

print(twopts_f2)
#>   This is an object of class 'rf_2pts'
#> 
#>   Criteria: LOD = 3 , Maximum recombination fraction = 0.5 
#> 
#>   This object is too complex to print
#>   Type 'print(object, c(mrk1=marker, mrk2=marker))' to see
#>     the analysis for two markers
#>     mrk1 and mrk2 can be the names or numbers of both markers

Strategies for this tutorial example

In this example we follow two different strategies:

First, we will apply the strategy using only recombinations informations. In a second part of this tutorial we show a way to use also reference genome informations. At the and of our analysis we will be able to compare this two strategies drawing the resulted genetic maps.

Using only recombinations informations

Assigning markers to linkage groups

To assign markers to linkage groups, first use the function make_seq to create a (un-ordered) sequence with all markers:

mark_all_f2 <- make_seq(twopts_f2, "all")

Function make_seq is used to create sequences from objects of several different classes. Here, the first argument is of class rf_2pts and the second argument specifies which markers one wants to use ("all" indicates that all markers will be analyzed). The object mark_all_f2 is of class sequence:

class(mark_all_f2)
#> [1] "sequence"

If you want to form groups with a subset of markers, say M1, M3 and M7, use:

mrk_subset <- make_seq(twopts_f2, c(1, 3, 7))

In this case, it was easy because marker names and order in the objects (indicated in vector c(1, 3, 7)) are closed related, that is, you can easily know the position of markers in the object once you know their names. However, this is not true for real data sets, where markers do not have simple names such as M1 or M2.

A good example is to use the vector of markers without segregation distortion that we selected when applying the Chi-square tests.

mark_no_dist_f2 <- make_seq(twopts_f2, no_dist)

In our example, there are no markers with segretion distortion, then the object mark_no_dist_f2 is equivalent to mark_all_f2.

Forming the groups

You can assign markers to linkage groups using the function group:

LGs_f2 <- group(mark_all_f2)
#>    Selecting markers: 
#>    group    1 
#>     ...................................
#>    group    2 
#>     ..................
#>    group    3 
#>     ...................................
LGs_f2
#>   This is an object of class 'group'
#>   It was generated from the object "mark_all_f2"
#> 
#>   Criteria used to assign markers to groups:
#>     LOD = 3 , Maximum recombination fraction = 0.5 
#> 
#>   No. markers:            91 
#>   No. groups:             3 
#>   No. linked markers:     91 
#>   No. unlinked markers:   0 
#> 
#>   Printing groups:
#>   Group 1 : 36 markers
#>     M1 M3 M4 M6 M7 M9 M12 M13 M17 M23 M26 M27 M29 M30 M31 M34 M35 M36 M40 M42 M44 M46 M53 M55 M58 M60 M63 SNP1 SNP2 SNP3 SNP5 SNP6 SNP7 SNP8 SNP9 SNP10 
#> 
#>   Group 2 : 19 markers
#>     M2 M5 M8 M10 M11 M25 M32 M33 M37 M41 M43 M45 M51 M54 M61 M66 SNP24 SNP25 SNP26 
#> 
#>   Group 3 : 36 markers
#>     M14 M15 M16 M18 M19 M20 M21 M22 M24 M28 M38 M39 M47 M48 M49 M50 M52 M56 M57 M59 M62 M64 M65 SNP11 SNP12 SNP13 SNP14 SNP15 SNP16 SNP17 SNP18 SNP19 SNP20 SNP21 SNP22 SNP23

This will show the linkage groups that are formed if criteria defined by max.rf and LOD are applied to define thresholds to be used when assigning markers to linkage groups. If not modified, the same values used for the object twopts (from two-point analysis) will be maintained (so, LOD = 3.0 and max.rf = 0.5 in this example).

Users can easily change the default values. For example, using LOD suggested by suggest_lod (rounded up):

(LGs_f2 <- group(mark_all_f2, LOD = LOD_sug, max.rf = 0.5))
#>    Selecting markers: 
#>    group    1 
#>     ...................................
#>    group    2 
#>     ..................
#>    group    3 
#>     ...................................
#>   This is an object of class 'group'
#>   It was generated from the object "mark_all_f2"
#> 
#>   Criteria used to assign markers to groups:
#>     LOD = 4.155071 , Maximum recombination fraction = 0.5 
#> 
#>   No. markers:            91 
#>   No. groups:             3 
#>   No. linked markers:     91 
#>   No. unlinked markers:   0 
#> 
#>   Printing groups:
#>   Group 1 : 36 markers
#>     M1 M3 M4 M6 M7 M9 M12 M13 M17 M23 M26 M27 M29 M30 M31 M34 M35 M36 M40 M42 M44 M46 M53 M55 M58 M60 M63 SNP1 SNP2 SNP3 SNP5 SNP6 SNP7 SNP8 SNP9 SNP10 
#> 
#>   Group 2 : 19 markers
#>     M2 M5 M8 M10 M11 M25 M32 M33 M37 M41 M43 M45 M51 M54 M61 M66 SNP24 SNP25 SNP26 
#> 
#>   Group 3 : 36 markers
#>     M14 M15 M16 M18 M19 M20 M21 M22 M24 M28 M38 M39 M47 M48 M49 M50 M52 M56 M57 M59 M62 M64 M65 SNP11 SNP12 SNP13 SNP14 SNP15 SNP16 SNP17 SNP18 SNP19 SNP20 SNP21 SNP22 SNP23

No difference was obtained in this example. (The parentheses above are just to avoid typing LGs_f2 in a new row to have the object printed).

We can see that the markers were assigned to three linkage groups with 27, 16 and 23 markers, with no unlinked markers.

Notice the class of object LGs_f2:

class(LGs_f2)
#> [1] "group"

Ordering markers within linkage groups

After assignin markers to linkage groups, the next step is to order the markers within each group.

First, let us choose the mapping function used to display the genetic map. We can choose between Kosambi or Haldane mapping functions. To use Haldane, type

set_map_fun(type = "haldane")

To use Kosambi’s function:

set_map_fun(type = "kosambi")

Linkage group 2

We will start our analysis using the smallest linkage group (group 2). To do so, you must extract it from the object of class group. Let us extract the group 2 using function make_seq:

LG2_f2 <- make_seq(LGs_f2, 2)

The first argument is an object of class group and the second is a number indicating which linkage group will be extracted. In this case, the object LGs_f2, generated by function group, is of class group. In fact, this function can handle different classes of objects.

If you type

LG2_f2
#> 
#> Number of markers: 19
#> Markers in the sequence:
#> M2 M5 M8 M10 M11 M25 M32 M33 M37 M41 M43 M45 M51 M54 M61 M66 SNP24 SNP25 SNP26
#> 
#> Parameters not estimated.

you will see which markers are comprised in the sequence. But notice that no parameters have been estimated so far (the function says Parameters not estimated). This refers to the fact that so far we only attributed markers to linkage groups, but we did not perform any analysis for them as a group - only as pairs. (Does it seem complicated? Do not worry, you will understand details in a moment).

Notice the class of object LG2_f2:

class(LG2_f2)
#> [1] "sequence"

To order markers in this group, you can use a two-point based algorithm such as Seriation (Buetow and Chakravarti, 1987), Rapid Chain Delineation (Doerge, 1996), Recombination Counting and Ordering (Van Os et al., 2005) and Unidirectional Growth (Tan and Fu, 2006):

LG2_ser_f2 <- seriation(LG2_f2)
LG2_rcd_f2 <- rcd(LG2_f2)
LG2_rec_f2 <- record(LG2_f2)
LG2_ug_f2 <- ug(LG2_f2)

For this particular data set, the algorithms provided different results (results not printed in this vignette). For an evaluation and comparison of these methods, see Mollinari et al. (2009).

When possible (i.e., when groups have a small number of markers, in general up to 10 or 11), one should select the best order by comparing the multipoint likelihood of all possible orders between markers (exhaustive search). This procedure is implemented in the function compare. Although feasible for up to 10 or 11 markers, with 7 or more markers it will take a couple of hours until you see the results (depending of course on the computational resources available).

Linkage group 2 has 18 markers, so using function compare is infeasible. Thus we will apply a heuristic that shows reliable results. First, we will choose a moderate number of markers, say 6, to create a framework using the function compare, and then we will position the remaining markers into this framework using function try_seq. The way we choose these initial markers in inbred-based populations is somewhat different from what we did for outcrossing populations, where there is a mixture of segregation patterns (see the vignette for details).

In our scenario, we recommend two methods:

  1. Randomly choose a number of markers and calculate the multipoint likelihood of all possible orders (using the function compare). If the LOD Score of the second best order is greater than a given threshold, say, 3, then take the best order to proceed with the next step. If not, repeat the procedure.
  2. Use some two-point based algorithm to construct a map; then, take equally spaced markers from this map. Then, create a framework of ordered markers using the function compare. Next, try to map the remaining markers, one at a time, beginning with co-dominant ones (most informative ones), then add the dominant ones.

You can do this procedure manually, in a similar way as done for outcrossing species (see the vignette for details). However, this procedure is automated in function order_seq, which we will use here:

LG2_f2_ord <- order_seq(input.seq = LG2_f2, n.init = 5,
                        subset.search = "twopt",
                        twopt.alg = "rcd", THRES = 3)
#> 
#> Cross type:  f2 
#> Choosing initial subset using 'two-point' approach
#> 
#> order obtained using RCD algorithm:
#> 
#>  41 10 43 11 2 32 45 54 66 61 25 5 51 89 90 33 91 37 8 
#> 
#> calculating multipoint map using tol =  0.1 .
#> 
#> 
#> Comparing 60 orders:     
#> 
#> 
  |                                                                            
  |                                                                      |   0%    
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%
#> 
#> 
#> 
#> Running try algorithm
#> 66 --> M66   : ......
#> 37 --> M37   : ......
#> 10 --> M10   : .......
#> 33 --> M33   : ........
#> 54 --> M54   : .........
#> 90 --> SNP25 : ..........
#> 25 --> M25   : ..........
#> 43 --> M43   : ...........
#> 91 --> SNP26 : ............
#>  5 --> M5    : ............
#> 51 --> M51   : .............
#> 45 --> M45   : ..............
#>  2 --> M2    : ..............
#> 11 --> M11   : ...............
#> 
#> LOD threshold = 3 
#> 
#> Positioned markers: 41 10 2 43 32 54 61 25 5 51 89 33 37 8 
#> 
#> Markers not placed on the map: 11 45 66 90 91 
#> 
#> 
#> Calculating LOD-Scores
#> 11 --> M11   : ...............
#> 45 --> M45   : ...............
#> 66 --> M66   : ...............
#> 90 --> SNP25 : ...............
#> 91 --> SNP26 : ...............
#> 
#> 
#> Placing remaining marker(s) at most likely position
#> 66 --> M66   : ...............
#> 91 --> SNP26 : ................
#> 11 --> M11   : .................
#> 45 --> M45   : ..................
#> 90 --> SNP25 : ...................
#> 
#> Estimating final genetic map using tol = 10E-5.

The first argument is an object of class sequence (LG2_f2). n.init = 5 means that five markers will be used in the compare step. The argument subset.search = "twopt" indicates that these five markers should be chosen by using a two point method, which will be Rapid Chain Delineation, as indicated by the argument twopt.alg = "rcd". THRES = 3 indicates that the try_seq step will only add markers to the sequence which can be mapped with LOD Score greater than 3.

Check the order obtained by this procedure:

LG2_f2_ord
#> 
#> Best sequence found.
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 41 M41                0.00           
#> 10 M10                8.66           
#>  2 M2                16.88           
#> 43 M43               22.27           
#> 32 M32               25.71           
#> 54 M54               33.44           
#> 61 M61               41.92           
#> 25 M25               47.80           
#>  5 M5                51.97           
#> 51 M51               56.08           
#> 89 SNP24             67.05           
#> 33 M33               72.14           
#> 37 M37               76.93           
#>  8 M8                82.81           
#> 
#>  14 markers            log-likelihood: -1048.126 
#> 
#> 
#> 
#> The following markers could not be uniquely positioned.
#> Printing most likely positions for each unpositioned marker:
#> 
#> ------------------------------------ 
#> |    |  11 |  45 |  66 |  90 |  91 |
#> |----|-----|-----|-----|-----|-----| 
#> |    |     |     |     |     |     |
#> | 41 |     |     |     |     |     | 
#> |    |     |     |     |     |     |
#> | 10 |     |     |     |     |     | 
#> |    | **  |     |     |     |     |
#> |  2 |     |     |     |     |     | 
#> |    | *** |     |     |     |     |
#> | 43 |     |     |     |     |     | 
#> |    |     | **  |     |     |     |
#> | 32 |     |     |     |     |     | 
#> |    |     | *** |     |     |     |
#> | 54 |     |     |     |     |     | 
#> |    |     |     | *** |     |     |
#> | 61 |     |     |     |     |     | 
#> |    |     |     |     |     |     |
#> | 25 |     |     |     |     |     | 
#> |    |     |     |     |     |     |
#> |  5 |     |     |     |     |     | 
#> |    |     |     |     |     |     |
#> | 51 |     |     |     |     |     | 
#> |    |     |     |     | *** |     |
#> | 89 |     |     |     |     |     | 
#> |    |     |     |     | *** | **  |
#> | 33 |     |     |     |     |     | 
#> |    |     |     |     |     | *** |
#> | 37 |     |     |     |     |     | 
#> |    |     |     |     |     |     |
#> |  8 |     |     |     |     |     | 
#> |    |     |     |     |     |     |
#> ------------------------------------ 
#> 
#> '***' indicates the most likely position(s) (LOD = 0.0)
#> 
#> '**' indicates very likely positions (LOD > -1.0)
#> 
#> '*' indicates likely positions (LOD > -2.0)

Note that markers 11, 32, 37, 66 and 91 could not be safely mapped to a single position (LOD Score > THRES in absolute value). The output displays the safe order and the most likely positions for markers not mapped, where *** indicates the most likely position, and * corresponds to other plausible positions. (If you are familiar with MAPMAKER/EXP, you will recognize the representation).

To get the safe order, use

LG2_f2_safe <- make_seq(LG2_f2_ord, "safe")

and to get the order with all markers (i.e., including the ones not mapped to a single position), use:

(LG2_f2_all <- make_seq(LG2_f2_ord, "force"))
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 41 M41                0.00           
#> 10 M10                8.53           
#>  2 M2                16.61           
#> 11 M11               19.26           
#> 43 M43               22.56           
#> 32 M32               26.33           
#> 45 M45               32.28           
#> 54 M54               34.58           
#> 66 M66               41.59           
#> 61 M61               43.27           
#> 25 M25               48.95           
#>  5 M5                52.87           
#> 51 M51               56.98           
#> 90 SNP25             68.44           
#> 89 SNP24             68.44           
#> 33 M33               73.80           
#> 91 SNP26             75.18           
#> 37 M37               81.31           
#>  8 M8                87.45           
#> 
#>  19 markers            log-likelihood: -1135.265

which places markers 11, 32, 37, 66 and 91 into their most likely positions.

Although some old publications presented maps with only safe orders, we see no reason not to use option force, and recommend it for users.

The order_seq function can perform two rounds of the try_seq step, first using THRES and then THRES - 1 as the threshold. This generally results in safe orders with more markers mapped, but takes longer to run. To do this, type:

LG2_f2_ord <- order_seq(input.seq = LG2_f2, n.init = 5,
                        subset.search = "twopt",
                        twopt.alg = "rcd", THRES = 3,
                        touchdown = TRUE)
#> 
#> Cross type:  f2 
#> Choosing initial subset using 'two-point' approach
#> 
#> order obtained using RCD algorithm:
#> 
#>  41 10 43 11 2 32 45 54 66 61 25 5 51 90 89 33 91 37 8 
#> 
#> calculating multipoint map using tol =  0.1 .
#> 
#> 
#> Comparing 60 orders:     
#> 
#> 
  |                                                                            
  |                                                                      |   0%    
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%
#> 
#> 
#> 
#> Running try algorithm
#> 66 --> M66   : ......
#> 37 --> M37   : ......
#> 10 --> M10   : .......
#> 33 --> M33   : ........
#> 54 --> M54   : .........
#> 89 --> SNP24 : ..........
#> 25 --> M25   : ..........
#> 43 --> M43   : ...........
#> 91 --> SNP26 : ............
#>  5 --> M5    : ............
#> 51 --> M51   : .............
#> 45 --> M45   : ..............
#>  2 --> M2    : ..............
#> 11 --> M11   : ...............
#> 
#> LOD threshold = 3 
#> 
#> Positioned markers: 41 10 2 43 32 54 61 25 5 51 90 33 37 8 
#> 
#> Markers not placed on the map: 11 45 66 89 91 
#> 
#> 
#> 
#> Trying to map remaining markers with LOD threshold  2 
#> 11 --> M11   : ...............
#> 45 --> M45   : ...............
#> 66 --> M66   : ...............
#> 89 --> SNP24 : ................
#> 91 --> SNP26 : ................
#> 
#> LOD threshold = 2 
#> 
#> Positioned markers: 41 10 2 43 32 54 66 61 25 5 51 90 33 37 8 
#> 
#> Markers not placed on the map: 11 45 89 91 
#> 
#> 
#> Calculating LOD-Scores
#> 11 --> M11   : ................
#> 45 --> M45   : ................
#> 89 --> SNP24 : ................
#> 91 --> SNP26 : ................
#> 
#> 
#> Placing remaining marker(s) at most likely position
#> 91 --> SNP26 : ................
#> 11 --> M11   : .................
#> 45 --> M45   : ..................
#> 89 --> SNP24 : ...................
#> 
#> Estimating final genetic map using tol = 10E-5.

The output is too big to be included here, so please try it to see what happens. In short, for this particular sequence, the touchdown step could additionally map two of the five markers (37 and 66), but this depends on the dataset. Let us continue our analysis using the order with all markers as suggested by the function order_seq:

(LG2_f2_final <- make_seq(LG2_f2_ord, "force"))
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 41 M41                0.00           
#> 10 M10                8.53           
#>  2 M2                16.61           
#> 11 M11               19.26           
#> 43 M43               22.56           
#> 32 M32               26.33           
#> 45 M45               32.28           
#> 54 M54               34.58           
#> 66 M66               41.59           
#> 61 M61               43.27           
#> 25 M25               48.95           
#>  5 M5                52.87           
#> 51 M51               56.98           
#> 90 SNP25             68.44           
#> 89 SNP24             68.44           
#> 33 M33               73.80           
#> 91 SNP26             75.18           
#> 37 M37               81.31           
#>  8 M8                87.45           
#> 
#>  19 markers            log-likelihood: -1135.265

Finally, to check for alternative orders, use the ripple_seq function:

ripple_seq(LG2_f2_final, ws = 5, LOD = 3)

The second argument, ws = 5, means that subsets (windows) of five markers will be permutated sequentially (5! orders for each window), to search for other plausible orders. The LOD argument means that only orders with LOD Score smaller than 3 will be printed.

The output shows sequences of five numbers, because ws = 5. They can be followed by an OK, if there are no alternative orders with LOD Scores smaller than LOD = 3 in absolute value, or by a list of alternative orders.

In this example, the first seven windows showed alternative orders with LOD smaller than LOD = 3. However, the best order was that obtained with the order_seq function (LOD = 0.00). If there were an alternative order more likely than the original, one should check the difference between them and, if necessary, change the order with (for example) functions drop_marker (see Section about using an arbitrary order) and try_seq, or simply by typing the new order. For that, use LG2_f2_final$seq.num to obtain the original order; then make the necessary changes (by copying and pasting) and use the function map to reestimate the genetic map for the new order.

The final estimated map can then be printed using

LG2_f2_final
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 41 M41                0.00           
#> 10 M10                8.53           
#>  2 M2                16.61           
#> 11 M11               19.26           
#> 43 M43               22.56           
#> 32 M32               26.33           
#> 45 M45               32.28           
#> 54 M54               34.58           
#> 66 M66               41.59           
#> 61 M61               43.27           
#> 25 M25               48.95           
#>  5 M5                52.87           
#> 51 M51               56.98           
#> 90 SNP25             68.44           
#> 89 SNP24             68.44           
#> 33 M33               73.80           
#> 91 SNP26             75.18           
#> 37 M37               81.31           
#>  8 M8                87.45           
#> 
#>  19 markers            log-likelihood: -1135.265

This is based on multipoint estimation of recombination fractions, using hidden Markov models.

Linkage group 1

Let us analyze linkage group 1. Extract markers from object LGs:

LG1_f2 <- make_seq(LGs_f2, 1)

Construct the linkage map, by automatic usage of the try algorithm:

LG1_f2_ord <- order_seq(input.seq = LG1_f2, n.init = 5,
                        subset.search = "twopt",
                        twopt.alg = "rcd", THRES = 3,
                        touchdown = TRUE)

The second round of try_seq added markers 9, 12, 29, 35, 58, 71 and 72 (try it; results not shown).

Get the order with all markers:

(LG1_f2_final <- make_seq(LG1_f2_ord, "force"))
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 55 M55                0.00           
#> 27 M27                7.69           
#>  9 M9                10.16           
#>  3 M3                21.27           
#>  4 M4                23.59           
#> 42 M42               30.05           
#> 53 M53               31.58           
#> 46 M46               35.89           
#>  1 M1                44.72           
#> 69 SNP3              50.00           
#> 30 M30               52.86           
#> 72 SNP7              63.75           
#>  7 M7                67.01           
#> 70 SNP5              68.76           
#> 71 SNP6              74.36           
#>  6 M6                83.33           
#> 13 M13               88.49           
#> 35 M35               92.83           
#> 58 M58              100.58           
#> 74 SNP9             111.44           
#> 73 SNP8             117.75           
#> 12 M12              119.41           
#> 75 SNP10            121.29           
#> 17 M17              126.83           
#> 31 M31              130.34           
#> 34 M34              139.45           
#> 63 M63              139.45           
#> 26 M26              147.63           
#> 40 M40              151.23           
#> 36 M36              159.23           
#> 67 SNP1             162.11           
#> 44 M44              164.65           
#> 68 SNP2             167.29           
#> 29 M29              176.53           
#> 60 M60              179.85           
#> 23 M23              188.25           
#> 
#>  36 markers            log-likelihood: -2250.509

Check the final map (results not shown):

ripple_seq(LG1_f2_final, ws = 5)

No alternative order was found (please, try it).

Print it:

LG1_f2_final
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 55 M55                0.00           
#> 27 M27                7.69           
#>  9 M9                10.16           
#>  3 M3                21.27           
#>  4 M4                23.59           
#> 42 M42               30.05           
#> 53 M53               31.58           
#> 46 M46               35.89           
#>  1 M1                44.72           
#> 69 SNP3              50.00           
#> 30 M30               52.86           
#> 72 SNP7              63.75           
#>  7 M7                67.01           
#> 70 SNP5              68.76           
#> 71 SNP6              74.36           
#>  6 M6                83.33           
#> 13 M13               88.49           
#> 35 M35               92.83           
#> 58 M58              100.58           
#> 74 SNP9             111.44           
#> 73 SNP8             117.75           
#> 12 M12              119.41           
#> 75 SNP10            121.29           
#> 17 M17              126.83           
#> 31 M31              130.34           
#> 34 M34              139.45           
#> 63 M63              139.45           
#> 26 M26              147.63           
#> 40 M40              151.23           
#> 36 M36              159.23           
#> 67 SNP1             162.11           
#> 44 M44              164.65           
#> 68 SNP2             167.29           
#> 29 M29              176.53           
#> 60 M60              179.85           
#> 23 M23              188.25           
#> 
#>  36 markers            log-likelihood: -2250.509

This is the final version of the map for this linkage group.

Linkage group 3

Extract markers from object LGs_f2:

LG3_f2 <- make_seq(LGs_f2, 3)

Construct the linkage map, by automatic usage of try algorithm.

LG3_f2_ord <- order_seq(input.seq = LG3_f2, n.init = 5,
                        subset.search = "twopt",
                        twopt.alg = "rcd", THRES = 3,
                        touchdown = TRUE)

We can see that in the second round of try_seq markers 50, 64, 78 and 86 were added (please, try it). A careful examination of the graphics can be a good source of information about how markers where placed.

Now, get the order with all markers:

(LG3_f2_final <- make_seq(LG3_f2_ord, "force"))
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 47 M47                0.00           
#> 19 M19                7.56           
#> 39 M39                8.94           
#> 38 M38               15.81           
#> 49 M49               23.71           
#> 59 M59               24.88           
#> 78 SNP13             35.91           
#> 28 M28               39.40           
#> 76 SNP11             41.34           
#> 80 SNP15             45.45           
#> 85 SNP20             55.98           
#> 83 SNP18             61.10           
#> 14 M14               62.67           
#> 82 SNP17             64.90           
#> 16 M16               70.87           
#> 79 SNP14             80.95           
#> 65 M65               86.12           
#> 77 SNP12             91.55           
#> 62 M62              101.24           
#> 15 M15              104.96           
#> 21 M21              108.67           
#> 24 M24              112.05           
#> 20 M20              118.55           
#> 64 M64              119.07           
#> 81 SNP16            128.75           
#> 84 SNP19            134.28           
#> 52 M52              136.53           
#> 48 M48              141.80           
#> 57 M57              147.83           
#> 22 M22              151.20           
#> 86 SNP21            158.16           
#> 88 SNP23            163.24           
#> 18 M18              164.72           
#> 87 SNP22            167.97           
#> 56 M56              179.82           
#> 50 M50              182.43           
#> 
#>  36 markers            log-likelihood: -2400.784

Check the final map (not shown):

ripple_seq(LG3_f2_final, ws = 5)

No better alternative order was observed.

Print it:

LG3_f2_final
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 47 M47                0.00           
#> 19 M19                7.56           
#> 39 M39                8.94           
#> 38 M38               15.81           
#> 49 M49               23.71           
#> 59 M59               24.88           
#> 78 SNP13             35.91           
#> 28 M28               39.40           
#> 76 SNP11             41.34           
#> 80 SNP15             45.45           
#> 85 SNP20             55.98           
#> 83 SNP18             61.10           
#> 14 M14               62.67           
#> 82 SNP17             64.90           
#> 16 M16               70.87           
#> 79 SNP14             80.95           
#> 65 M65               86.12           
#> 77 SNP12             91.55           
#> 62 M62              101.24           
#> 15 M15              104.96           
#> 21 M21              108.67           
#> 24 M24              112.05           
#> 20 M20              118.55           
#> 64 M64              119.07           
#> 81 SNP16            128.75           
#> 84 SNP19            134.28           
#> 52 M52              136.53           
#> 48 M48              141.80           
#> 57 M57              147.83           
#> 22 M22              151.20           
#> 86 SNP21            158.16           
#> 88 SNP23            163.24           
#> 18 M18              164.72           
#> 87 SNP22            167.97           
#> 56 M56              179.82           
#> 50 M50              182.43           
#> 
#>  36 markers            log-likelihood: -2400.784

Plotting the recombination fraction matrix

It is possible to plot the recombination fraction matrix and LOD Scores based on a color scale using the function rf_graph_table. This matrix can be useful to make some diagnostics about the map.

Just as an example, let us place M38 at the end of linkage group 3 (wrong position) to check how we can see that in the graphic. First, let us to remove it from the linkage group:

temp_seq <- drop_marker(LG3_f2_final, 38)

Now, we will force it to be positioned at the end of the linkage group:

(temp_seq <- add_marker(temp_seq, 38))
#> 
#> Number of markers: 36
#> Markers in the sequence:
#> M47 M19 M39 M49 M59 SNP13 M28 SNP11 SNP15 SNP20 SNP18 M14 SNP17 M16 SNP14 M65 
#> SNP12 M62 M15 M21 M24 M20 M64 SNP16 SNP19 M52 M48 M57 M22 SNP21 SNP23 M18 SNP22 
#> M56 M50 M38
#> 
#> Parameters not estimated.
(LG3_f2_wrong <- map(temp_seq))
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 47 M47                0.00           
#> 19 M19                7.44           
#> 39 M39                9.14           
#> 49 M49               22.83           
#> 59 M59               25.17           
#> 78 SNP13             35.49           
#> 28 M28               39.01           
#> 76 SNP11             40.95           
#> 80 SNP15             45.06           
#> 85 SNP20             55.58           
#> 83 SNP18             60.69           
#> 14 M14               62.27           
#> 82 SNP17             64.49           
#> 16 M16               70.47           
#> 79 SNP14             80.54           
#> 65 M65               85.71           
#> 77 SNP12             91.14           
#> 62 M62              100.84           
#> 15 M15              104.55           
#> 21 M21              108.27           
#> 24 M24              111.65           
#> 20 M20              118.15           
#> 64 M64              118.66           
#> 81 SNP16            128.34           
#> 84 SNP19            133.87           
#> 52 M52              136.13           
#> 48 M48              141.39           
#> 57 M57              147.42           
#> 22 M22              150.80           
#> 86 SNP21            157.76           
#> 88 SNP23            162.83           
#> 18 M18              164.32           
#> 87 SNP22            167.56           
#> 56 M56              179.42           
#> 50 M50              181.94           
#> 38 M38              239.62           
#> 
#>  36 markers            log-likelihood: -2527.534

Examining the results, we can see there is a big gap at the end of linkage group 3 (between markers M50 and M38, as expected.

Let us now plot the recombination fraction matrix:

rf_graph_table(LG3_f2_wrong)

With default arguments, the graphic cells represents the recombination fractions. If you change the argument to graph.LOD = TRUE, LOD score values are plotted. The color scale varies from red (small distances and big LODs) to dark blue.

You can also plot an interactive version of this graphic, changing option inter to TRUE and defined a name to the html file generated:

rf_graph_table(LG3_f2_wrong, inter = TRUE, html.file = "LG3_f2_wrong.html")

An interactive version of the graphic will pop up (not shown here) in your internet browser end generated a html file in your work directory. Hover the mouse cursor over the cell corresponding to two markers, you can see some useful information about them. For example, over the cell corresponding to markers M47 and M19 you can see their names, types (co-dominant and dominant), recombination fraction (rf = 0.074) and LOD Score (LOD = 23). Over a cell on the diagonal, some information about the corresponding marker is shown, including percentage of missing data. We found this to be very useful when evaluating the results of the ordering algorithms.

You can also change que number of colors from rainbow palette with argument n.colors, add/remove graphic main and axis title (main and lab.xy), and shows marker numbers, insted of names in the axis (mrk.axis).

rf_graph_table(LG3_f2_wrong, n.colors = 7, main="LG3", lab.xy = c("markers", "markers"), mrk.axis = "numbers")

We clearly see a different pattern for marker M38. The blue cell, corresponding to markers M50 and M38, indicates a big recombination fraction between these markers as seen before (by clicking, rf = 0.4049). Moreover, we can see a group of red cells corresponding to marker M38 and other markers as M47, M19, M39 and M49. This pattern indicates small recombination fractions between marker M38 and these other markers. Hence, M38 is supposed to be close to them on the map.

Because we have enough evidence that marker M38 is misplaced, let us drop this marker and try to map it using the function try_seq:

temp_seq <- drop_marker(LG3_f2_wrong, 38)
temp_map <- map(temp_seq)
(temp_try <- try_seq(temp_map, 38))
#> 38 --> M38   : ....................................
#> 
#> LOD scores correspond to the best linkage phase combination
#> for each position
#> 
#> The symbol "*" outside the box indicates that more than one
#> linkage phase is possible for the corresponding position
#> 
#> 
#>        Marker tested: 38
#> 
#>        Markers      LOD
#>      ======================
#>      |                    |
#>      |            -27.70  |  1  
#>      |  47                | 
#>      |            -24.58  |  2  
#>      |  19                | 
#>      |             -9.72  |  3  
#>      |  39                | 
#>      |              0.00  |  4  
#>      |  49                | 
#>      |            -17.43  |  5  
#>      |  59                | 
#>      |            -27.50  |  6  
#>      |  78                | 
#>      |            -68.03  |  7  
#>      |  28                | 
#>      |            -72.63  |  8  
#>      |  76                | 
#>      |            -68.45  |  9  
#>      |  80                | 
#>      |            -53.97  |  10  
#>      |  85                | 
#>      |            -69.71  |  11  
#>      |  83                | 
#>      |            -82.70  |  12  
#>      |  14                | 
#>      |            -79.77  |  13  
#>      |  82                | 
#>      |            -69.78  |  14  
#>      |  16                | 
#>      |            -71.51  |  15  
#>      |  79                | 
#>      |            -92.91  |  16  
#>      |  65                | 
#>      |            -93.17  |  17  
#>      |  77                | 
#>      |            -80.94  |  18  
#>      |  62                | 
#>      |            -96.11  |  19  
#>      |  15                | 
#>      |            -97.12  |  20  
#>      |  21                | 
#>      |            -98.70  |  21  
#>      |  24                | 
#>      |            -94.17  |  22  
#>      |  20                | 
#>      |            -89.13  |  23  
#>      |  64                | 
#>      |            -87.60  |  24  
#>      |  81                | 
#>      |            -98.60  |  25  
#>      |  84                | 
#>      |           -110.51  |  26  
#>      |  52                | 
#>      |            -97.67  |  27  
#>      |  48                | 
#>      |           -100.08  |  28  
#>      |  57                | 
#>      |           -109.84  |  29  
#>      |  22                | 
#>      |            -95.03  |  30  
#>      |  86                | 
#>      |           -104.05  |  31  
#>      |  88                | 
#>      |           -120.57  |  32  
#>      |  18                | 
#>      |           -110.57  |  33  
#>      |  87                | 
#>      |            -84.52  |  34  
#>      |  56                | 
#>      |            -87.05  |  35  
#>      |  50                | 
#>      |            -71.32  |  36  
#>      |                    |
#>      ======================

We can see that the most likely position for marker M38 is between markers M39 and M49 (position 4). The patterns on the color matrix are now better. Therefore, you should do

(LG3_f2_final <- make_seq(temp_try, 4))
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 47 M47                0.00           
#> 19 M19                7.73           
#> 39 M39                7.98           
#> 38 M38               15.25           
#> 49 M49               23.40           
#> 59 M59               23.59           
#> 78 SNP13             35.25           
#> 28 M28               38.84           
#> 76 SNP11             40.76           
#> 80 SNP15             44.87           
#> 85 SNP20             55.63           
#> 83 SNP18             61.02           
#> 14 M14               62.77           
#> 82 SNP17             65.38           
#> 16 M16               71.87           
#> 79 SNP14             82.29           
#> 65 M65               87.62           
#> 77 SNP12             93.25           
#> 62 M62              103.57           
#> 15 M15              107.44           
#> 21 M21              111.33           
#> 24 M24              114.57           
#> 20 M20              121.30           
#> 64 M64              121.47           
#> 81 SNP16            131.43           
#> 84 SNP19            137.55           
#> 52 M52              140.24           
#> 48 M48              145.48           
#> 57 M57              151.43           
#> 22 M22              154.83           
#> 86 SNP21            161.82           
#> 88 SNP23            166.93           
#> 18 M18              168.41           
#> 87 SNP22            171.68           
#> 56 M56              183.61           
#> 50 M50              186.22           
#> 
#>  36 markers            log-likelihood: -2401.428

We can also check the heatmap matrix for the other groups ordered. This is a good map diagnostic and can be used during the map building procedure:

rf_graph_table(LG1_f2_final)


rf_graph_table(LG2_f2_final)

Using the recombinations and the reference genome informations

In our example, we have reference genome chromosome and position informations for some of the markers, here we will examplify one method of using this informations to help build the genetic map.

With the CHROM informations in the input file, you can identify markers belonging to some chromosome using the function make_seq with the rf_2pts object. For example, assign the string "1" for the second argument to get chromosome 1 makers. The output sequence will be automatically ordered by POS informations.

CHR1 <- make_seq(twopts_f2, "1")
CHR1
#> 
#> Number of markers: 9
#> Markers in the sequence:
#> SNP1 SNP2 SNP3 SNP5 SNP6 SNP7 SNP8 SNP9 SNP10
#> 
#> Parameters not estimated.
CHR2 <- make_seq(twopts_f2, "2")
CHR3 <- make_seq(twopts_f2, "3")

Adding markers with no reference genome informations

According to CHROM informations we have three defined linkage groups, now we can try to group the markers without chromossome informations to them using recombination informations. For this, we can use the function group_seq:

CHR_mks <- group_seq(input.2pts = twopts_f2, seqs = "CHROM", unlink.mks = mark_all_f2,
                      repeated = FALSE)
#>    Selecting markers: 
#>    group    1 
#>     ...................................
#>    group    2 
#>     ...............
#>    group    3 
#>     ......................
#>    Selecting markers: 
#>    group    1 
#>     ...................................
#>    group    2 
#>     ..........................
#>    group    3 
#>     ...............
#>    Selecting markers: 
#>    group    1 
#>     ..................
#>    group    2 
#>     ..........................
#>    group    3 
#>     ......................

The function works as the function group, but considering preexisting sequences. Setting seqs argument with the string "CHROM", it will considered the preexisting sequences according to CHROM information. You can also indicate others preexisting sequences if it make sense for your study. For that, you should inform a list with objects of class sequences, as the example:

CHR_mks <- group_seq(input.2pts = twopts_f2, seqs = list(CHR1=CHR1, CHR2=CHR2, CHR3=CHR3), 
                      unlink.mks = mark_all_f2, repeated = FALSE)

In this case, the command had the same effect of the previous, because we indicate chromossome sequences, but others sequences can be used.

The unlink.mks argument receive a object of class sequence, this define which markers will be tested to group with the sequences in seqs. In our example, we will indicate only the markers with no segregation distortion, using the sequence mark_no_dist. It is also possible to use the string "all" to test all the remining markers at the rf_2pts object.

In some cases, the same marker can group to more than one sequence, those markers will be considered repeated. We can choose if we want to remove or not (FALSE/TRUE) them of the output sequences, with the argument rm.repeated. Anyway, their numbers will be informed at the list repeateds in the output object. In the example case, there are no repeated markers. However, if they exists, it could indicate that their groups actually constitute the same group. Also, genotyping erros can generate repeated markers. Anyway, they deserves better investigations.

We can access detailed information about the results just printing:

CHR_mks
#>   This is an object of class 'group_seq'
#>   It was generated from the object "comb_example"
#> 
#>   Criteria used to assign markers to groups:
#>     LOD = 3 , Maximum recombination fraction = 0.5 
#> 
#>   No. markers in input sequences:
#>                        CHR1 :   9 markers
#>                        CHR2 :   13 markers
#>                        CHR3 :   3 markers
#> 
#>   No. unlinked input markers:   66 markers
#> 
#>   No. markers in output sequences:
#>                        CHR1 :   36 markers
#>                        CHR2 :   36 markers
#>                        CHR3 :   19 markers
#>   No. unlinked:                 0 markers
#>   No. repeated:                 0 markers
#> 
#>   Printing output sequences:
#>   Group CHR1 : 36 markers
#>      
#> 
#>   Group CHR2 : 36 markers
#>      
#> 
#>   Group CHR3 : 19 markers
#>      
#> 
#>   Unlinked markers: 0 markers
#>     
#> 
#>   Repeated markers: 0  markers
#> 

Also, we can access the numbers of repeated markers with:

CHR_mks$repeated
#> [1] NA

The same way, we can access the output sequences:

CHR_mks$sequences$CHR1
#> 
#> Number of markers: 36
#> Markers in the sequence:
#> SNP1 SNP2 SNP3 SNP5 SNP6 SNP7 SNP8 SNP9 SNP10 M1 M3 M4 M6 M7 M9 M12 M13 M17 M23 
#> M26 M27 M29 M30 M31 M34 M35 M36 M40 M42 M44 M46 M53 M55 M58 M60 M63
#> 
#> Parameters not estimated.
# or
CHR_mks$sequences[[1]]
#> 
#> Number of markers: 36
#> Markers in the sequence:
#> SNP1 SNP2 SNP3 SNP5 SNP6 SNP7 SNP8 SNP9 SNP10 M1 M3 M4 M6 M7 M9 M12 M13 M17 M23 
#> M26 M27 M29 M30 M31 M34 M35 M36 M40 M42 M44 M46 M53 M55 M58 M60 M63
#> 
#> Parameters not estimated.

For this function, optional arguments are LOD and max.rf, which define thresholds to be used when assigning markers to linkage groups. If none provided (default), criteria previously defined for the object rf_2pts are used.

Now we can order the markers in each group as we made before (Ordering markers within linkage groups). As showed, we can choose different approaches to order the markers.

To order those groups, first we will use order_seq function to access a preliminary order and after, we will edit some markers position or remove some of them according with they color pattern in rf_graph_table graphic, and other parameters as likelihood and map size.

Linkage group 1

CHR1_ord <- order_seq(CHR_mks$sequences$CHR1)
CHR1_frame <- make_seq(CHR1_ord, "force")
rf_graph_table(CHR1_frame) # graphic not showed

The group is similar to that builded before with only recombinations informations. We will better explore differences in a latter step. Only marker 58 do not follow exactly the expected color pattern, then we will try to repositioned it.

CHR1_test_seq <- drop_marker(CHR1_frame, 58)
CHR1_test_map <- map(CHR1_test_seq)
CHR1_add58_seq <- try_seq(CHR1_test_map, 58)
#> 58 --> M58   : ....................................
CHR1_add58 <- make_seq(CHR1_add58_seq, 20) # marker 58 was placed at the same position as before

Comparing with and without marker 58:

CHR1_test_map
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 23 M23                0.00           
#> 55 M55               48.14           
#> 27 M27               55.87           
#>  9 M9                58.35           
#>  3 M3                69.44           
#>  4 M4                71.76           
#> 42 M42               78.21           
#> 53 M53               79.75           
#> 46 M46               84.06           
#>  1 M1                92.88           
#> 69 SNP3              98.17           
#> 30 M30              101.03           
#> 72 SNP7             111.92           
#>  7 M7               115.18           
#> 70 SNP5             116.92           
#> 71 SNP6             122.50           
#>  6 M6               131.09           
#> 13 M13              136.07           
#> 35 M35              143.22           
#> 74 SNP9             158.07           
#> 73 SNP8             164.53           
#> 12 M12              166.23           
#> 75 SNP10            168.14           
#> 17 M17              173.78           
#> 31 M31              177.29           
#> 34 M34              186.40           
#> 63 M63              186.40           
#> 26 M26              194.57           
#> 40 M40              198.18           
#> 36 M36              206.11           
#> 67 SNP1             209.02           
#> 44 M44              211.57           
#> 68 SNP2             214.22           
#> 29 M29              223.45           
#> 60 M60              226.75           
#> 
#>  35 markers            log-likelihood: -2257.143
rf_graph_table(CHR1_test_map) # graphic not showed
CHR1_add58
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 23 M23                0.00           
#> 55 M55               46.18           
#> 27 M27               53.75           
#>  9 M9                56.21           
#>  3 M3                67.51           
#>  4 M4                67.77           
#> 42 M42               75.68           
#> 53 M53               75.91           
#> 46 M46               80.67           
#>  1 M1                89.39           
#> 69 SNP3              95.22           
#> 30 M30               98.46           
#> 72 SNP7             109.22           
#>  7 M7               112.46           
#> 70 SNP5             114.69           
#> 71 SNP6             120.74           
#>  6 M6               130.13           
#> 13 M13              135.61           
#> 35 M35              135.84           
#> 58 M58              143.63           
#> 74 SNP9             155.26           
#> 73 SNP8             162.09           
#> 12 M12              164.16           
#> 75 SNP10            166.01           
#> 17 M17              171.63           
#> 31 M31              175.39           
#> 34 M34              184.58           
#> 63 M63              184.59           
#> 26 M26              192.77           
#> 40 M40              196.40           
#> 36 M36              204.43           
#> 67 SNP1             207.19           
#> 44 M44              209.80           
#> 68 SNP2             212.48           
#> 29 M29              221.55           
#> 60 M60              224.62           
#> 
#>  36 markers            log-likelihood: -2288.812
rf_graph_table(CHR1_add58)

Based in those results, we decide to keep marker 58 in our map.

CHR1_final <- CHR1_add58

Checking for better orders:

ripple_seq(CHR1_final)
#> 23-55-27-9-|-3-...
#>   Alternative orders:
#>    23 55 27 9 ... :    0.00 
#>    23 55 9 27 ... :   -2.81 
#> 
#> ...-23-|-55-27-9-3-|-4-...
#>   Alternative orders:
#>    55 27 9 3 ... :    0.00 
#>    55 9 27 3 ... :   -2.81 
#> 
#> ...-55-|-27-9-3-4-|-42-...
#>   Alternative orders:
#>   ... 27 9 3 4 ... :    0.00 
#>   ... 9 27 3 4 ... :   -2.81 
#> 
#> ...-27-|-9-3-4-42-|-53-... OK
#> 
#> ...-9-|-3-4-42-53-|-46-...
#>   Alternative orders:
#>   ... 3 4 42 53 ... :    0.00 
#>   ... 3 4 53 42 ... :   -1.63 
#>   ... 3 53 4 42 ... :   -1.86 
#> 
#> ...-3-|-4-42-53-46-|-1-...
#>   Alternative orders:
#>   ... 4 42 53 46 ... :    0.00 
#>   ... 4 53 42 46 ... :   -1.63 
#>   ... 53 4 42 46 ... :   -1.86 
#> 
#> ...-4-|-42-53-46-1-|-69-...
#>   Alternative orders:
#>   ... 42 53 46 1 ... :    0.00 
#>   ... 53 42 46 1 ... :   -1.63 
#> 
#> ...-42-|-53-46-1-69-|-30-... OK
#> 
#> ...-53-|-46-1-69-30-|-72-...
#>   Alternative orders:
#>   ... 46 1 69 30 ... :    0.00 
#>   ... 46 1 30 69 ... :   -1.93 
#> 
#> ...-46-|-1-69-30-72-|-7-...
#>   Alternative orders:
#>   ... 1 69 30 72 ... :    0.00 
#>   ... 1 30 69 72 ... :   -1.93 
#> 
#> ...-1-|-69-30-72-7-|-70-...
#>   Alternative orders:
#>   ... 69 30 72 7 ... :    0.00 
#>   ... 30 69 72 7 ... :   -1.93 
#> 
#> ...-69-|-30-72-7-70-|-71-...
#>   Alternative orders:
#>   ... 30 72 7 70 ... :    0.00 
#>   ... 30 70 7 72 ... :   -0.23 
#>   ... 30 72 70 7 ... :   -0.33 
#>   ... 30 7 70 72 ... :   -2.52 
#> 
#> ...-30-|-72-7-70-71-|-6-...
#>   Alternative orders:
#>   ... 72 7 70 71 ... :    0.00 
#>   ... 70 7 72 71 ... :   -0.23 
#>   ... 72 70 7 71 ... :   -0.33 
#>   ... 71 72 7 70 ... :   -0.62 
#>   ... 72 71 7 70 ... :   -2.47 
#>   ... 7 70 72 71 ... :   -2.52 
#>   ... 71 70 7 72 ... :   -2.80 
#>   ... 71 7 70 72 ... :   -2.99 
#> 
#> ...-72-|-7-70-71-6-|-13-...
#>   Alternative orders:
#>   ... 7 70 71 6 ... :    0.00 
#>   ... 70 7 71 6 ... :   -0.33 
#>   ... 71 7 70 6 ... :   -2.47 
#> 
#> ...-7-|-70-71-6-13-|-35-... OK
#> 
#> ...-70-|-71-6-13-35-|-58-...
#>   Alternative orders:
#>   ... 71 6 13 35 ... :    0.00 
#>   ... 71 35 6 13 ... :   -2.57 
#>   ... 71 6 35 13 ... :   -2.72 
#> 
#> ...-71-|-6-13-35-58-|-74-...
#>   Alternative orders:
#>   ... 6 13 35 58 ... :    0.00 
#>   ... 35 6 13 58 ... :   -2.57 
#>   ... 6 35 13 58 ... :   -2.72 
#> 
#> ...-6-|-13-35-58-74-|-73-...
#>   Alternative orders:
#>   ... 13 35 58 74 ... :    0.00 
#>   ... 35 13 58 74 ... :   -2.72 
#> 
#> ...-13-|-35-58-74-73-|-12-... OK
#> 
#> ...-35-|-58-74-73-12-|-75-...
#>   Alternative orders:
#>   ... 58 74 73 12 ... :    0.00 
#>   ... 58 74 12 73 ... :   -1.71 
#> 
#> ...-58-|-74-73-12-75-|-17-...
#>   Alternative orders:
#>   ... 74 73 12 75 ... :    0.00 
#>   ... 74 12 73 75 ... :   -1.71 
#>   ... 74 75 12 73 ... :   -2.23 
#> 
#> ...-74-|-73-12-75-17-|-31-...
#>   Alternative orders:
#>   ... 73 12 75 17 ... :    0.00 
#>   ... 12 73 75 17 ... :   -1.71 
#>   ... 75 12 73 17 ... :   -2.23 
#> 
#> ...-73-|-12-75-17-31-|-34-... OK
#> 
#> ...-12-|-75-17-31-34-|-63-... OK
#> 
#> ...-75-|-17-31-34-63-|-26-...
#>   Alternative orders:
#>   ... 17 31 34 63 ... :    0.00 
#>   ... 17 31 63 34 ... :   -0.02 
#> 
#> ...-17-|-31-34-63-26-|-40-...
#>   Alternative orders:
#>   ... 31 34 63 26 ... :    0.00 
#>   ... 31 63 34 26 ... :   -0.02 
#> 
#> ...-31-|-34-63-26-40-|-36-...
#>   Alternative orders:
#>   ... 34 63 26 40 ... :    0.00 
#>   ... 63 34 26 40 ... :   -0.02 
#> 
#> ...-34-|-63-26-40-36-|-67-... OK
#> 
#> ...-63-|-26-40-36-67-|-44-... OK
#> 
#> ...-26-|-40-36-67-44-|-68-... OK
#> 
#> ...-40-|-36-67-44-68-|-29-...
#>   Alternative orders:
#>   ... 36 68 44 67 ... :    0.00 
#>   ... 36 67 44 68 ... :   -0.23 
#> 
#> ...-36-|-67-44-68-29-|-60-...
#>   Alternative orders:
#>   ... 68 44 67 29 :    0.00 
#>   ... 67 44 68 29 :   -0.23 
#> 
#> 67-|-44-68-29-60 OK

Linkage group 2

CHR2_ord <- order_seq(CHR_mks$sequences$CHR2)
CHR2_frame <- make_seq(CHR2_ord, "force")
rf_graph_table(CHR2_frame) # graphic not showed

The marker 20 presented a color pattern different of expected.

CHR2_test_seq <- drop_marker(CHR2_frame, 20)
CHR2_test_map <- map(CHR2_test_seq)
CHR2_add20_seq <- try_seq(CHR2_test_map, 20)
#> 20 --> M20   : ....................................
CHR2_add20 <- make_seq(CHR2_add20_seq, 20) # marker 20 was placed at the same position as before

Comparing with and without marker 58:

CHR2_test_map
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 47 M47                0.00           
#> 19 M19                7.56           
#> 39 M39                8.94           
#> 38 M38               15.81           
#> 49 M49               23.70           
#> 59 M59               24.88           
#> 78 SNP13             35.91           
#> 28 M28               39.40           
#> 76 SNP11             41.34           
#> 80 SNP15             45.45           
#> 85 SNP20             55.98           
#> 83 SNP18             61.10           
#> 14 M14               62.67           
#> 82 SNP17             64.90           
#> 16 M16               70.87           
#> 79 SNP14             80.95           
#> 65 M65               86.12           
#> 77 SNP12             91.55           
#> 62 M62              101.25           
#> 15 M15              104.96           
#> 21 M21              108.67           
#> 24 M24              112.12           
#> 64 M64              118.31           
#> 81 SNP16            127.51           
#> 84 SNP19            133.23           
#> 52 M52              135.56           
#> 48 M48              140.97           
#> 57 M57              146.98           
#> 22 M22              150.36           
#> 86 SNP21            157.20           
#> 18 M18              160.62           
#> 88 SNP23            162.17           
#> 87 SNP22            167.09           
#> 56 M56              178.98           
#> 50 M50              181.59           
#> 
#>  35 markers            log-likelihood: -2369.779
rf_graph_table(CHR1_test_map)

CHR2_add20
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 47 M47                0.00           
#> 19 M19                7.73           
#> 39 M39                7.98           
#> 38 M38               15.25           
#> 49 M49               23.40           
#> 59 M59               23.59           
#> 78 SNP13             35.25           
#> 28 M28               38.84           
#> 76 SNP11             40.76           
#> 80 SNP15             44.87           
#> 85 SNP20             55.63           
#> 83 SNP18             61.02           
#> 14 M14               62.77           
#> 82 SNP17             65.38           
#> 16 M16               71.88           
#> 79 SNP14             82.35           
#> 65 M65               87.70           
#> 77 SNP12             93.38           
#> 62 M62              104.30           
#> 20 M20              117.45           
#> 15 M15              130.08           
#> 21 M21              133.59           
#> 24 M24              138.74           
#> 64 M64              139.02           
#> 81 SNP16            150.70           
#> 84 SNP19            156.94           
#> 52 M52              159.69           
#> 48 M48              165.01           
#> 57 M57              170.97           
#> 22 M22              174.37           
#> 86 SNP21            181.28           
#> 18 M18              184.76           
#> 88 SNP23            186.30           
#> 87 SNP22            191.21           
#> 56 M56              203.16           
#> 50 M50              205.77           
#> 
#>  36 markers            log-likelihood: -2476.901
rf_graph_table(CHR2_add20)  # graphic not showed

Based in those results, we decide to not include marker 20 in our map.

CHR2_final <- CHR2_test_map

Checking for better orders:

ripple_seq(CHR2_final)
#> 47-19-39-38-|-49-...
#>   Alternative orders:
#>    47 19 39 38 ... :    0.00 
#>    47 39 19 38 ... :   -0.05 
#> 
#> ...-47-|-19-39-38-49-|-59-...
#>   Alternative orders:
#>    19 39 38 49 ... :    0.00 
#>    39 19 38 49 ... :   -0.05 
#> 
#> ...-19-|-39-38-49-59-|-78-...
#>   Alternative orders:
#>   ... 39 38 49 59 ... :    0.00 
#>   ... 39 38 59 49 ... :   -0.09 
#> 
#> ...-39-|-38-49-59-78-|-28-...
#>   Alternative orders:
#>   ... 38 49 59 78 ... :    0.00 
#>   ... 38 59 49 78 ... :   -0.09 
#> 
#> ...-38-|-49-59-78-28-|-76-...
#>   Alternative orders:
#>   ... 49 59 78 28 ... :    0.00 
#>   ... 59 49 78 28 ... :   -0.09 
#> 
#> ...-49-|-59-78-28-76-|-80-... OK
#> 
#> ...-59-|-78-28-76-80-|-85-...
#>   Alternative orders:
#>   ... 80 76 28 78 ... :    0.00 
#>   ... 76 80 28 78 ... :   -1.26 
#> 
#> ...-78-|-28-76-80-85-|-83-...
#>   Alternative orders:
#>   ... 28 76 80 85 ... :    0.00 
#>   ... 28 80 76 85 ... :   -2.46 
#> 
#> ...-28-|-76-80-85-83-|-14-...
#>   Alternative orders:
#>   ... 76 80 85 83 ... :    0.00 
#>   ... 80 76 85 83 ... :   -2.46 
#> 
#> ...-76-|-80-85-83-14-|-82-...
#>   Alternative orders:
#>   ... 80 85 83 14 ... :    0.00 
#>   ... 80 83 14 85 ... :   -2.53 
#> 
#> ...-80-|-85-83-14-82-|-16-...
#>   Alternative orders:
#>   ... 85 83 14 82 ... :    0.00 
#>   ... 85 82 14 83 ... :   -1.63 
#>   ... 83 14 85 82 ... :   -2.53 
#> 
#> ...-85-|-83-14-82-16-|-79-...
#>   Alternative orders:
#>   ... 83 14 82 16 ... :    0.00 
#>   ... 82 14 83 16 ... :   -1.63 
#> 
#> ...-83-|-14-82-16-79-|-65-... OK
#> 
#> ...-14-|-82-16-79-65-|-77-...
#>   Alternative orders:
#>   ... 82 16 79 65 ... :    0.00 
#>   ... 82 16 65 79 ... :   -2.19 
#> 
#> ...-82-|-16-79-65-77-|-62-...
#>   Alternative orders:
#>   ... 16 79 65 77 ... :    0.00 
#>   ... 16 65 79 77 ... :   -2.19 
#>   ... 16 65 77 79 ... :   -2.34 
#>   ... 16 79 77 65 ... :   -2.50 
#>   ... 16 77 65 79 ... :   -2.96 
#> 
#> ...-16-|-79-65-77-62-|-15-...
#>   Alternative orders:
#>   ... 79 65 77 62 ... :    0.00 
#>   ... 65 79 77 62 ... :   -2.19 
#>   ... 65 77 79 62 ... :   -2.34 
#>   ... 79 77 65 62 ... :   -2.50 
#>   ... 77 65 79 62 ... :   -2.96 
#> 
#> ...-79-|-65-77-62-15-|-21-...
#>   Alternative orders:
#>   ... 65 77 62 15 ... :    0.00 
#>   ... 77 65 62 15 ... :   -2.50 
#> 
#> ...-65-|-77-62-15-21-|-24-... OK
#> 
#> ...-77-|-62-15-21-24-|-64-... OK
#> 
#> ...-62-|-15-21-24-64-|-81-...
#>   Alternative orders:
#>   ... 15 21 24 64 ... :    0.00 
#>   ... 15 21 64 24 ... :   -0.38 
#> 
#> ...-15-|-21-24-64-81-|-84-...
#>   Alternative orders:
#>   ... 21 24 64 81 ... :    0.00 
#>   ... 21 64 24 81 ... :   -0.38 
#> 
#> ...-21-|-24-64-81-84-|-52-...
#>   Alternative orders:
#>   ... 24 64 81 84 ... :    0.00 
#>   ... 64 24 81 84 ... :   -0.38 
#> 
#> ...-24-|-64-81-84-52-|-48-...
#>   Alternative orders:
#>   ... 64 81 84 52 ... :    0.00 
#>   ... 64 52 84 81 ... :   -1.54 
#> 
#> ...-64-|-81-84-52-48-|-57-...
#>   Alternative orders:
#>   ... 81 84 52 48 ... :    0.00 
#>   ... 52 84 81 48 ... :   -1.54 
#> 
#> ...-81-|-84-52-48-57-|-22-... OK
#> 
#> ...-84-|-52-48-57-22-|-86-... OK
#> 
#> ...-52-|-48-57-22-86-|-18-... OK
#> 
#> ...-48-|-57-22-86-18-|-88-... OK
#> 
#> ...-57-|-22-86-18-88-|-87-...
#>   Alternative orders:
#>   ... 22 86 18 88 ... :    0.00 
#>   ... 22 86 88 18 ... :    0.00 
#>   ... 22 88 18 86 ... :   -0.02 
#>   ... 22 18 88 86 ... :   -0.78 
#> 
#> ...-22-|-86-18-88-87-|-56-...
#>   Alternative orders:
#>   ... 86 18 88 87 ... :    0.00 
#>   ... 86 88 18 87 ... :    0.00 
#>   ... 88 18 86 87 ... :   -0.02 
#>   ... 86 87 18 88 ... :   -0.61 
#>   ... 88 18 87 86 ... :   -0.69 
#>   ... 18 88 86 87 ... :   -0.78 
#>   ... 18 88 87 86 ... :   -1.76 
#> 
#> ...-86-|-18-88-87-56-|-50-...
#>   Alternative orders:
#>   ... 18 88 87 56 :    0.00 
#>   ... 88 18 87 56 :    0.00 
#>   ... 87 18 88 56 :   -0.61 
#> 
#> 18-|-88-87-56-50
#>   Alternative orders:
#>    88 87 56 50 ... :    0.00 
#>    88 87 50 56 ... :   -2.27

Linkage group 3

CHR3_ord <- order_seq(CHR_mks$sequences$CHR3)
CHR3_frame <- make_seq(CHR3_ord, "force")
rf_graph_table(CHR3_frame) # graphic not showed

Here, marker 32 have color pattern too different of the expected, removing it could influentiate in other markers ordering. Then, we will remove it and search for a new order.

CHR3_test_seq <- drop_marker(CHR3_frame, 32)
CHR3_test_ord <- order_seq(CHR3_test_seq)
CHR3_test_map <- make_seq(CHR3_test_ord, "force")

The order did not change.

Trying to add the marker again.

CHR3_add32_seq <- try_seq(CHR3_test_map, 32)
CHR3_add32 <- make_seq(CHR3_add32_seq, 13) # Marker 32 keeped in the map
CHR3_final <- CHR3_add32
rf_graph_table(CHR3_final, inter = FALSE)

Checking for better orders:

ripple_seq(CHR3_final)
#> 8-37-91-33-|-90-...
#>   Alternative orders:
#>    8 37 91 33 ... :    0.00 
#>    8 37 33 91 ... :   -0.76 
#> 
#> ...-8-|-37-91-33-90-|-89-...
#>   Alternative orders:
#>    37 91 33 90 ... :    0.00 
#>    37 33 91 90 ... :   -0.76 
#> 
#> ...-37-|-91-33-90-89-|-51-...
#>   Alternative orders:
#>   ... 90 89 33 91 ... :    0.00 
#>   ... 89 90 33 91 ... :    0.00 
#>   ... 91 33 90 89 ... :   -0.78 
#>   ... 91 33 89 90 ... :   -0.78 
#>   ... 90 89 91 33 ... :   -0.99 
#>   ... 89 90 91 33 ... :   -0.99 
#>   ... 33 91 90 89 ... :   -1.54 
#>   ... 33 91 89 90 ... :   -1.54 
#> 
#> ...-91-|-33-90-89-51-|-5-...
#>   Alternative orders:
#>   ... 33 90 89 51 ... :    0.00 
#>   ... 33 89 90 51 ... :    0.00 
#> 
#> ...-33-|-90-89-51-5-|-25-...
#>   Alternative orders:
#>   ... 90 89 51 5 ... :    0.00 
#>   ... 89 90 51 5 ... :    0.00 
#> 
#> ...-90-|-89-51-5-25-|-61-... OK
#> 
#> ...-89-|-51-5-25-61-|-66-... OK
#> 
#> ...-51-|-5-25-61-66-|-54-... OK
#> 
#> ...-5-|-25-61-66-54-|-32-... OK
#> 
#> ...-25-|-61-66-54-32-|-45-... OK
#> 
#> ...-61-|-66-54-32-45-|-43-...
#>   Alternative orders:
#>   ... 66 54 45 32 ... :    0.00 
#>   ... 66 54 32 45 ... :   -0.34 
#>   ... 66 45 54 32 ... :   -2.68 
#> 
#> ...-66-|-54-32-45-43-|-11-...
#>   Alternative orders:
#>   ... 54 45 32 43 ... :    0.00 
#>   ... 54 32 45 43 ... :   -0.34 
#>   ... 54 45 43 32 ... :   -1.94 
#>   ... 45 54 32 43 ... :   -2.68 
#> 
#> ...-54-|-32-45-43-11-|-2-...
#>   Alternative orders:
#>   ... 45 32 43 11 ... :    0.00 
#>   ... 32 45 43 11 ... :   -0.34 
#>   ... 45 43 32 11 ... :   -1.94 
#>   ... 45 43 11 32 ... :   -2.68 
#> 
#> ...-32-|-45-43-11-2-|-10-...
#>   Alternative orders:
#>   ... 45 43 11 2 ... :    0.00 
#>   ... 45 43 2 11 ... :   -0.70 
#> 
#> ...-45-|-43-11-2-10-|-41-...
#>   Alternative orders:
#>   ... 43 11 2 10 :    0.00 
#>   ... 43 2 11 10 :   -0.70 
#> 
#> 43-|-11-2-10-41
#>   Alternative orders:
#>    11 2 10 41 ... :    0.00 
#>    2 11 10 41 ... :   -0.70

Ordering large amount of markers

In our examples until now we had few markers compared with those obtained by high-throughput technologies. Ordering several markers using the order_seq function combined with drop_marker and try_seq can be a hardy and slow work. To help this task, we create the function mds_onemap wich makes a interface between OneMap and MDSMap package. The ordering approach presented in MDSMap provides a faster and efficient way of ordering markers using multi-dimensional scaling. The method also provides diagnostics graphics and parameters to find outliers to help users to filter the dataset. You can find more informations in MDSMap vignette. Here we will show a simples example of how it can be used for a outcrossing dataset.

Map estimation for an arbitrary order

If you have some information about the order of the markers, for example, from a reference genome or previously published paper, you can define a sequence of those markers in a specific order (using the function make_seq) and then use the function map to estimate the final genetic map (based on multipoint analysis). For example, let us assume that we know that the following markers are ordered in this sequence: M47, M38, M59, M16, M62, M21, M20, M48 and M22. In this case, select them from the two point analysis, and use function map:

LG3seq_f2 <- make_seq(twopts_f2, c(47, 38, 59, 16, 62, 21, 20, 48, 22))
(LG3seq_f2_map <- map(LG3seq_f2))
#> 
#> Printing map:
#> 
#> Markers           Position           
#> 
#> 47 M47                0.00           
#> 38 M38               14.49           
#> 59 M59               23.99           
#> 16 M16               40.13           
#> 62 M62               50.60           
#> 21 M21               57.84           
#> 20 M20               67.16           
#> 48 M48               75.76           
#> 22 M22               84.62           
#> 
#>  9 markers            log-likelihood: -947.1229

To see the correspondence between marker names and numbers, use function marker_type:

marker_type(LG3seq_f2_map)
#>   Marker 47 ( M47 ) --> AA : AB : BB (1:2:1)  
#>   Marker 38 ( M38 ) --> AA : AB : BB (1:2:1)  
#>   Marker 59 ( M59 ) --> Not  AA : AA (3:1)  
#>   Marker 16 ( M16 ) --> AA : AB : BB (1:2:1)  
#>   Marker 62 ( M62 ) --> AA : AB : BB (1:2:1)  
#>   Marker 21 ( M21 ) --> AA : AB : BB (1:2:1)  
#>   Marker 20 ( M20 ) --> Not  BB : BB (3:1)  
#>   Marker 48 ( M48 ) --> AA : AB : BB (1:2:1)  
#>   Marker 22 ( M22 ) --> AA : AB : BB (1:2:1)

If one needs to add or drop markers from a predefined sequence, functions add_marker and drop_marker can be used. For example, to add markers M18, M56 and M50 at the end of LG3seq_f2_map:

(LG3seq_f2_map <- add_marker(LG3seq_f2_map, c(18, 56, 50)))
#> 
#> Number of markers: 12
#> Markers in the sequence:
#> M47 M38 M59 M16 M62 M21 M20 M48 M22 M18 M56 M50
#> 
#> Parameters not estimated.

Removing markers M59 and 21 from LG3seq_f2_map:

(LG3seq_f2_map <- drop_marker(LG3seq_f2_map, c(59, 21)))
#> 
#> Number of markers: 10
#> Markers in the sequence:
#> M47 M38 M16 M62 M20 M48 M22 M18 M56 M50
#> 
#> Parameters not estimated.

Drawing the genetic map

Once all linkage groups were obtained using both strategies, we can draw a map for each strategy using the function draw_map. Since version 2.1.1007, OneMap has a new version of draw_map, called draw_map2. The new function draws elegant linkage groups, and presents new arguments to personalize your draw.

If you prefer the old function, we also keep it. Follow examples how to use both of them.

Draw_map

We can draw a genetic map for all linkage groups using the function draw_map. First we have to create a list of ordered linkage groups:

maps_list <- list(LG1_f2_final, LG2_f2_final, LG3_f2_final)

Then use function draw_map for this list:

draw_map(maps_list, names = TRUE, grid = TRUE, cex.mrk = 0.7)

We also can draw a map for a specific linkage group:

draw_map(LG1_f2_final, names = TRUE, grid = TRUE, cex.mrk = 0.7)

Let’s use this function to overview the maps builded by different strategies in this tutorial:

map_list_all <- list(LG1_f2_final, CHR1_final, LG2_f2_final, CHR3_final, CHR2_final, LG3_f2_final)
draw_map(map_list_all, names = TRUE, grid = TRUE, cex.mrk = 0.7)

Function draw_map draws a very simple graphic representation of the genetic map. More recently, we developed a new version called draw_map2 that draws a more sophisticated figure. Furthermore, once the distances and the linkage phases are estimated, other map figures can be drawn by the user with any appropriate software. There are several free software that can be used, such as MapChart (Voorrips, 2002).

Draw_map2

The same figures did with draw_map can be done with draw_map2 function. But it has different capacities and arguments. Here are some examples, but you can find more options in the help page ?write_map2.

First, for all three groups built only with linkage information:

draw_map2(LG1_f2_final, LG2_f2_final, LG3_f2_final, main = "Only linkage information", 
          group.names = c("LG1", "LG2", "LG3"))

You can include all sequence objects refering to the groups as the first arguments. The main argument define the main title of the draw and group.names define the names of each group. If no output file and file extension is defined, the draw will be generated at you working directory as map.eps. The eps extension is only the default option but there are others that can be used. You can have access to a list of them at the help page.

We also can draw a map for a specific linkage group:

draw_map2(LG1_f2_final, col.group = "#58A4B0", col.mark = "#335C81", output = "map_LG1.pdf")

You can also change the default colors using the col.group and col.mark arguments.

Let’s use this function to overview the maps builded by different strategies in this tutorial:

draw_map2(LG1_f2_final, CHR1_final, LG2_f2_final, CHR3_final, CHR2_final, LG3_f2_final, 
          tag = c("M18", "M59", "M38", "M47", "M1"),
          output = "map_all.pdf")

With argument tag you can highlight some markers at the figure according to you specific purpose.

Final remarks

At this point it should be clear that any potential OneMap user must have some knowledge about genetic mapping and also the R language, because the analysis is not done with only one mouse click. In the future, perhaps a graphical interface will be made available to make this software a lot easier to use.

We do hope that OneMap is useful to researchers interested in genetic mapping in outcrossing or inbred-based populations. Any suggestions and critics are welcome.

Session Info

sessionInfo()
#> R version 3.6.1 (2019-07-05)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 18.04.3 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
#> 
#> locale:
#>  [1] LC_CTYPE=pt_BR.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=pt_BR.UTF-8        LC_COLLATE=C              
#>  [5] LC_MONETARY=pt_BR.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=pt_BR.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] onemap_2.1.3   rmarkdown_1.18 knitr_1.26    
#> 
#> loaded via a namespace (and not attached):
#>   [1] minqa_1.2.4             colorspace_1.4-1        rio_0.5.16             
#>   [4] htmlTable_1.13.3        base64enc_0.1-3         rstudioapi_0.10        
#>   [7] mice_3.7.0              farver_2.0.1            codetools_0.2-16       
#>  [10] splines_3.6.1           doParallel_1.0.15       Formula_1.2-3          
#>  [13] polynom_1.4-0           jsonlite_1.6.1          nloptr_1.2.1           
#>  [16] MDSMap_1.1              broom_0.5.3             cluster_2.1.0          
#>  [19] shiny_1.4.0             compiler_3.6.1          backports_1.1.5        
#>  [22] assertthat_0.2.1        Matrix_1.2-17           fastmap_1.0.1          
#>  [25] lazyeval_0.2.2          later_1.0.0             acepack_1.4.1          
#>  [28] htmltools_0.4.0         tools_3.6.1             gtable_0.3.0           
#>  [31] glue_1.3.1              reshape2_1.4.3          dplyr_0.8.3            
#>  [34] Rcpp_1.0.3              carData_3.0-3           cellranger_1.1.0       
#>  [37] vctrs_0.2.2             gdata_2.18.0            nlme_3.1-141           
#>  [40] iterators_1.0.12        crosstalk_1.0.0         xfun_0.11              
#>  [43] stringr_1.4.0           openxlsx_4.1.4          lme4_1.1-21            
#>  [46] mime_0.9                miniUI_0.1.1.1          lifecycle_0.1.0        
#>  [49] weights_1.0             gtools_3.8.1            princurve_2.1.4        
#>  [52] pan_1.6                 candisc_0.8-0           MASS_7.3-51.4          
#>  [55] scales_1.1.0            heplots_1.3-5           hms_0.5.2              
#>  [58] promises_1.1.0          parallel_3.6.1          smacof_2.0-0           
#>  [61] RColorBrewer_1.1-2      yaml_2.2.0              curl_4.3               
#>  [64] gridExtra_2.3           ggplot2_3.2.1           rpart_4.1-15           
#>  [67] reshape_0.8.8           latticeExtra_0.6-28     stringi_1.4.3          
#>  [70] foreach_1.4.7           plotrix_3.7-7           checkmate_1.9.4        
#>  [73] boot_1.3-23             zip_2.0.4               manipulateWidget_0.10.0
#>  [76] rlang_0.4.4             pkgconfig_2.0.3         rgl_0.100.30           
#>  [79] evaluate_0.14           lattice_0.20-38         purrr_0.3.3            
#>  [82] htmlwidgets_1.5.1       labeling_0.3            tidyselect_0.2.5       
#>  [85] plyr_1.8.5              magrittr_1.5            R6_2.4.1               
#>  [88] generics_0.0.2          nnls_1.4                Hmisc_4.3-0            
#>  [91] mitml_0.3-7             pillar_1.4.3            haven_2.2.0            
#>  [94] foreign_0.8-72          survival_2.44-1.1       abind_1.4-5            
#>  [97] nnet_7.3-12             tibble_2.1.3            crayon_1.3.4           
#> [100] car_3.0-5               jomo_2.6-10             wordcloud_2.6          
#> [103] ellipse_0.4.1           grid_3.6.1              readxl_1.3.1           
#> [106] data.table_1.12.8       forcats_0.4.0           digest_0.6.23          
#> [109] webshot_0.5.2           xtable_1.8-4            tidyr_1.0.0            
#> [112] httpuv_1.5.2            munsell_0.5.0

References

Adler, J. R in a Nutshell A Desktop Quick Reference, 2009.

Broman, K. W., Wu, H., Churchill, G., Sen, S., Yandell, B. qtl: Tools for analyzing QTL experiments R package version 1.09-43, 2008.

Buetow, K. H., Chakravarti, A. Multipoint gene mapping using seriation. I. General methods. American Journal of Human Genetics 41, 180-188, 1987.

Doerge, R.W. Constructing genetic maps by rapid chain delineation. Journal of Agricultural Genomics 2, 1996.

Garcia, A.A.F., Kido, E.A., Meza, A.N., Souza, H.M.B., Pinto, L.R., Pastina, M.M., Leite, C.S., Silva, J.A.G., Ulian, E.C., Figueira, A. and Souza, A.P. Development of an integrated genetic map of a sugarcane Saccharum spp. commercial cross, based on a maximum-likelihood approach for estimation of linkage and linkage phases. Theoretical and Applied Genetics 112, 298-314, 2006.

Haldane, J. B. S. The combination of linkage values and the calculation of distance between the loci of linked factors. Journal of Genetics 8, 299-309, 1919.

Jiang, C. and Zeng, Z.-B. Mapping quantitative trait loci with dominant and missing markers in various crosses from two inbred lines. Genetica 101, 47-58, 1997.

Kosambi, D. D. The estimation of map distance from recombination values. Annuaire of Eugenetics 12, 172-175, 1944.

Lander, E. S. and Green, P. Construction of multilocus genetic linkage maps in humans. Proc. Natl. Acad. Sci. USA 84, 2363-2367, 1987.

Lander, E.S., Green, P., Abrahanson, J., Barlow, A., Daly, M.J., Lincoln, S.E. and Newburg, L. MAPMAKER, An interactive computing package for constructing primary genetic linkage maps of experimental and natural populations. Genomics 1, 174-181, 1987.

Lincoln, S. E., Daly, M. J. and Lander, E. S. Constructing genetic linkage maps with MAPMAKER/EXP Version 3.0: a tutorial and reference manual. A Whitehead Institute for Biomedical Research Technical Report 1993.

Matloff, N. The Art of R Programming. 2011. 1st ed. San Francisco, CA: No Starch Press, Inc., 404 pages.

Margarido, G. R. A., Souza, A.P. and Garcia, A. A. F. OneMap: software for genetic mapping in outcrossing species. Hereditas 144, 78-79, 2007.

Mollinari, M., Margarido, G. R. A., Vencovsky, R. and Garcia, A. A. F. Evaluation of algorithms used to order markers on genetics maps. Heredity 103, 494-502, 2009.

Oliveira, K.M., Pinto, L.R., Marconi, T.G., Margarido, G.R.A., Pastina, M.M., Teixeira, L.H.M., Figueira, A.M., Ulian, E.C., Garcia, A.A.F., Souza, A.P. Functional genetic linkage map on EST-markers for a sugarcane (Saccharum spp.) commercial cross. Molecular Breeding 20, 189-208, 2007.

Oliveira, E. J., Vieira, M. L. C., Garcia, A. A. F., Munhoz, C. F.,Margarido, G. R.A., Consoli, L., Matta, F. P., Moraes, M. C., Zucchi, M. I., and Fungaro,M. H. P. An Integrated Molecular Map of Yellow Passion Fruit Based on Simultaneous Maximum-likelihood Estimation of Linkage and Linkage Phases J. Amer. Soc. Hort. Sci. 133, 35-41, 2008.

Tan, Y., Fu, Y. A novel method for estimating linkage maps. Genetics 173, 2383-2390, 2006.

Van Os H, Stam P, Visser R.G.F., Van Eck H.J. RECORD: a novel method for ordering loci on a genetic linkage map. Theor Appl Genet 112, 30-40, 2005.

Voorrips, R.E. MapChart: software for the graphical presentation of linkage maps and QTLs. Journal of Heredity 93, 77-78, 2002.

Wang S., Basten, C. J. and Zeng Z.-B. Windows QTL Cartographer 2.5. Department of Statistics, North Carolina State University, Raleigh, NC, 2010. https://brcwebportal.cos.ncsu.edu/qtlcart/

Wu, R., Ma, C.X., Painter, I. and Zeng, Z.-B. Simultaneous maximum likelihood estimation of linkage and linkage phases in outcrossing species. Theoretical Population Biology 61, 349-363, 2002a.

Wu, R., Ma, C.-X., Wu, S. S. and Zeng, Z.-B. Linkage mapping of sex-specific differences. Genetical Research 79, 85-96, 2002b.