deepmodeling / deepmodeling/unimol_tools

[Code scan] Keep targets and raw rows aligned after SMILES cleaning

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
34
Forks
9
PR merge metrics
No merged PRs in 30d

Description

This issue is a result of a Codex global repository scan.

## Summary
MolDataReader captures raw_target and raw_data before invalid SMILES are filtered, but builds smiles, scaffolds, group values, and conformer inputs from the filtered dataframe. Training can therefore pair molecular features with labels from different rows, and SDF caching can fail when a shorter molecule list is assigned back to the unfiltered raw dataframe.

## Code references
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_tools/data/datareader.py#L142-L159
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_tools/data/datahub.py#L124-L127
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_tools/data/datahub.py#L191-L193

## Impact
Datasets containing invalid SMILES with smi_strict disabled may silently train on mismatched targets, producing invalid metrics and models. Prediction or SDF cache output can also contain rows that no longer correspond to generated conformers.

## Suggested fix
Apply the SMILES validity mask before constructing all row-aligned return fields, including raw_data and raw_target, then reset the index. Alternatively, rebuild every row-aligned field from the same filtered dataframe after cleaning.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in unimol_tools/data/datareader.py around lines 142-159 and trace how the SMILES validity mask is applied before row-aligned fields are returned. Then inspect the related assignments in unimol_tools/data/datahub.py around lines 124-127 and 191-193. Done means raw_data, raw_target, molecular fields, and conformer or SDF outputs all retain matching rows after invalid SMILES are removed and the index is reset.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.