McVeigh, Richard (NIH/NLM/NCBI) [C]
unread,Feb 23, 2021, 12:18:25 PM2/23/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to eteto...@googlegroups.com
Hi
I am trying to use the ete3 toolkit to populate ncbi tax lineage from a pandas dataframe and ultimately add the lineage into the dataframe. I have a dataframe with thousands of taxid where I want to obtain the lineages.
I am trying
orgtable = pd.read_csv(data_table, sep='\t', index_col=None, low_memory=False, usecols=[2,3,7], header=None, skiprows=1, names=["orgname", "taxid", "accession"]) taxid = [] for index, row in orgtable.iterrows():
taxid = orgtable['taxid'].astype(int)
lineage = ncbi.get_lineage(taxid)
print(lineage)
but getting I get ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
It's clearly unhappy with lineage = ncbi.get_lineage(taxid)
Any idea what I am doing wrong?
Thank you
Rich