public IndividualGenomeDatabase Read() { // Initialize the database. var database = new IndividualGenomeDatabase(); // Read the table of SNP genotypes. tableReader.Read( delegate(string[] columns) { if (columns.Length == 4) { // Parse a column of this format: rs# chromosome position genotype var snpId = columns[0]; var snpValue = new SNPGenotype(); snpValue.genotype = DNA.StringToDiploidGenotype(columns[3]); snpValue.orientation = Orientation.Plus; // Add the SNP genotype to the database. database.AddSNPValue(snpId, snpValue); } }); return(database); }
public IndividualGenomeDatabase Read() { // Initialize the database. var database = new IndividualGenomeDatabase(); // Read the table of SNP genotypes. tableReader.Read( delegate(string[] columns) { if (columns.Length == 6) { // Parse a column of this format: rs4477212,A/G,1,72017,+,AA var snpId = columns[0]; var snpValue = new SNPGenotype(); snpValue.genotype = DNA.StringToDiploidGenotype(columns[5]); snpValue.orientation = DNA.StringToOrientation(columns[4]); // Add the SNP genotype to the database. database.AddSNPValue(snpId, snpValue); } }); return(database); }