Getting started¶
BioKotlin is published to Maven Central as org.biokotlin:biokotlin. Pick
whichever of the following fits how you work.
You need Java 21 or newer
BioKotlin is compiled to Java 21 bytecode, so a JDK 21+ runtime is
required. Check yours with java -version.
JupyterLab with the Kotlin kernel¶
This is the quickest way to try BioKotlin interactively, and it is how the tutorials in this site are written.
-
Install Java 21 or newer.
-
Install the Kotlin kernel for Jupyter, either with conda:
or with pip:
-
Install JupyterLab, start it, and create a notebook with the Kotlin kernel.
-
Load BioKotlin in the first cell:
The
%useline magic resolves BioKotlin from Maven Central and sets up its default imports. To pin a version, write%use biokotlin(1.0.0).
Kotlin script¶
Add a dependency annotation at the top of a .main.kts file:
@file:DependsOn("org.biokotlin:biokotlin:1.0.0")
import biokotlin.seq.*
val dna = NucSeq("GCAGAT")
println(dna.reverse_complement())
Run it with kotlin my-script.main.kts.
Gradle or Maven project¶
All released versions are listed on Maven Central.
Command line tools¶
The command line interface lives in a separate project, biokotlin-tools. Download an installable tar file from its releases page.
Building from source¶
./gradlew shadowJar produces a fat jar under build/libs/ if you want to
load a development build into a notebook with @file:DependsOn.
Next steps¶
- Work through the tutorials.
- Look up types and functions in the API reference.
- Coming from Python? See the BioPython comparison.