Skip to content

Using ROMol object #23

@bertiewooster

Description

@bertiewooster

This is more of a usage question. I'm trying to use the ROMol object in a Polars plug-in to canonicalize a SMILES string:

use rdkit_rs::ROMol;

#[polars_expr(output_type=String)]
fn canonicalize(inputs: &[Series]) -> PolarsResult<Series> {
    let ca: &StringChunked = inputs[0].str()?;
    let romol = ROMol::from_smiles(ca).unwrap();
    let out: StringChunked = ca.apply_to_buffer(|value: &str, output: &mut String| {
        write!(output, "{}", romol.as_smiles()).unwrap()
    });
    Ok(out.into_series())
}

but the use line has this error:

unresolved import `rdkit_rs::ROMol`
no `ROMol` in the rootrustc
extern crate rdkit_rs

My Cargo.toml file includes

[dependencies]
rdkit-rs = "0.1.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions