NLeSC / MAGMa

eMetabolomics project: Mass Annotation based on in silico Generated Metabolites
http://www.emetabolomics.org
Apache License 2.0
14 stars 6 forks source link

Code review: Reduced time for scansWithMetabolites in job.py #16

Closed ridderl closed 11 years ago

ridderl commented 11 years ago

It seems that a filter on nhits in scansWithMetabolites is not needed since the query gives back scanid's anyway. Removing this filter significantly improves the speed of this query. I will commit a code change that skips the filter on nhits. Please review this code change and confirm OK.

sverhoeven commented 11 years ago

If you want to see all metabolites with 5 or more scans then those scans should be marked in the chromatogram. With this fix you would show all scan markers which have a any fragment which is incorrect.

ridderl commented 11 years ago

Agreed. Since the filter nhits>0 is the default and this specific filter only slows down the query it might be worth to add this test instead?

        if (filter['field'] == 'nhits' and filter['comparison'] == 'gt' and filter['value'] == 0):
            continue
sverhoeven commented 11 years ago

That's a nice compromise. Do that.