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

List excluded SNPs instead of halting error #34

Open
frewmack opened this issue Feb 13, 2023 · 1 comment
Open

List excluded SNPs instead of halting error #34

frewmack opened this issue Feb 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@frewmack
Copy link
Collaborator

frewmack commented Feb 13, 2023

At some point in the analysis, LocusFocus compares a user-provided list of SNPs to a list of valid IDs. If any of the IDs do not match, the analysis ends and an error is returned, requiring the user to remove that singular snip and try again. This process takes a long time, especially given that the number of invalid SNPs can be large (>100).

Instead of ending in error, each individual excluded snip should be provided back to the user, and the analysis should continue without the excluded SNPs. An error should be displayed in tandem, listing the excluded SNPs. This will save heaps of time for the user.

@frewmack frewmack added the enhancement New feature or request label Feb 13, 2023
@frewmack frewmack changed the title List excluded snips instead of halting error List excluded SNPs instead of halting error Feb 13, 2023
@frewmack
Copy link
Collaborator Author

LocusFocus/app.py

Lines 957 to 967 in f2e2513

rsid_snps = [ x for x in snp_list if x.startswith('rs') ]
b37_snps = [ x for x in snp_list if x.endswith('_b37') ]
b38_snps = [ x for x in snp_list if x.endswith('_b38') ]
if len(rsid_snps) > 0 and (len(b37_snps)>0 or len(b38_snps) > 0):
raise InvalidUsage("There is a mix of rsid and other variant id formats; please use a consistent format")
elif len(rsid_snps) > 0:
rsids = True
elif len(b37_snps) or len(b38_snps) > 0:
rsids = False
else:
raise InvalidUsage('Variant naming format not supported; ensure all are rs ID\'s are formatted as chrom_pos_ref_alt_b37 eg. 1_205720483_G_A_b37')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant