Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does MAPpoly have an option for allotetraploids populations? #59

Open
PaulaEB opened this issue Dec 7, 2022 · 6 comments
Open

Does MAPpoly have an option for allotetraploids populations? #59

PaulaEB opened this issue Dec 7, 2022 · 6 comments

Comments

@PaulaEB
Copy link

PaulaEB commented Dec 7, 2022

Thank you for developing MAPpoly and for the very well documented tutorials. I have a multiparenting population of allotetraploids, and I was wondering if there is any option in MAPpoly to work with allopolyploids, or if you have any suggestion for this

@jeekinlau
Copy link
Contributor

Allotetraploids behave like diploids so you can use mappoly by importing as a diploid crop. mappoly is also good at mapping outcrossing highly heterozygous populations. If your crop is a true allotetraploid and have true disomic pairing action then you need to treat it as a diploid from upstream processes including snp calling steps and aligning the data to two separate reference genomes (ie. chrom 1a chrom 1b etc.).

@PaulaEB
Copy link
Author

PaulaEB commented Dec 29, 2022

Thanks a lot! I have the updog dosage call, as to my understanding fitpoly works only for arrays and mine is RADseq data. But I am not sure how to incorpore the sequence position information to reconstruct the recomb. fraction matrix. Is it possible to add this information without transform all to discrete data in a csv? It is important to use probability data as my depth is low and updog inputs the genotypes from the prior distribution, so I would have many low quality markers in my linkage maps.

Ps. I tried with read_geno ploidy =2 with the csv format of the tutorials but I have the issue: Error in stats::chisq.test(x = seg.obs, p = seg.exp[names(seg.obs)]) :
all entries of 'x' must be nonnegative and finite
In addition: Warning message:
In table_to_mappoly(dat, ploidy, filter.non.conforming, elim.redundant, :
NAs introduced by coercion

Thanks again

@jeekinlau
Copy link
Contributor

If you use the less stable experimental build of MAPpoly using the below code

install.packages("devtools")
devtools::install_github("mmollina/mappoly", dependencies=TRUE)

the chrom and genome.pos arguements are two vectors that are the same order of the markers in your multidog object. these two vectors will help you import from updog and include the genomic information.

so assuming you have a dataframe with three columns describing your multidog object: marker, chrom, and genome position. in the same order of the markers in the multidog object you can just point the chrom and genome.pos to the second and third column respectively

import_from_updog = function(object, prob.thres = 0.95,
filter.non.conforming = TRUE,
chrom = NULL,
genome.pos = NULL,
verbose = TRUE){

hope this helps, if you get confused let me know i'll be glad to help,
Jeekin

@PaulaEB
Copy link
Author

PaulaEB commented Dec 30, 2022

Thanks Jeekin! I don't have chromosome positions so I created the data frame from the updog output with marker and genome_position. However, when I run the code it says:

f12nupdog <-import_from_updog(mout2f12n, prob.thres = 0.8,
filter.non.conforming = TRUE,
chrom = NULL,
genome.pos = f12nmarkpos,
verbose = TRUE)
Error in import_from_updog(mout2f12n, prob.thres = 0.8, filter.non.conforming = TRUE, :
Check 'genome.pos' input. The vector should have length equal to the number of markers in the updog output.

I double checked and they have the same number of markers (26210), I tried using a list after the prob.thres=0.8, and adding a chrom column with NA, but still have the same error. Any suggestion?
Thanks again

image

@jeekinlau
Copy link
Contributor

is the f12nmarkpos object the dataframe you created? if so, the genome.pos needs to be a vector so you would set as genome.pos = f12nmarkpos$genome_position if that still gives you error i would try to make a dummy chrom column and make it all 1 instead of NA.

1st i would try the f12nmarkpos$genome_position

2nd i would try to make a third column and make it all 1 so chrom=f12nmarkpos$chrom

@PaulaEB
Copy link
Author

PaulaEB commented Nov 3, 2023

Hello, many thanks for your quick answers. I am back with this dataset and now, I am having some troubles importing from updog. The file is huge as I didn't want to filter too much (170879 markers 122 individuals) and I am getting this error:
mydata<-import_from_updog(moutfam2full,prob.thres = 0.50) Filtering non-conforming markers. ...Error in matrix(NA, sum(id1), input.data$ploidy + 1) : invalid 'nrow' value (too large or NA)

Is it because I should filter the missing data before to have less markers? (I was planning doing the prob.thres = 0.80 to indirectly filter those)

Many thanks!
PaulaE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants