GithubHelp home page GithubHelp logo

boydgreenfield / codex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbiokyle29/codex

0.0 3.0 0.0 194 KB

Perl library for working with the OneCodex api

License: MIT License

Perl 100.00%

codex's Introduction

Codex

Note: This is an unofficial module for interacting with the One Codex platform

A Perl module for consuming the One Codex API

Requires:

the Mojolicous web framework - link
the light-weight Mouse object framework - link

Description:

This module provides a wrapper around the One Codex REST api. It simplifies api calls by abstracting away the curl calls into simple method calls. It also provides Mouse objects for all of the api objects (Samples, Analyses, References etc), and typed Collections for working with sets of these objects. Allows for simple integration of the One Codex api into existing pipelines.

Installation:

```bash git clone https://github.com/mbiokyle29/codex/ cd codex perl MakeFile.PL sudo make sudo make install ```

Useage:

```perl use Codex;

Create instance, supplying your API key

my $codex = Codex->new(api_key => "API KEY");

Fetch a sample by sample id

returns a Codex::Sample object

my $sample = $codex->get_sample("SAMPLE ID");

Fetch all samples for authenticated user

returns a Codex::Collection object of type Sample

my $sample_collecion = $codex->get_samples;

Get all of the samples in the collection that are completed

my $array = $sample_collection->completed_samples # Returns an array of samples

Search the sample collection using a hash ref

the keys are the fields to search, values are what to match, can be regex

This searches the sample collection for all samples whos filename matches the regex

my $fasta_samples = $sample_collection->search( { filename => '.*.fasta$' } );

Process each sample

while(my $sample = $sample_collection->pop) { # Iterate through the samples }

upload a read file

my $uploaded_id = $codex->upload("my_sample_reads.fasta");

Download raw data

$codex->get_raw_analysis("SAMPLE ID");


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.