Ejemplo n.º 1
0
 def test_entrez_source ( self ) :
     """
     Test BioSeqs.from_entrez() method and len() property.
     """
     query = '"h**o sapiens"[porgn] AND mitochondrion[Filter] AND ' \
             'mRNA[Filter]'
     seq_db = BioSeqs.from_entrez(entrez_db='nuccore', query=query,
         email='*****@*****.**', max_fetch=10)
     # Check the number of sequences fetched
     self.assertEqual(len(seq_db), 10)
     # Check report information
     self.assertIn('entrez', seq_db._report[0][1])
     self.assertIn('nuccore', seq_db._report[0][2])
     self.assertIn(query, seq_db._report[0][3])
Ejemplo n.º 2
0
 def test_entrez_source(self):
     """
     Test BioSeqs.from_entrez() method and len() property.
     """
     query = '"h**o sapiens"[porgn] AND mitochondrion[Filter] AND ' \
             'mRNA[Filter]'
     seq_db = BioSeqs.from_entrez(entrez_db='nuccore',
                                  query=query,
                                  email='*****@*****.**',
                                  max_fetch=10)
     # Check the number of sequences fetched
     self.assertEqual(len(seq_db), 10)
     # Check report information
     self.assertIn('entrez', seq_db._report[0][1])
     self.assertIn('nuccore', seq_db._report[0][2])
     self.assertIn(query, seq_db._report[0][3])
Ejemplo n.º 3
0
 def test_update ( self ) :
     """
     Test BioSeqs.update() method.
     """
     query = '"h**o sapiens"[porgn] AND mitochondrion[Filter] AND ' \
             'mRNA[Filter]'
     seq_db = BioSeqs.from_entrez(entrez_db='nuccore', email='*****@*****.**',
                                  query=query, max_fetch=10)
     # Check the number of sequences fetched
     self.assertEqual(len(seq_db), 10)
     # Update the database fetching all the available sequences
     seq_db.update('*****@*****.**')
     # Check the number of sequences fetched
     handle = Entrez.esearch(db='nuccore', term=query, rettype='count')
     num_seqs = int(Entrez.read(handle)['Count'])
     self.assertEqual(len(seq_db), num_seqs)
Ejemplo n.º 4
0
 def test_update(self):
     """
     Test BioSeqs.update() method.
     """
     query = '"h**o sapiens"[porgn] AND mitochondrion[Filter] AND ' \
             'mRNA[Filter]'
     seq_db = BioSeqs.from_entrez(entrez_db='nuccore',
                                  email='*****@*****.**',
                                  query=query,
                                  max_fetch=10)
     # Check the number of sequences fetched
     self.assertEqual(len(seq_db), 10)
     # Update the database fetching all the available sequences
     seq_db.update('*****@*****.**')
     # Check the number of sequences fetched
     handle = Entrez.esearch(db='nuccore', term=query, rettype='count')
     num_seqs = int(Entrez.read(handle)['Count'])
     self.assertEqual(len(seq_db), num_seqs)