Ejemplo n.º 1
0
    def getAllAPI():
        """
        get all the Contig on the database

        :return: list of Contig
        :rtype: vector[ContigJson]
        """
        list_contigs = ContigAPI().get_all()
        schema = ContigSchema()
        results = schema.load(list_contigs, many=True)
        return results
Ejemplo n.º 2
0
    def setContig(self):
        """
        set new contig

        :return: new contig completed with the id
        :rtype: ContigJson
        """

        schema = ContigSchema(only=['id_db_online','sequence_DNA','fasta_head','organism'])
        jsonContig = schema.dump(self)
        resultsCreation = ContigAPI().set_contig(jsonData = jsonContig.data)
        schema = ContigSchema()
        results = schema.load(resultsCreation)
        return results[0]
Ejemplo n.º 3
0
    def getByOrganismID(organism_id: int):
        """
        get all contigs of a given organism

        :param organism_id: organism ID

        :type organism_id: int

        :return: all the contigs of the given organism id
        :rtype: list[ContigJson]
        """

        resultsCreation = ContigAPI().getByOrganismID(organism_id=organism_id)
        schema = ContigSchema()
        results = schema.load(resultsCreation, many=True)
        return results