Coder Social home page Coder Social logo

nanomath's People

Contributors

alexomics avatar bsipos avatar smoe avatar wdecoster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nanomath's Issues

More metrics for aligned reads

If the input DataFrame has aligned_reads, also calculate the percentage aligned and the average genome coverage (by dividing aligned bases with the genome size, so somehow this has to get transferred from the BAM to the df).

Calculating average quality score

Hi Wouter,

Thank you for your blog posts on how the average qscores are calculated for nanopore data, I have found them very useful.

When I tried out your aveQual function, I realised that I wasn't getting the correct outcome until I converted q to float, that is :
-10*math.log(sum([10**(float(q)/-10) for q in quals]) / len(quals), 10)
It seems that if q is integer, then the exponent will be rounded up to an integer value.

Best regards,
Laura

Formatting of output could be nicer

The alignment of the general summary isn't very nice.
Instead of

General summary:	 
Number of reads:	3995
Total bases:	11418359
Median read length:	1221.0
Mean read length:	2858.2
Read length N50:	8676
Active channels:	933
Mean read quality:	10.2
Median read quality:	10.6

I would prefer

General summary:
Number of reads:        3,995
Total bases:            11,418,359
Median read length:     1,221.0
Mean read length:       2,858.2
Read length N50:        8,676
Active channels:        933
Mean read quality:      10.2
Median read quality:    10.6

Or even

General summary:
Number of reads:          3,995
Total bases:         11,418,359
Median read length:       1,221.0
Mean read length:         2,858.2
Read length N50:          8,676
Active channels:            933
Mean read quality:           10.2
Median read quality:         10.6

License file is missing from pipy download - please tag your releases here

Hi,
I intend to package nanomath for Debian. Usually I prefer to package tagged releases from github since I frequently observed that downloads on pipy are incomplete. Unfortunately here on Github you do not have any tags while pipy has at least 0.23.1. I'd consider it good style to tag your releases here as well.
The problem becomes obvious when checking the pipy tarball where the LICENSE file is missing. This would be hard to accept for Debian since every software needs a license.
Could you please make sure that the pipy download is complete - or even more preferably could you tag your releases here.
BTW, besides a LICENSE a copyright is missing and I just have to wild guess that the owner of this Github project - Wouter De Coster - is the only copyright holder. Please also specify this.
Thanks a lot, Andreas.

wrong average quality?

I was trying to rewrite your python function to a julia function. Having exactly the same code, I found out that the outputs were different. After calculating some scores by hand, I came to the conclusion that the python script does some rounding in between because the input quality scores are integers. This can be overcome by replacing:

    return -10 * log(sum([10**(q / -10) for q in quals]) / len(quals), 10)

by:

    return -10 * log(sum([10**(float(q) / -10) for q in quals]) / len(quals), 10)

Average quality of reads

Hi- based on the reasoning that base quality cannot be directly averaged because they are in log space (here), shouldn't the overall average read quality be converted to probabilities, averaged and converted back to phred score?

I mean, in nanomath.py#L43 there is

self.mean_qual = np.mean(df["quals"])

shouldn't it be:

self.mean_qual = -10 * log(sum(10**(q/-10) for q in df["quals"]]) / len(df["quals"]), 10)

Thanks - Dario

nanomath 1.0 - ave_qual commented out but tests still check for it

Hi Wouter,

The subject line kind of summarises it already. You may be interested to know about the Debian package we prepared for nanomath as part of the bimonthly Debian Med Covid-19 sprint - I was just about to update the package when the autotests made this noise.

I have no idea if your reverse dependencies are using ave_qual. With version 1.0 you are of course completely free to change your API, but admittedly I wish you'd just formally deprecate it and remove it in, say, 1.1 or so. Would you allow me to comment these lines back in? Or shall I remove the test?

Cheers,
Steffen

I: pybuild base:217: cd /home/moeller/git/med-team/python-nanomath/.pybuild/cpython3_3.8_nanomath/build; python3.8 -m unittest discover -v 
test_ave_qual (nanomath.test_nanomath.NanomathTest)
Test average quality calculation. ... ERROR

======================================================================
ERROR: test_ave_qual (nanomath.test_nanomath.NanomathTest)
Test average quality calculation.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/moeller/git/med-team/python-nanomath/.pybuild/cpython3_3.8_nanomath/build/nanomath/test_nanomath.py", line 9, in test_ave_qual
    mq = nm.ave_qual(quals, qround=True)
AttributeError: module 'nanomath' has no attribute 'ave_qual'

Update PyPi

Hey, can you sync the function name changes with pypi so that I can update package dependencies?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.