예제 #1
0
파일: tests.py 프로젝트: sadrians/st26proto
 def test_getOrganism(self):
     """
     Test that the Sequence object returns correctly the organism value.
     """
     print 'Running %s ...' % getName()
           
     s1 = self.sequenceListingFixture.create_sequence_instance(self.sequenceListing)             
     self.assertEqual('H**o sapiens', s1.getOrganism())
             
     s2 = Sequence.objects.create(
             sequenceListing = self.sequenceListing,
             moltype = 'AA',
             residues = 'MRTAVTAD')
     self.assertEqual(None, s2.getOrganism())
      
     views.feature_source_helper(s2, 'Drosophila melanogaster')
     self.assertEqual('Drosophila melanogaster', s2.getOrganism())
                    
     s3 = Sequence.objects.create(
         sequenceListing = self.sequenceListing,
         moltype = 'RNA',
         residues = 'caucaucaucaucaucau')
      
     views.feature_source_helper(s3, 'Mus musculus')
     self.assertEqual('Mus musculus', s3.getOrganism())
예제 #2
0
파일: tests.py 프로젝트: sadrians/st26proto
    def create_custom_sequence_instance(self, sl, mt, res, org):
        seq = Sequence.objects.create(
                sequenceListing = sl,
                moltype = mt,
                residues = res)

        views.feature_source_helper(seq, org)
        
        return seq 
예제 #3
0
파일: tests.py 프로젝트: sadrians/st26proto
    def create_sequence_instance(self, sl):
        seq = Sequence.objects.create(
                    sequenceListing = sl,
                    moltype = 'DNA',
                    residues = 'catcatcatcatcatcat')

        views.feature_source_helper(seq, 'H**o sapiens')
        
        return seq 
예제 #4
0
    def create_sequence_instance(self, sl):
        currentSeqIdNo = len(sl.sequence_set.all()) + 1
        currentSequenceName = 'test_seq_%i' % currentSeqIdNo
        seq = Sequence.objects.create(sequenceListing=sl,
                                      sequenceName=currentSequenceName,
                                      moltype='DNA',
                                      residues='catcatcatcatcatcat')

        views.feature_source_helper(seq, 'H**o sapiens', 'genomic DNA')

        return seq
예제 #5
0
    def create_custom_sequence_instance(self, sl, mt, res, org, mtq):
        currentSeqIdNo = len(sl.sequence_set.all()) + 1
        currentSequenceName = 'test_seq_%i' % currentSeqIdNo

        seq = Sequence.objects.create(sequenceListing=sl,
                                      sequenceName=currentSequenceName,
                                      moltype=mt,
                                      residues=res)

        views.feature_source_helper(seq, org, mtq)

        return seq
예제 #6
0
    def test_getOrganism(self):
        """
        Test that the Sequence object returns correctly the organism value.
        """
        print 'Running %s ...' % getName()

        s1 = self.sequenceListingFixture.create_sequence_instance(
            self.sequenceListing)
        self.assertEqual('H**o sapiens', s1.getOrganism())

        s2 = Sequence.objects.create(sequenceListing=self.sequenceListing,
                                     moltype='AA',
                                     residues='MRTAVTAD')
        self.assertEqual(None, s2.getOrganism())

        views.feature_source_helper(s2, 'Drosophila melanogaster', 'protein')
        self.assertEqual('Drosophila melanogaster', s2.getOrganism())

        s3 = Sequence.objects.create(sequenceListing=self.sequenceListing,
                                     moltype='RNA',
                                     residues='caucaucaucaucaucau')

        views.feature_source_helper(s3, 'Mus musculus', 'genomic RNA')
        self.assertEqual('Mus musculus', s3.getOrganism())