コード例 #1
0
    def abundance_matrices(self):
        """
        Returns an iterator of all AbundanceMatrix nodes connected to this
        object.
        """
        self.logger.debug("In abundance_matrices().")

        linkage_query = '"{}"[linkage.computed_from]'.format(self.id)

        query = iHMPSession.get_session().get_osdf().oql_query

        from cutlass.AbundanceMatrix import AbundanceMatrix

        for page_no in count(1):
            res = query(SixteenSTrimmedSeqSet.namespace, linkage_query,
                        page=page_no)
            res_count = res['result_count']

            for doc in res['results']:
                yield AbundanceMatrix.load_abundance_matrix(doc)

            res_count -= len(res['results'])

            if res_count < 1:
                break
コード例 #2
0
    def derivations(self):
        """
        Return an iterator of all the derived nodes from this SeqSet, including 
        abundance matrices, ... etc.
        """
        self.logger.debug("In derivations().")

        from cutlass.AbundanceMatrix import AbundanceMatrix

        for doc in self._derived_docs():
            if doc['node_type'] == "abundance_matrix":
                yield AbundanceMatrix.load_abundance_matrix(doc)