Skip to content

Stdlib Portals

Stdlib portals are higher-level workflow APIs that lower to core Culsma forms.

They are not a second execution semantics. A portal lowers into the same core language surface used elsewhere: transfer, environment, separation, fractionation, readout, schedule/control flow, and constructor/init forms.

Portal Set

PortalRoleReturn policy
IncubateHold a sample under thermal conditions.Returns the sample/container reference.
LyseLysis-oriented workflow over env, transfer, and separation.Returns the sample/container reference.
ExtractDNAPrecipitationDNA extraction via precipitation skeleton.Returns the output container.
ExtractDNAColumnDNA extraction via column/filtration skeleton.Returns the output container.
PCRThermal workflow template for PCR operations.Returns the reaction/sample container reference.
ElectrophoresisField separation plus stain/readout workflow.Returns the final data_ref when let-bound.

Incubate

text
Incubate(sample = tube_a, temp = 37C, duration = 30min);

Contract:

  • sample: target container
  • temp: scalar temperature or thermal_program(...)
  • duration: required for scalar thermal mode

Lowering intent:

text
with env(thermal = temp, duration = duration) {
    hold(sample = sample);
}

When temp is a thermal_program(...), the duration belongs to that program and is not also supplied as outer scalar duration.

Lyse

text
Lyse(sample = sample_tube, buffer = lysis_input, duration = 10min, temp = 4C);

Contract:

  • sample: input sample container
  • buffer: actual lysis input container or aliquot for this step
  • duration: lysis duration
  • temp: lysis temperature

Lowering intent combines:

  • with env(...)
  • transfer from buffer into sample
  • sep(program = disrupt_program(...))
  • collecting the lysate slot back into the sample

Lyse(...) returns the lysis target/sample reference. It does not materialize implicit alias names such as Lysate.

ExtractDNAPrecipitation

text
ExtractDNAPrecipitation(
    sample = lysate,
    precip_buffer = precip_input,
    wash_inputs = [wash_1, wash_2],
    dissolve_buffer = dissolve_input,
    output = dna_out,
    cleanup_temp = 25C,
    cleanup_duration = 3min
);

Contract:

  • sample: lysate/sample container
  • precip_buffer: single-use precipitation reagent input
  • wash_inputs: ordered list of wash inputs
  • dissolve_buffer: dissolve/resuspension input
  • output: final output container
  • cleanup_temp / cleanup_duration: cleanup incubation parameters

Lowering intent uses transfer, centrifuge separation, washing, and environment hold steps.

ExtractDNAColumn

text
ExtractDNAColumn(
    sample = lysate,
    bind_buffer = bind_input,
    wash_inputs = [wash_1, wash_2],
    elution_buffer = elution_input,
    column = spin_column,
    waste = waste_tube,
    output = dna_out,
    cleanup_temp = 25C,
    cleanup_duration = 2min
);

Contract:

  • sample: lysate/sample container
  • bind_buffer: single-use binding input
  • wash_inputs: ordered list of wash inputs
  • elution_buffer: elution input
  • column: work container used as column/stage carrier
  • waste: waste collection container
  • output: final output container
  • cleanup_temp / cleanup_duration: cleanup incubation parameters

Lowering intent uses transfer, filtration separation, washing, elution, and environment hold steps.

PCR

text
PCR(sample = pcr_well, primers = "Panel_12Plex", cycles = 35, annealing_temp = 60C);

Contract:

  • sample: reaction container
  • primers: workflow contract field
  • cycles: cycle count
  • annealing_temp: annealing segment temperature

Lowering intent uses explicit repeated thermal workflow steps.

Important boundary:

PCR(...) is workflow-only. It does not imply natural amplification simulation, hidden product multiplication, or yield prediction.

Electrophoresis

text
let gel_obs = Electrophoresis(
    sample = gel_lane,
    gel_type = "Agarose_1.5pct",
    stain = stain_input,
    field = 100V,
    duration = 30min,
    readout_schema = gel_obs_schema
);

Contract:

  • sample: already-loaded gel lane/container
  • gel_type: gel chemistry/type descriptor
  • stain: actual stain input
  • field: electrophoresis field strength
  • duration: run duration
  • readout_schema: explicit structure declaration for the image/data readout

Lowering intent:

  • sep(program = field_program(...))
  • transfer stain into the relevant separated slot
  • img(quantity = customized, schema_ref = readout_schema, save_raw = true)

When let-bound, Electrophoresis(...) returns the final data_ref.

Legacy Names

Legacy generic forms are not the preferred authoring style.

Use:

  • ExtractDNAPrecipitation(...)
  • ExtractDNAColumn(...)
  • direct img(...), ecp(...), or phy(...) readout

Avoid:

  • generic ExtractDNA(sample, method)
  • generic Measure(...)

Those names are legacy continuity concepts, not the recommended authoring path.

Example Publication Rule

Publish a portal example only when it includes:

  1. a runnable .culs source file;
  2. a verified CLI command;
  3. expected artifacts or run result summary.

Released under the Apache-2.0 license.