Giter VIP home page Giter VIP logo

cigarparser's Introduction

Cigar String Parser

A Rust library to parse CIGAR strings and, in particular, identify junction positions. CIGAR strings are a format used to summarize alignments in bioinformatics, present in BAM and SAM formats. They are used by NGS aligners to summarize how a read aligns to a genome.

How to Use

in your toml add this dependancy

CigarParser = { git = "https://github.com/rLannes/CigarParser" }

This crate exposes the Cigar structure that you can load using the following:

extern crate CigarParser;
use CigarParser::cigar::Cigar;

You have two options to create a Cigar object:

// This returns a Result allowing fine-grained control
let cig = Cigar::from_str("35M110N45M3I45M10N11M");

// This will panic if the CIGAR string is not properly formatted
let cig = Cigar::from("35M110N45M3I45M10N11M");

To get the junction positions, if any, use:.

let cig = Cigar::from("35M110N45M3I45M10N");
let results = cig.get_skipped_pos_on_ref(&500);
assert_eq!(results, Some(vec![535, 645, 738, 748]));

I wrote this as a standalone library so you can integrate it with any tools that read BAM files, such as rust-htslib. Suggestions and comments are welcome!

cigarparser's People

Contributors

rlannes avatar

Watchers

 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.