.NET Development

Develop with GCModeller

GCModeller is not only an R# scripting environment — every module is also published as a .NET package. Add the sciBASIC NuGet feed to Visual Studio, reference SMRUCC.genomics.* from your project, and build bioinformatics applications directly on top of the framework in VB.NET, C# or F#.

i The GCModeller packages are distributed on the NuGet feed of the sciBASIC.NET foundation, the package platform behind GCModeller's own dependencies. Downloads are anonymous — no account or API key is required. Looking for the R# scripting workflow instead? That route is documented on the Install page.
01

Register the sciBASIC package source

Visual Studio — Options
Tools ▸ Options ▸ NuGet Package Manager ▸ Package Sources

# click (+), fill in the two fields below, then Update → OK
Name:    sciBASIC
Source:  https://nuget.scibasic.net/v3/index.json

The feed is a standard NuGet v3 service, so the official Visual Studio client talks to it without any extra tooling. Package downloads are anonymous; publishing to the feed is a separate, authenticated operation and is not needed to consume GCModeller.

02

Browse and install the packages

Manage NuGet Packages — Browse
# right-click the project → "Manage NuGet Packages…"
# switch the package source dropdown to sciBASIC, then search:

Package source: sciBASIC
Search:         SMRUCC.genomics

# 93 packages currently carry the gcmodeller tag, for example:
SMRUCC.genomics.core                # 10.5.3.8911 · foundation library
SMRUCC.genomics.annotation          # GFF / PTF annotation models
SMRUCC.genomics.annotation.prodigal # gene prediction
SMRUCC.genomics.analysis.hts.gsea   # gene set enrichment
SMRUCC.genomics.analysis.metagenome # 16S / OTU community analysis

The complete, always up-to-date listing lives on the gcmodeller tag page of the sciBASIC feed — check it first when you are unsure which module provides the algorithm you need. Dependencies are resolved automatically, so installing a high-level module such as SMRUCC.genomics.analysis.hts.gsea also pulls in SMRUCC.genomics.core and the shared data models.

03

Command line & NuGet.config

terminal — dotnet CLI / Package Manager Console
# register the feed once, then add packages as usual
$ dotnet nuget add source https://nuget.scibasic.net/v3/index.json -n sciBASIC
$ dotnet add package SMRUCC.genomics.core --source sciBASIC

# or, from the Package Manager Console inside Visual Studio:
PM> Install-Package SMRUCC.genomics.core -Source sciBASIC
NuGet.config — commit the source with your solution
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="sciBASIC" value="https://nuget.scibasic.net/v3/index.json" />
  </packageSources>
</configuration>

A checked-in NuGet.config is the most reliable option for teams and CI pipelines: every restore resolves GCModeller from the sciBASIC feed without any per-machine setup.

04

Your first GCModeller program

The snippet below is real production code taken from the Bifrost gene-prediction command line tool of GCModeller (annotations/Bifrost/Bifrost/Program.vb). It exposes two CLI verbs — prodigal for ab-initio prokaryotic gene calling and metaeuk for homology-based eukaryotic prediction — and shows the typical shape of a GCModeller program: import a namespace, read a FASTA file, run a worker, export the result. The same program is shown in all three .NET languages.

Bifrost.vb — VB.NETVB.NET
Imports Microsoft.VisualBasic.CommandLine
Imports Microsoft.VisualBasic.CommandLine.Reflection
Imports SMRUCC.genomics.Annotation.MetaEuk
Imports SMRUCC.genomics.Annotation.Prodigal
Imports SMRUCC.genomics.SequenceModel.FASTA

Module Program

    Public Function Main(args As String()) As Integer
        Return GetType(Program).RunCLI(App.CommandLine)
    End Function

    <ExportAPI("prodigal")>
    Public Function Prodigal(args As CommandLine) As Integer
        Dim MAGs As String = args("--contigs")
        Dim outprefix As String = args("--output")
        Dim predicts = ProdigalWorker.GenePrediction(FastaFile.Read(MAGs)).ToArray

        Call ProdigalWorker.ExportResult(predicts, outprefix)

        Return 0
    End Function

    <ExportAPI("metaeuk")>
    Public Function MetaEuk(args As CommandLine) As Integer
        Dim config As New MetaEukConfig With {
            .ReferenceFile = args("--reference"),
            .ContigsFile = args("--contigs"),
            .OutputPrefix = args("--output")
        }
        Dim predicts As GenePrediction() = MetaEukWorker.Predict(config).ToArray

        Call MetaEukWorker.ExportResult(predicts, config)

        Return 0
    End Function

End Module
Bifrost.cs — C#C#
using Microsoft.VisualBasic.CommandLine;
using Microsoft.VisualBasic.CommandLine.Reflection;
using SMRUCC.genomics.Annotation.MetaEuk;
using SMRUCC.genomics.Annotation.Prodigal;
using SMRUCC.genomics.SequenceModel.FASTA;

public static class Program
{
    public static int Main(string[] args)
    {
        return typeof(Program).RunCLI(App.CommandLine);
    }

    [ExportAPI("prodigal")]
    public static int Prodigal(CommandLine args)
    {
        string MAGs = args["--contigs"];
        string outprefix = args["--output"];
        var predicts = ProdigalWorker.GenePrediction(FastaFile.Read(MAGs)).ToArray();

        ProdigalWorker.ExportResult(predicts, outprefix);

        return 0;
    }

    [ExportAPI("metaeuk")]
    public static int MetaEuk(CommandLine args)
    {
        var config = new MetaEukConfig {
            ReferenceFile = args["--reference"],
            ContigsFile = args["--contigs"],
            OutputPrefix = args["--output"]
        };
        GenePrediction[] predicts = MetaEukWorker.Predict(config).ToArray();

        MetaEukWorker.ExportResult(predicts, config);

        return 0;
    }
}
Bifrost.fs — F#F#
open Microsoft.VisualBasic.CommandLine
open Microsoft.VisualBasic.CommandLine.Reflection
open SMRUCC.genomics.Annotation.MetaEuk
open SMRUCC.genomics.Annotation.Prodigal
open SMRUCC.genomics.SequenceModel.FASTA

module Program =

    let Main (args: string[]) : int =
        typeof<Program>.RunCLI(App.CommandLine)

    [<ExportAPI("prodigal")>]
    let Prodigal (args: CommandLine) : int =
        let MAGs = args.["--contigs"]
        let outprefix = args.["--output"]
        let predicts = ProdigalWorker.GenePrediction(FastaFile.Read(MAGs)) |> Seq.toArray

        ProdigalWorker.ExportResult(predicts, outprefix)

        0

    [<ExportAPI("metaeuk")>]
    let MetaEuk (args: CommandLine) : int =
        let config = MetaEukConfig(
                        ReferenceFile = args.["--reference"],
                        ContigsFile = args.["--contigs"],
                        OutputPrefix = args.["--output"])

        let predicts : GenePrediction[] = MetaEukWorker.Predict(config) |> Seq.toArray

        MetaEukWorker.ExportResult(predicts, config)

        0

Every type and function used above — FastaFile, ProdigalWorker, MetaEukWorker, GenePrediction — is documented with its full signature in the CLR API reference. GCModeller itself is written in VB.NET, so the VB.NET flavour is always the reference implementation; C# and F# consume the very same assemblies.

05

Which package do I need?

◆

Core

SMRUCC.genomics.core — the foundation library: biological file I/O streams and the shared data models every other module builds on. Install it first.

◇

Annotation

SMRUCC.genomics.annotation, .annotation.prodigal, .annotation.metaeuk — gene prediction and genome annotation file models (GFF, PTF, GO / KO / Pfam mapping).

◈

Analysis

SMRUCC.genomics.analysis.* — enrichment (.go, .kegg, .analysis.hts.gsea), expression (.hts.rnaexpression), network inference (.hts.wgcna), FBA and metagenomics.

◑

Data & repositories

SMRUCC.genomics.data.* — readers for BioCyc / MetaCyc, KEGG, Reactome, UniProt, RCSB PDB and the regulon databases.

Browse the NuGet Packages ↗ .NET API Reference ↗ Back to Install