Ejemplo n.º 1
0
    def test_cuffnorm(self):
        collection = self.res.collection.create(name='Test collection')

        # pylint: disable=unbalanced-tuple-unpacking
        cuffquant_1, cuffquant_2, cuffquant_3, cuffquant_4 = self.get_cuffquants(4, collection)
        # pylint: enable=unbalanced-tuple-unpacking
        gff = self.get_gtf(1)

        group = collection.create_group_relation(
            samples=[cuffquant_1.sample, cuffquant_2.sample],
            label='replicates'
        )
        group1 = collection.create_group_relation(
            samples=[cuffquant_3.sample, cuffquant_4.sample],
            label='replicates'
        )

        # Run cuffnorm on a collection
        cuffnorm = collection.run_cuffnorm(annotation=gff)
        self.assertEqual(
            cuffnorm.input['cuffquant'],
            [cuffquant_1.id, cuffquant_2.id, cuffquant_3.id, cuffquant_4.id]
        )
        self.assertEqual(cuffnorm.input['annotation'], gff.id)
        self.assertEqual(cuffnorm.input['replicates'], ['0', '0', '1', '1'])

        # Run cuffnorm on a two groups of replicates in collection
        cuffnorm = expressions.cuffnorm([group1, group], annotation=gff)
        self.assertEqual(
            cuffnorm.input['cuffquant'],
            [cuffquant_3.id, cuffquant_4.id, cuffquant_1.id, cuffquant_2.id]
        )
        self.assertEqual(cuffnorm.input['annotation'], gff.id)
        self.assertEqual(cuffnorm.input['replicates'], ['0', '0', '1', '1'])
    def test_cuffnorm(self):
        collection = self.res.collection.create(name='Test collection')

        # pylint: disable=unbalanced-tuple-unpacking
        cuffquant_1, cuffquant_2, cuffquant_3, cuffquant_4 = self.get_cuffquants(4, collection)
        # pylint: enable=unbalanced-tuple-unpacking
        annotation = self.get_gtf()

        group = collection.create_group_relation(
            samples=[cuffquant_1.sample, cuffquant_2.sample],
            category='replicates'
        )
        group1 = collection.create_group_relation(
            samples=[cuffquant_3.sample, cuffquant_4.sample],
            category='clones'
        )

        # Run cuffnorm on a collection
        cuffnorm = collection.run_cuffnorm(annotation=annotation)
        self.assertEqual(
            cuffnorm.input['cuffquant'],
            [cuffquant_1.id, cuffquant_2.id, cuffquant_3.id, cuffquant_4.id]
        )
        self.assertEqual(cuffnorm.input['annotation'], annotation.id)
        self.assertEqual(cuffnorm.input['replicates'], ['0', '0', '1', '1'])

        # Run cuffnorm on two groups of replicates in collection
        cuffnorm = expressions.cuffnorm([group1, group], annotation=annotation)
        self.assertEqual(
            cuffnorm.input['cuffquant'],
            [cuffquant_3.id, cuffquant_4.id, cuffquant_1.id, cuffquant_2.id]
        )
        self.assertEqual(cuffnorm.input['annotation'], annotation.id)
        self.assertEqual(cuffnorm.input['replicates'], ['0', '0', '1', '1'])
Ejemplo n.º 3
0
    def test_cuffnorm(self):
        collection = self.res.collection.create(name='Test collection')

        # pylint: disable=unbalanced-tuple-unpacking
        cuffquant_1, cuffquant_2, cuffquant_3, cuffquant_4 = self.get_cuffquants(
            4, collection)
        # pylint: enable=unbalanced-tuple-unpacking
        annotation = self.get_gtf()

        group = collection.create_group_relation(
            samples=[
                cuffquant_1.sample,
                cuffquant_2.sample,
                cuffquant_3.sample,
                cuffquant_4.sample,
            ],
            labels=['1', '1', '2', '2'],
            category='replicates',
        )

        # Run cuffnorm on a collection
        cuffnorm = collection.run_cuffnorm(annotation=annotation)
        self.assertEqual(
            cuffnorm.input['cuffquant'],
            [cuffquant_1.id, cuffquant_2.id, cuffquant_3.id, cuffquant_4.id])
        self.assertEqual(cuffnorm.input['annotation'], annotation.id)

        # Run cuffnorm on two groups of replicates in collection
        cuffnorm = expressions.cuffnorm(group, annotation=annotation)
        self.assertEqual(
            cuffnorm.input['cuffquant'],
            [cuffquant_1.id, cuffquant_2.id, cuffquant_3.id, cuffquant_4.id])
        self.assertEqual(cuffnorm.input['annotation'], annotation.id)