[R] Genotype importing from Sequenom

Jim Lemon jim at bitwrit.com.au
Sun Dec 31 07:53:07 CET 2006


Farrel Buchinsky wrote:
> Sequenom has an odd format of calling a SNP genotype
> 
> gg
>  [1] "C"  "GA" "A"  "C"  "C"  "AG" "C"  "C"  "T"  "G"
> 
> homozygous A is called A and heterozygous is called AT
> The genetics package cannot handle the fact that some genotypes are declared
> with 2 letter while other are declared with only 1. Consequently the
> genotype() or makeGenotypes() will not work.
> 
> I need to either find a clever way that the genetics package actually does
> do this. I think it may reside in the "method" argument but do not know how
> to manipulat it. Alternatively I have to come up with some nifty string
> manipulation. Any ideas?
> 
gg1char<-nchar(gg)==1
gg[gg1char]<-paste(gg[gg1char],gg[gg1char],sep="")

Jim



More information about the R-help mailing list