Esempio n. 1
0
    def getAllAPI():
        """
        get all the WholeDNAs on the database

        :return: list of WholeDNAs
        :rtype: vector[WholeDNAJson]
        """
        list_wholeDNA = WholeDNAAPI().get_all()
        schema = WholeDNASchema()
        results = schema.load(list_wholeDNA, many=True)
        return results[0]
Esempio n. 2
0
    def setWholeDNA(self):
        """
        set new wholeDNA

        :return: new wholeDNA completed with the id
        :rtype: WholeDNAJson
        """

        schema = WholeDNASchema(only=['id_db_online','sequence_DNA','fasta_head','organism'])
        jsonWholeDNA = schema.dump(self)
        resultsCreation = WholeDNAAPI().set_wholeDNA(jsonData = jsonWholeDNA.data)
        schema = WholeDNASchema()
        results = schema.load(resultsCreation)
        return results[0]
Esempio n. 3
0
    def getByOrganismID(organism_id: int):
        """
        get the whole_dna of a given organism

        :param organism_id: organism ID

        :type organism_id: int

        :return: the whole_dna of the given organism id
        :rtype: WholeDna
        """

        resultsJson = WholeDNAAPI().getByOrganismID(organism_id=organism_id)
        schema = WholeDNASchema()
        results = schema.load(resultsJson, many=False)
        return results[0]