def test_remap_invalid_assembly(self): s = SNPs("tests/input/GRCh37.csv") chromosomes_remapped, chromosomes_not_remapped = s.remap(-1) self.assertEqual(s.build, 37) self.assertEqual(s.assembly, "GRCh37") self.assertEqual(len(chromosomes_remapped), 0) self.assertEqual(len(chromosomes_not_remapped), 2)
def f(): s = SNPs("tests/input/GRCh37.csv") chromosomes_remapped, chromosomes_not_remapped = s.remap(36) self.assertEqual(s.build, 36) self.assertEqual(s.assembly, "NCBI36") self.assertEqual(len(chromosomes_remapped), 2) self.assertEqual(len(chromosomes_not_remapped), 0) pd.testing.assert_frame_equal(s.snps, self.snps_NCBI36(), check_exact=True)
def test_remap_37_to_37(self): s = SNPs("tests/input/GRCh37.csv") chromosomes_remapped, chromosomes_not_remapped = s.remap(37) self.assertEqual(s.build, 37) self.assertEqual(s.assembly, "GRCh37") self.assertEqual(len(chromosomes_remapped), 0) self.assertEqual(len(chromosomes_not_remapped), 2) pd.testing.assert_frame_equal(s.snps, self.snps_GRCh37(), check_exact=True)
def f(): s = SNPs("tests/input/NCBI36.csv", parallelize=True) chromosomes_remapped, chromosomes_not_remapped = s.remap(37) self.assertEqual(s.build, 37) self.assertEqual(s.assembly, "GRCh37") self.assertEqual(len(chromosomes_remapped), 2) self.assertEqual(len(chromosomes_not_remapped), 0) pd.testing.assert_frame_equal(s.snps, self.snps_GRCh37(), check_exact=True)
def test_remap_no_snps(self): s = SNPs() chromosomes_remapped, chromosomes_not_remapped = s.remap(38) self.assertFalse(s.build) self.assertEqual(len(chromosomes_remapped), 0) self.assertEqual(len(chromosomes_not_remapped), 0)