test_genotype_filters.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:varapp-backend-py 作者: varapp 项目源码 文件源码
def test_compound_unaffected_compound(self):
        """Unaffected compound: exclude (the disease is not due to a compound)"""
        genotypes = array(
            [[2,1, 2,2, 1,1],
             [2,1, 2,2, 2,1],
             [1,2, 2,2, 1,1],
             [1,2, 2,2, 2,1]], dtype=DTYPE)
        variants = VariantsCollection([
            Variant(variant_id=1, start=0, gene_symbol='B'),  # mother 1
            Variant(variant_id=2, start=1, gene_symbol='B'),  # mother 2 + unaffected 1
            Variant(variant_id=3, start=2, gene_symbol='B'),  # father 1
            Variant(variant_id=4, start=3, gene_symbol='B'),  # father 2 + unaffected 2
        ])
        var = GenotypesFilterCompoundHeterozygous(self.ss).apply(variants, genotypes).variants
        self.assertEqual(len(var), 2)  # would be 4, but here we exclude an entire pair (2 variants):
            # one of the ends of the unaffected pair must be non-deleterious,
            # so no affected pair containing one of them can have both alleles deficient.
            # Thus a single pair remains -> 2 variants.

    # Updated by the change that allows only one same compound for all affected samples.
    #@unittest.expectedFailure
    # To my opinion it is ok if different compound scenarios work in different affected samples
    # i.e. two samples can be affected but each one with a different compound pair.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号