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

Soft bed regions v2 #121

Merged
merged 3 commits into from May 17, 2022
Merged

Conversation

bnoyvert
Copy link
Contributor

The new truvari bench option --extend extends the regions of interest (set in --includebed argument) by the given number of bases on each side, allowing truth set variants to match call set variants that are just outside of the original region. If a call set variant is in the extended regions it can potentially match a truth set variant that is in the original regions turning it to TP, but call set variants in the extended regions that don't have a match are not counted as FP. This strategy is similar to the one implemented in truvari bench for size matching - only the truth set variants longer than sizemin (equal to 50 by default) are considered, but they are allowed to match shorter comparison set variants of size sizefilt (30 by default) or longer.

The default is --extend 0 - no extension, producing the same results as previous versions of truvari bench.

See the following discussion for details.

…A base variant contained in the region counted as TP if matches a call variant just outside the region.
Copy link
Owner

@ACEnglish ACEnglish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'm going to change the version back to 3.3.0-dev because we haven't released 3.3, yet. I'll also be shortening the description of the new parameter. I'm probably going to pull most of lines 796:806 to somewhere outside of main as well as probably 814 (that's a long if, might give it a method).

@ACEnglish ACEnglish merged commit 891ba6b into ACEnglish:develop May 17, 2022
@ACEnglish
Copy link
Owner

FYI, I made some style changes in 9e4e8a8. Functests all pass.

@bnoyvert
Copy link
Contributor Author

Thank you, this is all fine.
Just being paranoid - what happens to regions_extended = regions.extend(args.extend) if args.extend else regions if args.extend is a negative number? Would it be safer to put if args.extend > 0?

@ACEnglish
Copy link
Owner

ACEnglish commented May 17, 2022

You already handled that.

if args.extend > 0 and args.includebed is None:

Edit: nevermind, I stopped reading that line halfway through. I'll think about either fixing there or adding an argparse type requirement of 'positive integer'

Edit2: I'll have to do the argparse type requirement. I realized that extend > 0 isn't the best check because if a user were to specify bench --extend -1 they would silently get results identical to bench [defaults]. Luckily its an easy add-on

@bnoyvert
Copy link
Contributor Author

Agree, argparse type requirement is probably the best.

@ACEnglish
Copy link
Owner

See 2f5b001

@bnoyvert
Copy link
Contributor Author

Just noticed: in bench.py line 647
thresg.add_argument("--extend", type=truvari.restricted_int, default=0,
should be filteg.add_argument. Sorry, my mistake.

@ACEnglish
Copy link
Owner

It's been changed. I appreciate you double/triple/+ checking. I'm very happy to add your work to the tool. Thanks so much for your contribution!!

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

Successfully merging this pull request may close these issues.

None yet

2 participants