def module_2_api_call(): organism = 'aedes aegypti' geneIDs = [ 'AAEL003439', 'AAEL011411', 'AAEL012522', 'AAEL012774', 'AAEL012864', 'AAEL013263' ] ied = ",".join(geneIDs) #print(ied[:-1]) Entrez.email = sys.argv[1] handle = Entrez.esearch(db="pubmed", retmax=13, id=ied, term=organism) record = Entrez.read(handle) handle.close() print(record['IdList']) final['PubMedIDs'] = record['IdList'] id_list = record['IdList'] papers = fetch_details(id_list) print(papers) '''for i, paper in enumerate(papers): print()''' final['ids'] = [] final['seq'] = [] final['papers_id'] = record['IdList'] client = ensembl_rest.EnsemblClient() for genes in geneIDs: temp = client.sequence_id(genes) final['ids'].append(genes) final['seq'].append(temp['seq'])
# --- File Verification and Import isFile("fetch_genes.py") path2intronDB = sys.argv[2] isFile(path2intronDB) import fetch_genes # --- START --- species = (sys.argv[1] if (len(sys.argv) > 1) else 'gallus gallus') print("\nSpecies:", species) client = ensembl_rest.EnsemblClient() # --- Fetch information of the s in Gallus gallus print('\nFetching chromosome data...', end=" ") chrom_data, genome_info = fetch_genes.chromosomes_info(species=species) print("DONE.") # --- Fetch the ids of all the genes in the Gallus Gallus genome print('\nFetching all gene IDs...') all_genes = sum( (fetch_genes.genes_in_chrom(species, chrom, chrom_data[chrom]['length']) for chrom in chrom_data), [])