Skip to content

Bug in eggNOG-mapper processor #1

Description

@KSabatova

I tried to run COGtools on my data and on my first try COGtools just printed 0 into command line and created an empty em_my_organism.gff file. So I dived into your code and I was able to locate the problem. The bug is in em_processor() function in program_processor module and particularly on line 87, where you write to the new file:

f.write('# created with COGtools 1.0.0\n# AC number: ' + em_data["seqname"][0] + "\n# Processed data from eggNOG-mapper\n")

The reason, why the tool failed in my case, was because of missing zeroth row in the dataframe. In my case the first CDS didn't have any COG categories assigned, so this row of the dataframe was dropped during processing with others with missing COG annotations (see picture below). And on line 87 your code uses some information from the zeroth row and that's the reason why this bug occurred.

obrazek

I recommend to reset the index of the final processed dataframe to fix this bug. You can do that by DataFrame.reset_index method (see also this post). I recommend to also check other functions that drop rows in dataframes and later your code accesses a particular row in those dataframes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions