Esempio n. 1
0
    def get_all(self):
        """
        get all the genus on the database

        :return: json file with all the data
        :rtype: string (json format)
        """
        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 2
0
    def get_by_id(self, id_genus: int):
        """
        get a genus given it id

        :param id_genus: id of the genus

        :type id_genus: int

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += str(id_genus) + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 3
0
    def getBacteriophageByAcc(self, acc_value):
        """
        return a bacteriophage according to its acc

        :param acc_value: accession number of the bacteriophage that you want to return

        :type acc_value: string

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += 'accnumber/' + acc_value + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 4
0
    def getCouplesByParameters(self, url_parameters: str):
        """
        return a couple according the parameters you send

        :param url_parameters: string that contains the parameters values (that design the fields)

        :type url_parameters: str

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += '?' + url_parameters

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 5
0
    def getById(self, id_cog_interaction_pair: int):
        """
        get a cog interaction pair given it id

        :param id_cog_interaction_pair: id of the cog interaction pair

        :type id_cog_interaction_pair: int

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += str(id_cog_interaction_pair) + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 6
0
    def getById(self, id_cog_score: int):
        """
        get a Cog  Score given it id

        :param id_cog_score: id of the cog score

        :type id_cog_score: int

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += str(id_genus) + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 7
0
    def getBacteriophageByDesignation(self, designation):
        """
        Get a bacteriophage exists according a designation

        :param designation: designation name of a bacteriophage

        :type designation: string

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += 'design/' + designation + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 8
0
    def getByOrganismID(self, organism_id):
        """
        get all proteins of a given organism

        :param organism_id: organism ID

        :type organism_id: int

        :return: all the proteins of the given organism id
        :rtype: ProteinJson
        """

        self.function += 'organism_id/' + str(organism_id)

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 9
0
    def setBacteriumExistsByAcc(self, acc_value):
        """
        Verify if a bacterium exists according an accValue

        :param acc_value: accession number of the bacterium that you want to check the existence

        :type acc_value: string

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += 'accnumber/' + acc_value + '/exists/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
    def getById(self, id_cog_source_info: int):
        """
        get a cog source information given it id

        :param id_cog_source_info: id of the cog

        :type id_cog_source_info: int

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += str(id_cog) + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 11
0
    def getCoupleByBactPhageIds(self, bact_id: int, phage_id: int):
        """
        return a couple according the ids of the bacterium and phage

        :param bact_id: If of the bacterium
        :param phage_id: If of the bacteriophage

        :type bact_id: int
        :type phage_id: int

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += 'organismsid/' + str(bact_id) + '/' + str(
            phage_id) + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 12
0
    def getByDesignationFkSpecie(self, designation, fk_specie):
        """
        Verify if a strain already exists in the database given a designation and fk_specie

        :param designation: designation of the strain
        :param fk_specie: fk of the specie

        :type designation: string
        :type fk_specie: integer

        :return: json file with all the data
        :rtype: string (json format)
        """

        self.function += 'existdesignstrain/' + designation + '/' + str(
            fk_specie) + '/'

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 13
0
    def getIdDDISource(self, id_ddi:int, id_source:int):
        """
        get teh id of a ddi source data if already exists in the database

        :param id_ddi: ID of the DDI
        :param id_source: ID of the Source

        :type id_ddi: int
        :type id_source: int

        :return: json that contain the information about the existence and the id or -1
        :rtype: string (json format)
        """


        self.function += 'ddi_info_source_existence/' + str(id_ddi) + '/' + str(id_source)

        result_get = GetRest(function = self.function).performRequest()
        return result_get
Esempio n. 14
0
    def getIdDDIID(self, pfam_a_id: int, pfam_b_id: int):
        """
        verify if a ddi already exists given the PFAM a and PFAM B (it verify the reverse)

        :param pfam_a_id: ID PFAM domain A
        :param pfam_b_id: ID PFAM domain A

        :type pfam_a_id: int
        :type pfam_b_id: int

        :return: json file with the last domain created
        :rtype: string (json format)
        """

        self.function += 'ddi_existence_id/' + str(pfam_a_id) + '/' + str(
            pfam_b_id)

        result_get = GetRest(function=self.function).performRequest()
        return result_get
Esempio n. 15
0
    def getIdDDI(self, pfam_a: str, pfam_b: str):
        """
        verify if a ddi already exists given the PFAM a and PFAM B (it verify the reverse)

        :param pfam_a: PFAM domain A
        :param pfam_b: PFAM domain A

        :type pfam_a: string
        :type pfam_b: string

        :return: json file with the last domain created
        :rtype: string (json format)
        """

        pfam_a = pfam_a.upper()
        pfam_b = pfam_b.upper()

        self.function += 'ddi_existence/' + str(pfam_a) + '/' + str(pfam_b)

        result_get = GetRest(function=self.function).performRequest()
        return result_get