Skip to main content
Docs

Search guides and API endpoints, for example “Idempotency-Key” or “submit job”.

    Tools · Cheminformatics & Structure

    Molecule Conversion

    Convert molecule file/data format
    On this page

    Prices, workflows, and method papersOpen in the app

    Run it from the API

    Submit with Submit a job and the job_type below. Price it first with Estimate job reservation cost: submitting reserves that amount from your wallet, and the charge settles at the actual runtime.

    Molecule Conversion convert-batch

    Job type
    convert-batch
    Hardware
    cpu (default)
    Typical runtime
    5 min on CPU

    Payload

    Payload fields
    FieldTypeDescription
    input_data[]required(string | object)[]

    Limits: min items 1, max items 50000

    input_formatrequiredstring

    One of: "fasta", "helm", "mol2block", "molblock", "mrvblock", "pdbblock", "scsrblock", "selfies", "sequence", "smarts", "smiles", "tplblock", "xyzblock", "inchi"

    output_formatrequiredstring

    One of: "inchi", "inchikey", "cmlblock", "cxsmarts", "cxsmiles", "fasta", "helm", "molblock", "sdf", "mrvblock", "pdbblock", "selfies", "sequence", "smarts", "smiles", "tplblock", "v2kmolblock", "v3kmolblock", "xyzblock"

    generate_3dboolean

    Default: false

    add_hydrogensboolean

    Default: false

    remove_hydrogensboolean

    Default: false

    Example

    from cognichem_client import CogniChem
    
    client = CogniChem.from_env()  # reads COGNICHEM_API_KEY
    payload = {
        "input_data": ["CCO"],
        "input_format": "smiles",
        "output_format": "smiles",
        "generate_3d": False,
        "add_hydrogens": False,
        "remove_hydrogens": False,
    }
    
    estimate = client.jobs.estimate(job_type="convert-batch", payload=payload, resource="cpu")
    print(f"Reserves ${estimate.cost:.2f}")
    
    job = client.jobs.submit(
        job_name="my-convert-batch-run",
        job_type="convert-batch",
        payload=payload,
        resource="cpu",
    )
    status = client.jobs.wait(job.process_id)
    if status.status == "completed":
        client.jobs.result(job.process_id, save_path=".")

    Sample data from the job catalog; long values are shortened here. Each job_name must be unique among your jobs.

    Workflow inputs

    • Molecules (list)SMILES, INCHI, MOLBLOCK

    Workflow outputs

    • ArchiveZIP
    • MoleculesSDF