Ejemplo n.º 1
0
	def test_statistics_only_shapiro(self, statisticsArgs):
		statisticsArgs['genotype_folder'] = None
		statisticsArgs['type'] = 'shapiro'
		stats = pygwas.calculate_stats(statisticsArgs)
		assert stats['transformation'] == 'none'
		assert len(stats) == 2
		np.testing.assert_allclose(stats['shapiro'],2.3893008814393317e-14,rtol=1e-5, atol=0)
Ejemplo n.º 2
0
	def test_statistics_most_normal_only_shapiro(self, statisticsArgs):
		statisticsArgs['genotype_folder'] = None
		statisticsArgs['type'] = 'shapiro'
		statisticsArgs['transformation'] = 'most_normal'
		stats = pygwas.calculate_stats(statisticsArgs)
		assert stats['transformation'] == 'box_cox'
		assert len(stats) == 2
		np.testing.assert_allclose(stats['shapiro'],3.551881553633118e-14,rtol=1e-5, atol=0)
Ejemplo n.º 3
0
 def test_statistics_most_normal(self, statisticsArgs):
     statisticsArgs['transformation'] = 'most_normal'
     stats = pygwas.calculate_stats(statisticsArgs)
     assert stats['transformation'] == 'box_cox'
     assert len(stats) == 3
     np.testing.assert_allclose(stats['shapiro'],
                                7.311389856176284e-14,
                                rtol=1e-5,
                                atol=0)
Ejemplo n.º 4
0
 def test_statistics_only_shapiro_with_genotype(self, statisticsArgs):
     statisticsArgs['type'] = 'shapiro'
     stats = pygwas.calculate_stats(statisticsArgs)
     assert stats['transformation'] == 'none'
     assert len(stats) == 2
     np.testing.assert_allclose(stats['shapiro'],
                                4.432536287882552e-14,
                                rtol=1e-5,
                                atol=0)
Ejemplo n.º 5
0
 def test_statistics_only_shapiro(self, statisticsArgs):
     statisticsArgs['genotype_folder'] = None
     statisticsArgs['type'] = 'shapiro'
     stats = pygwas.calculate_stats(statisticsArgs)
     assert stats['transformation'] == 'none'
     assert len(stats) == 2
     np.testing.assert_allclose(stats['shapiro'],
                                2.3893008814393317e-14,
                                rtol=1e-5,
                                atol=0)
 def on_post(self,req,resp,genotype_id,type):
     phenotypes =  zip(*req.context.get('doc',[]))
     accessions = phenotypes[0]
     values = phenotypes[1]
     phen_data = phenotype.Phenotype(accessions,values,'phenotype')
     genotype_folder = '%s/%s' % (self.storage_path,genotype_id)
     arguments = {'type':type,'genotype_folder':genotype_folder,'phen_data':phen_data,'file':''}
     statistics = pygwas.calculate_stats(arguments)
     req.context['result'] = statistics
     resp.status = falcon.HTTP_200
Ejemplo n.º 7
0
 def test_statistics_most_normal_only_shapiro(self, statisticsArgs):
     statisticsArgs['genotype_folder'] = None
     statisticsArgs['type'] = 'shapiro'
     statisticsArgs['transformation'] = 'most_normal'
     stats = pygwas.calculate_stats(statisticsArgs)
     assert stats['transformation'] == 'box_cox'
     assert len(stats) == 2
     np.testing.assert_allclose(stats['shapiro'],
                                3.551881553633118e-14,
                                rtol=1e-5,
                                atol=0)
Ejemplo n.º 8
0
 def test_statistics(self, statisticsArgs):
     stats = pygwas.calculate_stats(statisticsArgs)
     assert len(stats) == 3
     assert stats['transformation'] == 'none'
     np.testing.assert_allclose(stats['shapiro'],
                                4.432536287882552e-14,
                                rtol=1e-5,
                                atol=0)
     np.testing.assert_allclose(stats['pseudo_heritability'],
                                0.89686416775572486,
                                rtol=1e-5,
                                atol=0)
Ejemplo n.º 9
0
	def test_statistics(self,statisticsArgs):
		stats = pygwas.calculate_stats(statisticsArgs)
		assert len(stats) == 3
		assert stats['transformation'] == 'none'
		np.testing.assert_allclose(stats['shapiro'],4.432536287882552e-14,rtol=1e-5, atol=0)
		np.testing.assert_allclose(stats['pseudo_heritability'],0.89686416775572486,rtol=1e-5, atol=0)
Ejemplo n.º 10
0
	def test_statistics_most_normal(self, statisticsArgs):
		statisticsArgs['transformation'] = 'most_normal'
		stats = pygwas.calculate_stats(statisticsArgs)
		assert stats['transformation'] == 'box_cox'
		assert len(stats) == 3
		np.testing.assert_allclose(stats['shapiro'],7.311389856176284e-14,rtol=1e-5, atol=0)
Ejemplo n.º 11
0
	def test_statistics_only_shapiro_with_genotype(self, statisticsArgs):
		statisticsArgs['type'] = 'shapiro'
		stats = pygwas.calculate_stats(statisticsArgs)
		assert stats['transformation'] == 'none'
		assert len(stats) == 2
		np.testing.assert_allclose(stats['shapiro'],4.432536287882552e-14,rtol=1e-5, atol=0)