Read the documentation and understand your situation. For a biallelic diploid locus, there can only be 3 possible unphased configurations: HOM-REF, HET and HOM-ALT. Your "test" dataset has all 4 nucleotides, so obviously it's not a SNP at a single locus but a collection of SNPs - meaning, not all 10 configurations are possible at the same location.
Contrast this to dat2 where the only 2 alleles are A and G. Either change your dataset so it's compatible or use sapply(test, snp, sep = "") to get 10 SNP objects (not a meaningful thing to do)
But I have one more question. It's my sample of individuals and I've got more than two alleles. For examples in E1 are C,G and A. What should I do with this problem?
Did you try snp(vector_of_genotypes, sep = "")? That should work with E1, as long as it's a sensible vector. The E1 example is a diploid multi-allelic (not biallelic) locus (or a polyploid locus), so there are a lot more possibilities.
Please do not paste screenshots of plain text content, it is counterproductive. You can copy paste the content directly here (using the code formatting option shown below), or use a GitHub Gist if the content volume exceeds allowed length here.
Oops, I did not see the E1 vector properly, just assumed it was sensible. Can you please explain how those genotypes can be found at the same site biologically? What is the REF allele and what are the various ALT alleles?
Now, I understand, thanks :)
But I have one more question. It's my sample of individuals and I've got more than two alleles. For examples in E1 are C,G and A. What should I do with this problem?
Did you try
snp(vector_of_genotypes, sep = "")
? That should work with E1, as long as it's a sensible vector. The E1 example is a diploid multi-allelic (not biallelic) locus (or a polyploid locus), so there are a lot more possibilities.Yes, I tried and R shows me a error "SNP must have only two alleles"
Show me your exact code please.
Please do not paste screenshots of plain text content, it is counterproductive. You can copy paste the content directly here (using the code formatting option shown below), or use a GitHub Gist if the content volume exceeds allowed length here.
Oops, I did not see the E1 vector properly, just assumed it was sensible. Can you please explain how those genotypes can be found at the same site biologically? What is the REF allele and what are the various ALT alleles?