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

SNP scoring optimizations #22

Merged
merged 8 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/baskerville/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def make_strand_transform(targets_df, targets_strand_df):
targets_strand_df (pd.DataFrame): Targets DataFrame, with strand pairs collapsed.

Returns:
scipy.sparse.csr_matrix: Sparse matrix to sum strand pairs.
scipy.sparse.dok_matrix: Sparse matrix to sum strand pairs.
"""

# initialize sparse matrix
Expand All @@ -336,7 +336,6 @@ def make_strand_transform(targets_df, targets_strand_df):
if target.identifier[-1] == "-":
sti += 1
ti += 1
strand_transform = strand_transform.tocsr()

return strand_transform

Expand Down
2 changes: 1 addition & 1 deletion src/baskerville/scripts/hound_ism_bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def main():
alt_preds = np.array(alt_preds)

ism_scores = snps.compute_scores(
ref_preds, alt_preds, options.snp_stats
ref_preds, alt_preds, options.snp_stats, None
)
for snp_stat in options.snp_stats:
scores_h5[snp_stat][si, mi - mut_start, ni] = ism_scores[
Expand Down
3 changes: 2 additions & 1 deletion src/baskerville/scripts/hound_ism_snp.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def main():
else:
targets_strand_df = targets_df
strand_transform = None

num_targets = targets_strand_df.shape[0]

#################################################################
Expand Down Expand Up @@ -249,7 +250,7 @@ def main():
alt_preds = np.array(alt_preds)

ism_scores = snps.compute_scores(
ref_preds, alt_preds, options.snp_stats
ref_preds, alt_preds, options.snp_stats, None
)
for snp_stat in options.snp_stats:
scores_h5[snp_stat][si, mi - mut_start, ni] = ism_scores[
Expand Down
Loading
Loading