Пример #1
0
 def download(self, subtype, output=True, count=True, **kwargs):
     '''
     download documents from table
     '''
     import time
     start_time = time.time()
     self.connect_rethink(**kwargs)
     self.vdb_download = vdb_download(database=self.database,
                                      virus=self.virus)
     select, present, interval, = self.vdb_download.parse_subset_arguments(
         **kwargs)
     select.append(('subtype', [subtype]))
     sequence_count = r.table(self.virus).count().run()
     print(sequence_count, "measurements in table:", self.virus)
     print("Downloading titer measurements from the table: " + self.virus)
     measurements = self.rethinkdb_download(self.virus,
                                            presents=present,
                                            selections=select,
                                            intervals=interval,
                                            **kwargs)
     print("Downloaded " + str(len(measurements)) + " measurements")
     if output:
         self.output(measurements, **kwargs)
     if count:
         self.write_count(measurements, **kwargs)
     print("--- %s minutes to download ---" %
           ((time.time() - start_time) / 60))
Пример #2
0
    def download(self, subtype=None, **kwargs):
        '''
        download documents from table
        '''
        start_time = time.time()
        self.connect_rethink(**kwargs)
        self.vdb_download = vdb_download(database=self.database,
                                         virus=self.virus)
        select, present, interval, = self.vdb_download.parse_subset_arguments(
            **kwargs)

        if subtype is not None:
            select.append(('subtype', [subtype]))

        measurement_count = r.table(self.virus).count().run()
        print(measurement_count, "measurements in table:", self.virus)
        print("Downloading titer measurements from the table: " + self.virus)
        measurements = self.rethinkdb_download(self.virus,
                                               presents=present,
                                               selections=select,
                                               intervals=interval,
                                               **kwargs)
        self.rename_strains_with_passage(measurements)
        print("Downloaded " + str(len(measurements)) + " measurements")
        print("--- %s minutes to download ---" %
              ((time.time() - start_time) / 60))
        return measurements
Пример #3
0
 def download(self, subtype, output=True, count=True, **kwargs):
     '''
     download documents from table
     '''
     import time
     start_time = time.time()
     self.connect_rethink(**kwargs)
     self.vdb_download = vdb_download(database=self.database, virus=self.virus)
     select, present, interval, = self.vdb_download.parse_subset_arguments(**kwargs)
     select.append(('subtype', [subtype]))
     sequence_count = r.table(self.virus).count().run()
     print(sequence_count, "measurements in table:", self.virus)
     print("Downloading titer measurements from the table: " + self.virus)
     measurements = self.rethinkdb_download(self.virus, presents=present, selections=select, intervals=interval, **kwargs)
     print("Downloaded " + str(len(measurements)) + " measurements")
     if output:
         self.output(measurements, subtype=subtype, **kwargs)
     if count:
         self.write_count(measurements, subtype=subtype, **kwargs)
     print("--- %s minutes to download ---" % ((time.time() - start_time)/60))