<commit_before>#!/bin/env python

import sys
import csv
from argparse import ArgumentParser
import re
import pickle
from Bio import Entrez
from lxml import entree

'''
Version modified from previous to accept Entrez_parser.py parsed xml file such as resulting from Homo_sapiens.xml. Accepts this output file, searchKeys and genes in tsv format. Works offline so that any number of variants can be tested.
'''


# for Entrez
Entrez.email = "<EMAIL>"

def get_geneIds(genes):
    '''Gets gene Ids through search query.
       The genes are limited to Homo sapiens. 
    '''
    geneIds = []
    for gene in genes:
        searchTerm = 'Homo sapiens[organism] AND {}[sym]'.format(gene['Gene'])
        request = Entrez.esearch(db='gene', term=searchTerm)
        result = Entrez.read(request)
        geneIds.extend(result['IdList'])
    
   
    return geneIds


def fetch_geneInformation(genes):<commit_msg>Fixed typo in import of lxml.etree<commit_after>#!/bin/env python

import sys
import csv
from argparse import ArgumentParser
import re
import pickle
from Bio import Entrez
from lxml import etree

'''
Version modified from previous to accept Entrez_parser.py parsed xml file such as resulting from Homo_sapiens.xml. Accepts this output file, searchKeys and genes in tsv format. Works offline so that any number of variants can be tested.
'''


# for Entrez
Entrez.email = "<EMAIL>"

def get_geneIds(genes):
    '''Gets gene Ids through search query.
       The genes are limited to Homo sapiens. 
    '''
    geneIds = []
    for gene in genes:
        searchTerm = 'Homo sapiens[organism] AND {}[sym]'.format(gene['Gene'])
        request = Entrez.esearch(db='gene', term=searchTerm)
        result = Entrez.read(request)
        geneIds.extend(result['IdList'])
    
   
    return geneIds


def fetch_geneInformation(genes):
{'fraction_non_alphanumeric': 0.08788209606986899, 'fraction_numerical': 0.0, 'mean_word_length': 3.593984962406015, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '438982', 'n_tokens_mistral': 567, 'n_tokens_neox': 538, 'n_words': 198}