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

Possible bug in hard-coded magic constant #595

Open
PMSeitzer opened this issue Dec 7, 2022 · 2 comments
Open

Possible bug in hard-coded magic constant #595

PMSeitzer opened this issue Dec 7, 2022 · 2 comments
Assignees

Comments

@PMSeitzer
Copy link
Collaborator

void PeakGroup::updateQuality() {
    maxQuality=0;
    goodPeakCount=0;
    for(unsigned int i=0; i< peaks.size(); i++) {
        if(peaks[i].quality > maxQuality) maxQuality = peaks[i].quality;
        if(peaks[i].quality > 0.5) goodPeakCount++;
    }
}

Note the hard-coded 0.5. Instead, this should be whatever the qualityThreshold is, which is usually a parameter.

@PMSeitzer PMSeitzer added the bug label Dec 7, 2022
@PMSeitzer PMSeitzer added this to the 2.0.4 milestone Dec 7, 2022
@PMSeitzer PMSeitzer self-assigned this Dec 7, 2022
@PMSeitzer
Copy link
Collaborator Author

This same magic constant is used in PeakGroup::groupStatistics():

...
        if(peaks[i].quality > 0.5) goodPeakCount++;
...

@PMSeitzer PMSeitzer changed the title Possibly bug in hard-coded magic constant Possible bug in hard-coded magic constant Dec 7, 2022
@PMSeitzer PMSeitzer added enhancement and removed bug labels Jan 3, 2023
@PMSeitzer
Copy link
Collaborator Author

This isn't a bug, exactly, just confusing. There should probably be a parameter like goodPeakQualityThreshold which is tunable but takes a default value of 0.5

A parameter should be added to the Peaks dialog, not to mention, all other places where peak grouping takes place.

Screen Shot 2023-01-03 at 11 05 04 AM

@PMSeitzer PMSeitzer modified the milestones: 2.0.4, 2.0.5 Jan 7, 2023
@PMSeitzer PMSeitzer modified the milestones: 2.0.5, 2.0.6 Jan 23, 2023
@PMSeitzer PMSeitzer modified the milestones: 2.0.6, 2.0.7 Mar 2, 2023
@PMSeitzer PMSeitzer modified the milestones: 2.0.7, 2.0.8 Mar 20, 2023
@PMSeitzer PMSeitzer modified the milestones: 2.10.1, 2.10.2 Apr 25, 2023
@PMSeitzer PMSeitzer modified the milestones: 2.10.2, 2.10.3, 2.10.4 May 3, 2023
@PMSeitzer PMSeitzer removed this from the 2.10.5 milestone Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant