diff --git a/patpat/utility.py b/patpat/utility.py index cc19822..0b0a3db 100644 --- a/patpat/utility.py +++ b/patpat/utility.py @@ -71,7 +71,8 @@ def initiate_uniprot_proteome_catalog(): def create_list_uniprot_proteome(): """Create UniProt Proteome Catalog""" - file = [i for i in os.listdir() if re.search('patpat_env/proteome/UP_README', i)][0] + os.chdir('patpat_env/proteome/') + file = [i for i in os.listdir() if re.search('UP_README', i)][0] with open(file, mode='r') as f: flag = '' while flag != 'Proteome_ID Tax_ID OSCODE SUPERREGNUM #(1) #(2) #(3) Species Name\n': @@ -86,6 +87,7 @@ def create_list_uniprot_proteome(): else: r.append(re.split('\t', flag[:-1])) df = pd.DataFrame(r[1:], columns=r[0]) + os.chdir('../..') return df