本文整理汇总了Python中SampleData.dataframe_from_covariance方法的典型用法代码示例。如果您正苦于以下问题:Python SampleData.dataframe_from_covariance方法的具体用法?Python SampleData.dataframe_from_covariance怎么用?Python SampleData.dataframe_from_covariance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SampleData
的用法示例。
在下文中一共展示了SampleData.dataframe_from_covariance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _context
# 需要导入模块: import SampleData [as 别名]
# 或者: from SampleData import dataframe_from_covariance [as 别名]
def _context():
gwas = _gwas()
model = _prediction_model()
s = SampleData.dataframe_from_covariance(SampleData.sample_covariance_s_1())
covariance = MatrixManager.MatrixManager(s, D)
c = Utilities._build_context(model, covariance, gwas)
return c
示例2: test_from_data
# 需要导入模块: import SampleData [as 别名]
# 或者: from SampleData import dataframe_from_covariance [as 别名]
def test_from_data(self):
s = SampleData.dataframe_from_covariance(SampleData.sample_covariance_s_1())
m = MatrixManager.MatrixManager(s, D)
snps, cov = m.get("A")
self.assertEqual(snps, cov_data.SNPS_A)
numpy.testing.assert_array_almost_equal(cov, cov_data.COV_A)
snps, cov = m.get("B")
self.assertEqual(snps, cov_data.SNPS_B)
numpy.testing.assert_array_almost_equal(cov, cov_data.COV_B)
snps, cov = m.get("C")
self.assertEqual(snps, cov_data.SNPS_C)
numpy.testing.assert_array_almost_equal(cov, cov_data.COV_C)
snps, cov = m.get("C", ['rs100', 'rs101', 'rs102'])
self.assertEqual(snps, cov_data.SNPS_C)
numpy.testing.assert_array_almost_equal(cov, cov_data.COV_C)
with self.assertRaises(Exceptions.InvalidArguments) as ctx:
snps, cov = m.get("C", ["rs100", "rs12718973"])
self.assertTrue("whitelist" in ctx.exception.message)