myinfiles<-c("data\sample CBA15.txt","data\sample
CBA23.txt","data\sample CBA28.txt")
mygenotypes<-read.GeneMapper(myinfiles)
#Look at the object produced. Alleles are not listed but you can
#see that the array was filled.
mygenotypes
#Look at the genotype of individual FCR5.
mygenotypes["FCR5",]
#Correct one of the genotypes
mygenotypes[["FCR5","RhCBA15"]]<-c(208)
# an example with defined data:
# create a table of data
gentable <- data.frame(Sample.Name=rep(c("ind1","ind2","ind3"),2),
Marker=rep(c("loc1","loc2"), each=3),
Allele.1=c(202,200,204,133,133,130),
Allele.2=c(206,202,208,136,142,136),
Allele.3=c(NA,208,212,145,148,NA),
Allele.4=c(NA,216,NA,151,157,NA)
)
# create a file (inspect this file in a text editor or spreadsheet
# software to see the required format)
write.table(gentable, file="readGMtest.txt", quote=FALSE, sep="t",
na="", row.names=FALSE, col.names=TRUE)
# read the file
mygenotypes <- read.GeneMapper("readGMtest.txt")
# inspect the results
mygenotypes[,"loc1"]
mygenotypes[,"loc2"]
Run the code above in your browser using DataLab