def gen_pylmm_results(self, tempdata):
        print("USING PYLMM")
        self.dataset.group.get_markers()
        
        pheno_vector = np.array([val == "x" and np.nan or float(val) for val in self.vals])
        if self.dataset.group.species == "human":
            p_values, t_stats = self.gen_human_results(pheno_vector, tempdata)
        else:
            genotype_data = [marker['genotypes'] for marker in self.dataset.group.markers.markers]

            no_val_samples = self.identify_empty_samples()
            trimmed_genotype_data = self.trim_genotypes(genotype_data, no_val_samples)
            
            genotype_matrix = np.array(trimmed_genotype_data).T
            
            t_stats, p_values = lmm.run(
                pheno_vector,
                genotype_matrix,
                restricted_max_likelihood=True,
                refit=False,
                temp_data=tempdata
            )
            
            print("p_values:", p_values)
            self.dataset.group.markers.add_pvalues(p_values)
            self.qtl_results = self.dataset.group.markers.markers
 def gen_qtl_results_2(self, tempdata):
     """Generates qtl results for plotting interval map"""
 
     self.dataset.group.get_markers()
     self.dataset.read_genotype_file()
 
     pheno_vector = np.array([val == "x" and np.nan or float(val) for val in self.vals])
 
     #if self.dataset.group.species == "human":
     #    p_values, t_stats = self.gen_human_results(pheno_vector, tempdata)
     #else:
     genotype_data = [marker['genotypes'] for marker in self.dataset.group.markers.markers]
     
     no_val_samples = self.identify_empty_samples()
     trimmed_genotype_data = self.trim_genotypes(genotype_data, no_val_samples)
     
     genotype_matrix = np.array(trimmed_genotype_data).T
     
     t_stats, p_values = lmm.run(
         pheno_vector,
         genotype_matrix,
         restricted_max_likelihood=True,
         refit=False,
         temp_data=tempdata
     )
     
     self.dataset.group.markers.add_pvalues(p_values)
     
     self.qtl_results = self.dataset.group.markers.markers
    def gen_data(self, tempdata):
        """Generates p-values for each marker"""

        self.dataset.group.get_markers()

        pheno_vector = np.array([val == "x" and np.nan or float(val) for val in self.vals])

        if self.dataset.group.species == "human":
            p_values, t_stats = self.gen_human_results(pheno_vector, tempdata)
        else:
            genotype_data = [marker['genotypes'] for marker in self.dataset.group.markers.markers]
            
            no_val_samples = self.identify_empty_samples()
            trimmed_genotype_data = self.trim_genotypes(genotype_data, no_val_samples)
            
            genotype_matrix = np.array(trimmed_genotype_data).T
            
            print("pheno_vector: ", pf(pheno_vector))
            print("genotype_matrix: ", pf(genotype_matrix))
            print("genotype_matrix.shape: ", pf(genotype_matrix.shape))
            
            t_stats, p_values = lmm.run(
                pheno_vector,
                genotype_matrix,
                restricted_max_likelihood=True,
                refit=False,
                temp_data=tempdata
            )
        
        self.dataset.group.markers.add_pvalues(p_values)

        self.qtl_results = self.dataset.group.markers.markers