locus              package:haplo.stats              R Documentation

_C_r_e_a_t_e_s _a_n _o_b_j_e_c_t _o_f _c_l_a_s_s "_l_o_c_u_s"

_D_e_s_c_r_i_p_t_i_o_n:

     Creates an object containing genotypes for multiple individuals.
     The object can then use method functions developed for objects of
     class "locus".

_U_s_a_g_e:

     locus(allele1, allele2, chrom.label=NULL,locus.alias=NULL,
          x.linked=FALSE, sex=NULL, male.code="M", female.code="F", miss.val=NA)

_A_r_g_u_m_e_n_t_s:

 allele1: A vector containing the labels for 1 allele for a set of
          individuals, or optionally a matrix with 2 columns each
          containing an allele for each person. 

 allele2: A vector containing the labels for the second allele for a
          set of individuals.  If allele 1 is a matrix, allele 2 need
          not be specified. 

chrom.label : A label describing the chromosome the alleles belong to 

locus.alias : A vector containing one or more aliases describing the
          locus. The first alias in the vector will be used as a label
          for printing in some functions such as multilocus.print().   

x.linked : A logical value denoting whether the chromosome is x linked 

     sex: A vector containing the gender of each individual (required
          if x.linked=T) 

male.code : The code denoting a male in the sex vector 

female.code : The code denoting a female in the sex vector 

miss.val : a vector of codes denoting missing values for allele1 and
          allele2. Note that NA will always be treated as a missing
          value, even if not specified in miss.val.  Also note that if
          multiple missing value codes are specified, the original
          missing value code for a specific individual can not be
          retrieved from the locus object.  

_V_a_l_u_e:

     Returns an object of class locus which inherits from class
     model.matrix containing the following elements:

    geno: a matrix with 2 columns where each row contains numeric codes
          for the 2 alleles for an individual. 

chrom.label: a chromosome label 

locus.alias: a vector of aliases for the locus 

x.linked: a logical value specifying if the locus is x-linked or not 

allele.labels: a vector of labels corresponding to the numeric codes in
          matrix geno (similar to levels in a factor) 

male.code: a code to be used to identify males for an x.linked locus. 

female.code: a code to be used to identify females for an x.linked
          locus. 

_E_x_a_m_p_l_e_s:

     b1 <- c("A","A","B","C","E","D")
     b2 <- c("A","A","C","E","F","G")
     loc1 <- locus(b1,b2,chrom=4,locus.alias="D4S1111")

     loc1

     # a second example which uses more parameters, some may not be supported.
     c1 <- c(101,10, 112,112,21,112)
     c2 <- c(101,101,112,  100,21, 10)

     gender <- rep(c("M","F"),3)
     loc2 <- locus(c1,c2,chrom="X",locus.alias="DXS1234", x.linked=TRUE, sex=gender)

     loc2

