# CSV Format Validation

> Use when when you have a .csv file intended as input to CypReact containing SMILES strings and need to verify it meets the required comma-separated format specification and that each SMILES string is syntactically valid before processing molecules through CYP isoform testing.

- Skill: `holobiomicslab/csv-format-validation` (Agent Skill)
- Install (CLI): `npx skillmds@latest add holobiomicslab/csv-format-validation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/holobiomicslab/csv-format-validation/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- License: CC-BY-4.0
- Author: HolobiomicsLab (https://skillmd.com/u/holobiomicslab)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/holobiomicslab/csv-format-validation

---


# CSV format validation

> **License: restricted** — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->
## Summary

Validates that comma-separated SMILES input files (.csv) conform to CypReact's required format and contain syntactically correct molecular structure representations. This skill ensures molecules can be successfully ingested before running CYP isoform reactivity predictions.

## When to use

When you have a .csv file intended as input to CypReact containing SMILES strings and need to verify it meets the required comma-separated format specification and that each SMILES string is syntactically valid before processing molecules through CYP isoform testing.

## When NOT to use

- Input is already a .sdf file (use direct .sdf input to CypReact instead)
- SMILES strings are already validated and formatted in a structured database or data object
- Molecules are in a different format not requiring CSV parsing (e.g., InChI, molecular name lists)

## Inputs

- .csv file containing SMILES strings separated by commas
- raw SMILES string sequences

## Outputs

- validated .csv file with deduplicated, syntactically correct SMILES
- validated .json file with structured molecule records and metadata
- validation report documenting SMILES correctness and format compliance

## How to apply

Load the .csv file using a CSV parser (e.g., pandas) and extract all SMILES strings. Validate each SMILES string for syntactic correctness using RDKit or an equivalent molecular structure validator to confirm it represents a valid chemical structure. Check that molecules are comma-separated as required by CypReact's specification. Deduplicate the molecule list to remove redundant entries. Format the validated molecule list as a structured data object (DataFrame or JSON) compatible with CypReact input specifications. Write the parsed and validated molecule list to an output file (CSV or JSON) with validated SMILES and metadata fields.

## Related tools

- **CypReact** (Target tool that ingests and processes the validated CSV-formatted SMILES input for CYP isoform reactivity prediction) — github:bitbucket.org__Leon_Ti__cypreact
- **RDKit** (Molecular structure validator used to verify syntactic correctness of each SMILES string)
- **pandas** (CSV parser and data structure tool for loading, deduplicating, and formatting molecule lists)

## Examples

```
import pandas as pd
from rdkit import Chem

df = pd.read_csv('molecules.csv')
valid_smiles = [s for s in df['SMILES'] if Chem.MolFromSmiles(s) is not None]
valid_df = pd.DataFrame({'SMILES': list(set(valid_smiles))})
valid_df.to_csv('validated_molecules.csv', index=False)
```

## Evaluation signals

- All SMILES strings parse successfully without RDKit errors or syntax exceptions
- Output .csv/.json contains deduplicated molecule list with no empty or malformed SMILES entries
- File structure matches CypReact input specification (comma-separated format with valid metadata fields)
- Validated output can be successfully loaded by CypReact without pre-processing errors
- Comparison of input vs. output record counts shows deduplication was applied and all remaining SMILES are valid

## Limitations

- Validation only confirms syntactic SMILES correctness; does not verify chemical feasibility or drug-likeness
- Large CSV files may require chunked or streaming parsing to avoid memory exhaustion
- Deduplication is exact-match only; stereoisomers or different canonical forms are not detected as duplicates
- No changelog documented for CypReact format version changes; format specification may drift between releases

## Evidence

- [intro] csv_format_requirement: "If the user input a .csv file, it should contains the SMILEs of all molecules and split them with ","."
- [other] validation_and_parsing_workflow: "Validate each SMILES string for syntactic correctness using RDKit or equivalent molecular structure validator. Extract and deduplicate the molecule list. Format the parsed molecule list as a"
- [intro] output_format_specification: "The user can output a .sdf file or a .csv file."
- [intro] csv_input_alternative: "The user can either input a .sdf file or a .csv. If the user input a .csv file, it should contains the SMILEs of all molecules and split them with ","."

