Giter Club home page Giter Club logo

samwell's Introduction

Python package

Samwell: a python package for using genomic files... well

Samwell provides elegant utilities for managing biological data.

Quickstart

First install samwell:

pip install samwell

Reading/Writing BAMs with automatic inference of filetype

Samwell provides easy utilities for reading/writing BAMs:

from samwell import sam
with sam.writer("my-output-file.bam") as out_bam:
    with sam.reader("myfile.bam") as in_bam:
        for read in fp:
            if read.is_paired:
                out_bam.write(read)

Realigning fastqs with bwa

You can use samwell to easily realign fastq records as necessary

from samwell import sam
from samwell import bwa_mem
with sam.reader("myfile.bam") as in_bam:
    with sam.writer("outfile.bam") as out_bam:
        fastq_gen = (FastqRecord.build(read) for read in in_bam)
        gen = clip_specific_reads(fastq_gen)
        out_bam.write(bwa_mem.align(gen))

See samwell.bwa_mem module for more detail.

Developing with samwell

Samwell uses poetry for dependency managment.

Please install poetry using the instructions in the above link. Then simply execute:

poetry install

Checking the Build

Linting

poetry run flake8 --config=flake8.cfg samwell

Type Checking

poetry run mypy -p samwell --config=mypy.ini

Unit Tests

poetry run python -m pytest --cov=samwell --cov-branch

samwell's People

Contributors

nh13 avatar

Watchers

James Cloos 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.