예제 #1
0
 def create_new_token(self):
     config = self.check_config_file_API()
     if config != None:
         self.load_data_from_ini()
     else:
         self.get_informations()
         self.create_ini_api_data()
     authentication_obj = AuthenticationAPI(username = self.username, password=self.password, endpoint=self.endpoint)
     token = authentication_obj.createAutenthicationToken()
     if token != None:
         os.environ["token_api"] = token
         self.token = token
예제 #2
0
def createBacterium(acc_number, person_responsible, source_data, fk_strain):

    bacteriumObjJson = BacteriumJson(acc_number=acc_number,
                                     person_responsible=person_responsible,
                                     source_data=source_data,
                                     strain=fk_strain)
    bacteriumObjJson = bacteriumObjJson.setBacterium()

    return bacteriumObjJson.id


#Token connection
conf_obj = ConfigurationAPI()
conf_obj.load_data_from_ini()
AuthenticationAPI().createAutenthicationToken()
#End token connection

dir_path = os.path.dirname(os.path.realpath(__file__))
print(dir_path)

path = dir_path + '/NCBI/organisms/NZ_ABYX00000000.wd.fasta'
#print(path)

path_proteins = dir_path + '/NCBI/organisms/NZ_ABYX00000000.prot_aa.fasta'
#path_proteins_CDS = dir_path + '/NCBI/organisms/NZ_CP016896.1.prot_csd.fasta'

fasta_protein_obj_dict = Fasta_protein_NCBI(path_proteins, 'protein_id')
#fasta_protein_CDS_obj_dict = Fasta_nucleotid_NCBI(path_proteins_CDS, 'db_xref')
#fasta_protein_csd_id = fasta_protein_CDS_obj_dict.get_list_nucleotid_name()