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

Summary Statistics in HTML Report #384

Open
yoshinak1 opened this issue Oct 8, 2024 · 4 comments
Open

Summary Statistics in HTML Report #384

yoshinak1 opened this issue Oct 8, 2024 · 4 comments

Comments

@yoshinak1
Copy link

I have encountered a potential issue in the HTML report generated by Nanoplot when using the --barcoded option. Normally, when data is filtered, the report shows both "Summary statistics prior filtering" and "Summary statistics after filtering," which display different values as expected. However, when I run the same analysis with the --barcoded option enabled, both sections appear to have identical values, and both seem to reflect the values after filtering.

Could you please confirm if this is the intended behavior, or if it might be an issue? I would appreciate any clarification or advice you can provide.

Thank you for your time and support.

Best regards,

@wdecoster
Copy link
Owner

Hi, thanks for your question. I will look into this, but I am very busy at the moment so this might take a while.

Best,
Wouter

@yoshinak1
Copy link
Author

Hi Wouter,

Thanks for your reply, I know you're busy. This might not be entirely correct, but I noticed something that could be an issue in your code, so I wanted to point it out just in case.

In the make_stats function, while the filtered data is saved with a suffix (e.g., suffix="_post_filtering"), for barcode-specific data, the suffix is ignored, and the file name is always "NanoStats_barcoded.txt". As a result, the pre-filtered data is not saved correctly and gets overwritten by the post-filtered data.

Specific Problem Location:

def make_stats()
...
if settings["barcoded"]:
barcodes = list(datadf["barcode"].unique())
statsfile = settings["path"] + "NanoStats_barcoded.txt" # suffix is ignored here
stats_df = nanomath.write_stats(
datadfs=[datadf[datadf["barcode"] == b] for b in barcodes],
outputfile=statsfile,
names=barcodes,
as_tsv=tsv_stats,
)
Here, the file name for statsfile does not include the suffix (such as suffix="_post_filtering"), so the pre-filtered and post-filtered data are not saved separately and are overwritten in the same file.

Best,

@wdecoster
Copy link
Owner

Good catch! I can fix it later, but feel free to open a pull request if you want. Thanks for finding the problem :-)

@wdecoster
Copy link
Owner

This should be fixed in v1.41.1 :-)

This was referenced Dec 10, 2024
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

2 participants