bioforensics / pytaxonkit

Python bindings for the TaxonKit library
Other
31 stars 2 forks source link

Error: Error processing taxonomic ID 59201: 17:51:07.885 [ERRO] open C:\Users\krist\AppData\Local\Temp\tmprg7jjz1s-lineage.txt: The process cannot access the file because it is being used by another process. #33

Closed kristinebraun closed 8 months ago

kristinebraun commented 10 months ago

Hello. I am trying to use pytaxonkit.lineage to extract taxanomic ids from a pandas dataframe I have read by using: df = pd.read_csv(taxanomic_dataframe, sep='\t', header=None) to get associated domains into a new column. The column with taxids is column five. I use this code after reading the table.

staxids = xml_table.iloc[:,5] lineages = pytaxonkit.lineage(list(staxids))

extract domain info from the lineage -> domain is the first element in the lineage

domains = lineages['Lineage'].str.split(';').str[0]
xml_table['domains'] = domains

return xml_table

After running this code, I get the error: TaxonKitCLIError: 16:55:06.202 [ERRO] open C:\Users\krist\AppData\Local\Temp\tmpzthchgl8-lineage.txt: The process cannot access the file because it is being used by another process. I am using windows 11. Why is this happening and how can I fix it?

standage commented 10 months ago

Greetings @kristinebraun!

This is an error message I'm not familiar with. I've tested pytaxonkit mostly on Linux and MacOS.

How large is staxids? Can you confirm its contents are what you expect?

standage commented 8 months ago

Feel free to re-open this thread if the issue persists.