Giter Site home page Giter Site logo

sychan / kb_sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kbase/kb_sdk

0.0 2.0 0.0 5.92 MB

Build and test new Apps for the KBase platorm

License: MIT License

Ruby 0.31% Makefile 0.29% Shell 0.83% Perl 3.21% Python 5.45% Java 89.31% JavaScript 0.60%

kb_sdk's Introduction

alt text KBase SDK

The KBase SDK is a set of tools for developing new KBase Apps that can be dynamically registered and run on the KBase platform. Apps are grouped into modules that include all code, dependencies, specification files, and documentation needed to define and run Apps in the KBase Narrative interface. By using Docker combined with the KBase App Catalog, you can build and run a new "Hello World!" App in KBase in minutes.

There are still some general restrictions on functionality that will gradually be lifted as the SDK and KBase platform are refined. The current restrictions are:

  • Runs completely on a standard KBase worker node (at least 2 cores and 22GB memory)
  • Operates only on supported KBase data types
  • Requires either no or fairly limited amounts of reference data
  • Uses existing data visualization widgets
  • Does not require new uploaders/downloaders
  • Wrapper written in Python, Java, R, or Perl

If you have a tool you would like to register with KBase that cannot meet these requirements, please contact us to discuss possible solutions.

In order to register your SDK module, you have to be an approved KBase developer. To become an approved KBase developer, first create a standard KBase user account through http://kbase.us and apply for a developer account. Once you have submitted the forms, please contact us at http://kbase.us/contact-us with your username and we will help with the next steps.

Steps in Using SDK

  1. Install SDK Dependencies
  2. Install and Build SDK
  3. Create Module
  4. Edit Module and Method(s)
  5. Locally Test Module and Method(s)
  6. Register Module
  7. Test in KBase
  8. Complete Module Info
  9. Deploy

Additional Documentation


## Quick Install Guide

Below is a quick reference guide for installation. For more complete details and troubleshooting, see the Full Installation Guide.

Installation Only

System Dependencies:

Get the SDK:

git clone https://github.com/kbase/kb_sdk

Pull dependencies and configure the SDK:

cd kb_sdk
make bin

Download the local KBase SDK base Docker image:

make sdkbase 

Add the kb-sdk tool to your PATH and enable command completion. From the kb_sdk directory:

# for bash
export PATH=$(pwd)/bin:$PATH
source src/sh/sdk-completion.sh

Test installation:

kb-sdk help

Build from source

Additional System Dependencies:

Follow basic instructions above. Instead of running make bin you can run make to compile the SDK:

cd kb_sdk
make

## Quick Start Guide

Initialize a new module populated with the ContigFilter example (module names need to be unique in KBase, so you should pick a different name):

kb-sdk init --example -l python -u [your_kbase_user_name] MyContigFilter

Enter your new module directory and do the initial build:

cd MyContigFilter
make

Edit the local test config file (test_local/test.cfg) with a KBase user account name and password:

test_user = TEST_USER_NAME
test_password = TEST_PASSWORD

Run tests:

cd test_local
kb-sdk test

This will build your Docker container, run the method implementation running in the Docker container that fetches example ContigSet data from the KBase CI database and generates output.

Inspect the Docker container by dropping into a bash console and poke around, from the test_local directory:

./run_bash.sh

When you make changes to the Narrative method specifications, you can validate them for syntax locally. From the base directory of your module:

kb-sdk validate

Add your repo to GitHub (or any other public git repository), from the MyContigFilter base directory:

cd MyContigFilter
git init
git add .
git commit -m 'initial commit'
# go to github and create a new repo that is not initialized
git remote add origin https://github.com/[GITHUB_USER_NAME]/[GITHUB_REPO_NAME].git
git push -u origin master

Now go to https://appdev.kbase.us/#appcatalog/register. Enter your public git repo url (e.g. https://github.com/[GITHUB_USER_NAME]/[GITHUB_REPO_NAME]) and submit. Wait for the registration to complete. Note that you must be an approved developer to register a new module.

Your method is now available in the AppDev environment in KBase. Go to https://appdev.kbase.us and start a new narrative. Click on the 'R' in the method panel list until it switches to 'D' for methods still in development. Find your new method by searching for your module, and run it to filter some contigs.

Your method will now also be visible in the App Catalog when displaying Apps in development: https://appdev.kbase.us/#appcatalog/browse/dev and https://narrative.kbase.us/#appcatalog/browse/dev. From your module page (e.g. https://narrative.kbase.us/#appcatalog/module/[MODULE_NAME]) you'll be able to register any update and manage release of your module to the production KBase environment for anyone to use.

Now, dive into Making your own Module.


## Example Modules

There are a number of modules that we continually update and modify to demonstrate best practices in code and documentation and present working examples of how to interact with the KBase API and data models.

  • MegaHit (Python) - assembles short metagenomic read data (Read Data -> Contigs)
  • Trimmomatic (Python) - filters/trims short read data (Read Data -> Read Data)
  • OrthoMCL (Python) - identifies orthologous groups of protein sequences from a set of genomes (Annotated Genomes / GenomeSet -> Pangenome)
  • ContigFilter (Python) - filters contigs based on length (ContigSet -> ContigSet)

## Need more?

If you have questions or comments, please create a GitHub issue or pull request, or contact us through http://kbase.us/contact-us

kb_sdk's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.