Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences between kos.parsed.counts.tsv files and my own script for summing counts per KEGG KO #36

Open
Dries-B opened this issue Feb 6, 2024 · 1 comment

Comments

@Dries-B
Copy link

Dries-B commented Feb 6, 2024

I'm finding differences between kos.parsed.counts.tsv (in results/annotation/$SAMPLE/) and the results of my own script for summing counts annotated per KEGG KO. My script revolves around the following (pandas) lines:

kegg_ko_sr = merged_df['KEGG_ko'].str.replace('ko:','').str.split(',')
kegg_ko_df = merged_df.assign(KEGG_ko=kegg_ko_sr).explode('KEGG_ko')

group_kegg_ko = (kegg_ko_df.groupby('KEGG_ko', as_index = False)
                            [['counts','length']]
                              .agg('sum')
                    )

Do you know what could be causing the difference? Is there any additional functionality in the code creating kos.parsed.counts.tsv which could be the cause?

@Dries-B
Copy link
Author

Dries-B commented Feb 6, 2024

Many differences seem to be caused by duplicate KOs. For example, the result of my script only has 24 counts for both K11191 and K11192, while yours only includes the latter.

On the other hand, K11189 (with 302 counts) is only included in 'my' result. Also, the number of Unclassified reads differs between the result files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant