예제 #1
0
    def test_doublet(self):

        aln_df = pipeline.call_lineage_groups(
            self.doublet,
            self.dir_path + "/test_files",
            min_umi_per_cell=1,
            min_intbc_thresh=0.5,
            kinship_thresh=0.5,
            inter_doublet_threshold=0.6,
        )

        expected_rows = {
            ("A", "XX"): (1, 2),
            ("B", "XX"): (1, 2),
            ("D", "XY"): (2, 2),
            ("E", "XY"): (2, 2),
        }

        for pair in expected_rows:

            expected_lineage = expected_rows[pair]

            self.assertEqual(
                aln_df.loc[(aln_df["cellBC"] == pair[0])
                           & (aln_df["intBC"] == pair[1]),
                           "lineageGrp", ].iloc[0],
                expected_lineage[0],
            )

            self.assertEqual(
                aln_df.loc[(aln_df["cellBC"] == pair[0])
                           & (aln_df["intBC"] == pair[1]), "UMI", ].iloc[0],
                expected_lineage[1],
            )
예제 #2
0
    def test_reassign(self):

        aln_df = pipeline.call_lineage_groups(
            self.reassign,
            self.dir_path + "/test_files",
            min_umi_per_cell=0,
            min_intbc_thresh=0.25,
            kinship_thresh=0.1,
        )

        expected_rows = {
            ("A", "XX"): (1, 2),
            ("B", "XX"): (1, 2),
            ("C", "XX"): (1, 2),
            ("D", "XX"): (1, 1),
            ("E", "XZ"): (1, 1),
            ("F", "XZ"): (1, 3),
        }

        for pair in expected_rows:

            expected_lineage = expected_rows[pair]

            self.assertEqual(
                aln_df.loc[(aln_df["cellBC"] == pair[0])
                           & (aln_df["intBC"] == pair[1]),
                           "lineageGrp", ].iloc[0],
                expected_lineage[0],
            )

            self.assertEqual(
                aln_df.loc[(aln_df["cellBC"] == pair[0])
                           & (aln_df["intBC"] == pair[1]), "UMI", ].iloc[0],
                expected_lineage[1],
            )
예제 #3
0
    def test_format(self):

        aln_df = pipeline.call_lineage_groups(
            self.doublet,
            self.dir_path + "/test_files",
            min_umi_per_cell=1,
            min_intbc_thresh=0.5,
            kinship_thresh=0.5,
            inter_doublet_threshold=0.6,
        )

        expected_columns = [
            "cellBC",
            "UMI",
            "readCount",
            "intBC",
            "r1",
            "r2",
            "r3",
            "lineageGrp",
        ]
        for column in expected_columns:
            self.assertIn(column, aln_df.columns)