Skip to content
Merged
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,29 @@ with [PEP 440](https://peps.python.org/pep-0440/) pre-release identifiers for pa
### Fixed
-

## [0.1.0] - 2026-05-12

### Added
- First stable release after the alpha/beta publishing cycle and successful testing by external users.
- Batch amino acid score outputs for combined normalization runs.
- Average positional score bar in batch heatmap outputs.
- GitHub Actions workflow for pull request pytest runs.
- Integration coverage for `run_batch_analysis(...)` batch-config loading.

### Changed
- Promoted package metadata from beta to stable release status.
- Simplified batch output naming by removing date/output suffixes from score file paths and related tests.
- Updated batch visualization layout, including grid refinements and removal of the batch figure title.
- Represent no sequence difference explicitly as `=` during annotation and parsing.
- Preserve synonymous/no-difference rows in amino acid score outputs.
- Write batch normalization outputs under `normalized/<method>/`.
- Simplify summary stats output to focus on the scored file and expose normalization inputs directly in batch stats.

### Fixed
- Preserved decimal precision in batch score exports, including `score.r#b#`, replicate score columns, and `avgscore`.
- Preserved decimal precision in AA score statistics exports, including `SD_codon`, `SD_rep`, `SEM`, and confidence interval columns.
- Stopped rounding scores before plotting and corrected global pathogenic heatmap tick handling.

## [0.1.0b3] - 2026-03-11

### Added
Expand Down Expand Up @@ -63,7 +86,8 @@ with [PEP 440](https://peps.python.org/pep-0440/) pre-release identifiers for pa
### Fixed
-

[Unreleased]: https://github.com/dbaldridge-lab/sortscore/compare/0.1.0b3...HEAD
[Unreleased]: https://github.com/dbaldridge-lab/sortscore/compare/0.1.0...HEAD
[0.1.0]: https://github.com/dbaldridge-lab/sortscore/compare/0.1.0b3...0.1.0
[0.1.0b1]: https://github.com/dbaldridge-lab/sortscore/compare/0.1.0a1...0.1.0b1
[0.1.0a1]: https://github.com/dbaldridge-lab/sortscore/releases/tag/0.1.0a1
[0.1.0b2]: https://github.com/dbaldridge-lab/sortscore/compare/0.1.0b1...0.1.0b2
Expand Down
6 changes: 3 additions & 3 deletions docs/batch_processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ Specify your own list of pathogenic control variants.
Batch processing generates:

### Score Files
- `batch_scores.csv`: Combined normalized scores with batch tracking
- `batch_aa_scores.csv`: Combined amino acid level normalized scores when AA aggregation is available
- `batch_stats.json`: Comprehensive statistics and normalization factors
- `<combined_output_dir>/normalized/<method>/scores/batch_scores.csv`: Combined normalized scores with batch tracking
- `<combined_output_dir>/normalized/<method>/scores/batch_aa_scores.csv`: Combined amino acid level normalized scores when AA aggregation is available
- `<combined_output_dir>/normalized/<method>/scores/batch_stats.json`: Statistics and normalization factors

### Visualizations
- Unified scaling: Single colorbar applies to all data
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sortscore"
version = "0.1.0b3"
version = "0.1.0"
description = "A modular Python package for Sort-seq variant analysis"
readme = "README.md"
requires-python = ">=3.10"
Expand All @@ -14,7 +14,7 @@ authors = [
]
keywords = ["bioinformatics", "sequencing", "variant-analysis", "sort-seq"]
classifiers = [
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"License :: OSI Approved :: MIT License",
Expand Down
2 changes: 1 addition & 1 deletion sortscore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
calculating activity scores, and generating visualizations.
"""

__version__ = "0.1.0b3"
__version__ = "0.1.0"
__author__ = "Caitlyn Chitwood"
__email__ = "c.chitwood@wustl.edu"

Expand Down
29 changes: 13 additions & 16 deletions sortscore/analysis/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import pandas as pd
from sortscore.utils.sequence_parsing import compare_to_reference, compare_codon_lists, translate_dna

NO_DIFF_MARKER = '='


# TODO: #37 redundant, see if we can remove
def annotate_scores_dataframe(
scores_df: pd.DataFrame,
Expand Down Expand Up @@ -54,27 +57,24 @@ def annotate_scores_dataframe(

# Add DNA sequence differences
df['dna_seq_diff'] = df['variant_seq'].apply(
lambda x: compare_to_reference(wt_dna_seq, x)
lambda x: compare_to_reference(wt_dna_seq, x, no_change_marker=NO_DIFF_MARKER)
)
df['dna_seq_diff'] = df['dna_seq_diff'].fillna('')

# Add AA sequence annotations only if not pre-annotated
if not has_pre_annotated_aa:
wt_aa_seq = translate_dna(wt_dna_seq)
df['aa_seq'] = df['variant_seq'].apply(translate_dna)
df['aa_seq_diff'] = df['aa_seq'].apply(
lambda x: compare_to_reference(wt_aa_seq, x)
lambda x: compare_to_reference(wt_aa_seq, x, no_change_marker=NO_DIFF_MARKER)
)
df['aa_seq_diff'] = df['aa_seq_diff'].fillna('')

elif mutagenesis_type == 'aa':
# For AA variants, add sequence differences only if not pre-annotated
if not has_pre_annotated_aa:
wt_aa_seq = translate_dna(wt_dna_seq) if len(wt_dna_seq) % 3 == 0 else wt_dna_seq
df['aa_seq_diff'] = df['variant_seq'].apply(
lambda x: compare_to_reference(wt_aa_seq, x)
lambda x: compare_to_reference(wt_aa_seq, x, no_change_marker=NO_DIFF_MARKER)
)
df['aa_seq_diff'] = df['aa_seq_diff'].fillna('')

# Map stop codon representations to * for standard notation in aa_seq_diff column
if 'aa_seq_diff' in df.columns:
Expand Down Expand Up @@ -114,32 +114,29 @@ def add_sequence_differences(
if mutagenesis_type in {'codon', 'snv'}:
# Add DNA sequence differences
df['dna_seq_diff'] = df['variant_seq'].apply(
lambda x: compare_to_reference(wt_dna_seq, x)
lambda x: compare_to_reference(wt_dna_seq, x, no_change_marker=NO_DIFF_MARKER)
)
df['dna_seq_diff'] = df['dna_seq_diff'].fillna('')

# Add AA sequence differences
wt_aa_seq = translate_dna(wt_dna_seq)
df['aa_seq'] = df['variant_seq'].apply(translate_dna)
df['aa_seq_diff'] = df['aa_seq'].apply(
lambda x: compare_to_reference(wt_aa_seq, x)
lambda x: compare_to_reference(wt_aa_seq, x, no_change_marker=NO_DIFF_MARKER)
)
df['aa_seq_diff'] = df['aa_seq_diff'].fillna('')

elif mutagenesis_type == 'aa':
# For AA variants, sequences are already amino acids
wt_aa_seq = translate_dna(wt_dna_seq) if len(wt_dna_seq) % 3 == 0 else wt_dna_seq
df['aa_seq_diff'] = df['variant_seq'].apply(
lambda x: compare_to_reference(wt_aa_seq, x)
lambda x: compare_to_reference(wt_aa_seq, x, no_change_marker=NO_DIFF_MARKER)
)
df['aa_seq_diff'] = df['aa_seq_diff'].fillna('')

return df

def classify_aa_variant(aa_diff, dna_diff=None):
if not aa_diff or aa_diff == '':
if aa_diff == NO_DIFF_MARKER:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Accept legacy blank no-change markers in AA classification

This classifier now treats only '=' as “no amino-acid change”, but older score tables (and callers that still use compare_to_reference with its default) represent no-change as ''. In those inputs, aa_seq_diff == '' now falls through to missense_aa, which can corrupt downstream WT/synonymous-dependent stats and normalization when reprocessing legacy outputs or pre-annotated data.

Useful? React with 👍 / 👎.

# Check if this is true WT (no DNA changes) or synonymous (DNA changes but same AA)
if dna_diff is not None and (not dna_diff or dna_diff == ''):
if dna_diff == NO_DIFF_MARKER:
return 'wt_dna'
else:
return 'synonymous'
Expand All @@ -149,9 +146,9 @@ def classify_aa_variant(aa_diff, dna_diff=None):
return 'missense_aa'

def classify_dna_variant(dna_diff, aa_diff):
if not dna_diff or dna_diff == '':
if dna_diff == NO_DIFF_MARKER:
return 'wt_dna'
elif not aa_diff or aa_diff == '':
elif aa_diff == NO_DIFF_MARKER:
return 'synonymous'
else:
return 'missense_dna'
Expand Down
Loading
Loading