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

Mask not computed correctly. Possible off-by-1 error? #152

Open
bw2 opened this issue Nov 4, 2024 · 1 comment
Open

Mask not computed correctly. Possible off-by-1 error? #152

bw2 opened this issue Nov 4, 2024 · 1 comment

Comments

@bw2
Copy link

bw2 commented Nov 4, 2024

broadinstitute/SpliceAI-lookup#59
has several examples of apparently inconsistent masking. For example, for
1-237727120-T-C
the mask only affects the Acceptor Gain score, but should arguably be applied to both the Acceptor Gain and Donor Gain:

image image

Am I not interpreting the results correctly?

@kishorejaganathan
Copy link
Contributor

This is unfortunately caused because of the fact that the mask implementation is a super-hacky one and not precise. We only look for the closest exon boundary

dist_ann = (dist_tx_start, dist_tx_end, dist_exon_bdry)
and check whether that position is reported in the output

SpliceAI/spliceai/utils.py

Lines 185 to 188 in f364513

mask_pa = np.logical_and((idx_pa-cov//2 == dist_ann[2]), mask)
mask_na = np.logical_and((idx_na-cov//2 != dist_ann[2]), mask)
mask_pd = np.logical_and((idx_pd-cov//2 == dist_ann[2]), mask)
mask_nd = np.logical_and((idx_nd-cov//2 != dist_ann[2]), mask)
This worked most of the time when the distance parameter is less (like the default 50) as you are unlikely to see two ends of an exon within such a short distance, but completely falls apart when the distances are large. I would recommend ignoring the mask property for larger distances for the time-being.

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

No branches or pull requests

2 participants