Add new subject to study, with optional sex and phenotype

        Throws MalformedInputFile if sex is can't be converted to int

def add_subject(self, ind_id, sex=None, phenotype=None):
        """Add new subject to study, with optional sex and phenotype

        Throws MalformedInputFile if sex is can't be converted to int
        """

        self.pedigree_data[ind_id] = len(self.phenotype_data[0])
        if phenotype != None:
            if type(self.phenotype_data) is list:
                self.phenotype_data[0].append(phenotype)
            else:
                self.phenotype_data[-1, len(self.individual_mask)] = phenotype
        self.individual_mask.append(0)

        if PhenoCovar.sex_as_covariate:
            try:
                self.covariate_data[0].append(float(sex))
            except Exception, e:
                raise MalformedInputFile("Invalid setting, %s, for sex in pedigree" % (sex))