Skip to content

FIX float counts in Paladin mapping#74

Merged
celiosantosjr merged 14 commits intomainfrom
celiosantosjr-patch-1
Jun 19, 2025
Merged

FIX float counts in Paladin mapping#74
celiosantosjr merged 14 commits intomainfrom
celiosantosjr-patch-1

Conversation

@celiosantosjr
Copy link
Copy Markdown
Collaborator

@celiosantosjr celiosantosjr commented Jun 19, 2025

Paladin mapping does some frame-shitfs and probabilistic alignment, which leads to fractional weights propagating into SAM/BAM files. To fix that:

  • sam filtering to avoid this problem keeping only uniquely mapped matchers

  • count should consider only uniquely mapped matchers.

  • dowgraded version and IR version of onnx models to wider compatibility

- include a rounding in ngless counts to avoid split matches in Paladin
- Eliminate problems of compability
    - do not test using Python 3.8 due to ONNX models
- Add downgraded IR versions of Hemo and AMP models to wide compatibility
- Downgrade of IR versions to 7 (allows compatibility to the present the installed environment and before ones)
- Include the same models adapted with:

```
import onnx

# Load the model
model = onnx.load("your_model.onnx")

# Downgrade IR version from 10 to 7
model.ir_version = 7

# Save the model
onnx.save(model, "downgraded_model.onnx")
```
- Downgrade version of the model to ONNX 16
- Dowgrade version to IR version 7

```
>>> from onnx import version_converter
>>> model = onnx.load('TEST.onnx')
>>> model.ir_version = 7
>>> model = optimize(model, ["eliminate_identity", "fuse_consecutive_transposes"])
>>> model = version_converter.convert_version(model, 16)
>>> onnx.save(model, "TEST.onnx")
```
Key Changes:

    Added filter() step with samflag(secondary=False) which is the NGless equivalent of -F 256

    The filtered alignments are then passed to count()

    Maintained your existing integer conversion and output
@celiosantosjr celiosantosjr added bug Something isn't working enhancement New feature or request labels Jun 19, 2025
@celiosantosjr celiosantosjr merged commit c21cd19 into main Jun 19, 2025
30 checks passed
@celiosantosjr celiosantosjr deleted the celiosantosjr-patch-1 branch June 19, 2025 06:19
luispedro added a commit to luispedro/macrel that referenced this pull request Nov 24, 2025
Big change is switching to ONNX for model storage to avoid depending on
very particular versions of scikit-learn

- Fix float counts in Paladin mapping (BigDataBiology#74)
- Fix some issues in MacOS
luispedro added a commit to luispedro/macrel that referenced this pull request Nov 24, 2025
Big change is switching to ONNX for model storage to avoid depending on
very particular versions of scikit-learn

- Fix float counts in Paladin mapping (BigDataBiology#74)
- Fix some issues in MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-integer results appear when AMP abundance is measured. Use a more robust way to distribute models

1 participant