Giter Site home page Giter Site logo

resolwe-bio-py's Introduction

Resolwe SDK for Python

Build Status Coverage Status Documentation Status Version on PyPI Supported Python versions

Resolwe is a dataflow package for the Django framework. Resolwe Bioinformatics is an extension of Resolwe that provides bioinformatics pipelines. Resolwe SDK for Python supports writing dataflow pipelines for Resolwe and Resolwe Bioinformatics.

Docs & Help

Read the detailed description in documentation.

Install

Install from PyPI:

pip install resdk

To install for development, fork on Github and run:

git clone https://github.com/<GITHUB_USER>/resolwe-bio-py.git
cd resolwe-bio-py
pip install -e .[docs,package,test]

Quick Start

Connect to a Resolwe server:

from resdk import Resolwe
res = Resolwe('admin', 'admin', 'https://torta.bcm.genialis.com')

# Recomended: start logging
resdk.start_logging()

If you do not have access to the Resolwe server, contact us at [email protected].

Get sample by ID and download the aligned reads (BAM file):

sample = res.sample.get(1)
sample.download(type='bam')

Find human samples and download all aligned reads (BAM files):

samples = res.sample.filter(descriptor__organism="Homo sapiens")
for sample in samples:
    sample.download(type='bam')

Primary analysis (e.g., filtering, alignment, expression estimation) starts automatically when samples are annotated. A step in primary analysis is represented as Data object, attached to the sample. A Sample object includes sample annotation. A Data object includes input parameters, results and analysis annotation. Print the steps in primary analysis pipeline:

sample = res.sample.get(1)
for data_id in sample.data:
    data = res.data.get(data_id)
    print data.process_name

Find ROSE2 analysis results and download a super-enhancer rank plot of the first ROSE2 analysis Data object:

rose2_list = res.data.filter(type='data:chipseq:rose2:')
rose2 = rose2_list[0]
rose2.download(name='20150531-u266-A-H3K27Ac-ML1949_S2_R1_mapped_peaks_Plot_panel.png')

Run Bowtie2 mapping on the reads Data object of the above sample:

genome = res.data.get('hg19')
genome_id = genome.id
reads_id = sample.data[0]
aligned = res.run('alignment-bowtie-2-2-3_trim', input={
                      'genome': genome_id,
                      'reads': reads_id,
                      'reporting': {'rep_mode': 'k', 'k_reports': 1}
                  })
aligned.status

After a while you can check if the alignment has finished:

aligned.update()
aligned.status

Continue in the Getting Started section of Documentation, where we explain how to upload files, create samples and provide details about the Resolwe backend. Bioinformaticians can learn how to develop pipelines in Writing Pipelines.

resolwe-bio-py's People

Contributors

ales-erjavec avatar dblenkus avatar jkokosar avatar jurezmrzlikar avatar markotoplak avatar mstajdohar avatar tjanez avatar

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.