Skip to content

Commit

Permalink
Reconnected with my inner self
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Feb 24, 2023
1 parent 099ff8f commit ba8cef2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion upimapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,14 @@ def uniprot_information_workflow(
tax_df[col] = np.nan
uniprotinfo = pd.concat([uniprotinfo, tax_df[all_tax_cols]], axis=1).rename(columns={
'Organism': 'Taxonomic lineage (SPECIES)'})
cols = result.columns.tolist()
cols = list(set(result.columns.tolist() + uniprotinfo.columns.tolist()))
if 'Taxonomic lineage (SPECIES)' in cols:
cols.remove('Taxonomic lineage (SPECIES)')
cols.append('Taxonomic lineage (SPECIES)')
if 'index' in result.columns:
del result['index']
else:
cols = result.columns.tolist()
result = pd.concat([result, uniprotinfo], ignore_index=True)
result[cols].to_csv(output, sep='\t', index=False)
if len(ids_missing) == 0:
Expand Down

0 comments on commit ba8cef2

Please sign in to comment.