Home > brede > brede_cel_genotype2mat.m

brede_cel_genotype2mat

PURPOSE ^

brede_cel_genotype2mat - Generate 'mat' structure from genotype

SYNOPSIS ^

function M = brede_cel_genotype2mat(C, varargin)

DESCRIPTION ^

 brede_cel_genotype2mat - Generate 'mat' structure from genotype

       M = brede_cel_genotype2mat(C, 'PropertyName', 'PropertyValue')

       Input:    C      'cel' structure with genotypes as strings

       Property: Type   [ {1genotype1col} | 1genotype1coli |
                        1polymorphism1col | 1polymorphism1coli |
                        1polymorphism1colic ] Type of encoding of the
                        polymorphisms/alleles 

       Output:   M      'Mat' structure with genotypes encoding by
                        numerical values

       Convert genotype information represented as string in a 'cel'
       structure to numerical matrix data represented in a 'mat'
       structure. 

       '1genotype1col' will construct one column for each
       "genotype" (i.e., genotype for a single gene) in each
       polymorphism.
 
       '1genotype1coli' will construct one column for each
       "genotype" in each polymorphism as well as columns for
       first order interaction effects.

       '1polymorphism1col' will produce one column for each column in
       the input cell. If the polymorphism is triallelic then
       homozygotes get either encoded as -1 and +1, while heterozygotes
       get encoded with 0. 

       '1polymorphism1coli' is the same as above but will add
       interactions. 

       '1polymorphism1colic' is the same as above but will add
       interactions where the interaction is computed from the centered
       variables. 

       Cell elements that are empty or NaN are converted to NaN.

       Example:
         C.columns = { '5-HTTLPR' };
         C.cell = { 'ss' ; 'ss' ; 'sl' ; 'll' };
         M = brede_cel_genotype2mat(C), M.matrix

         M = brede_cel_genotype2mat(C, 'type', '1polymorphism1col'),
         M.matrix 

         C.columns = { '5-HTTLPR' 'STin2' };
         C.cell = { 'ss' '10/10' ; 'ss' '10/12' ; 'sl' '10/12' ; 'll' '12/12' };
         M = brede_cel_genotype2mat(C, 'type', '1polymorphism1coli'),
         M.matrix 

       See also BREDE, BREDE_CEL_CEL2CEL, BREDE_CEL_CEL2MAT,
                BREDE_CEL_SUBCELL, BREDE_READ_CSV2CEL.

 $Id: brede_cel_genotype2mat.m,v 1.11 2009/07/28 16:47:00 fn Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 27-Nov-2009 18:11:22 by m2html © 2005