Code Monkey home page Code Monkey logo

bamliftover's Introduction

bamLiftOver - Lift BAM alignments from one build to another (not just the coordinates!)\

bamLiftOver requires the same input as the standard liftover tool, i.e. a chain file from the current coordinate system to the desired one and of course a bam file containing the alignments to lift over.
It performs coordinate conversion, CIGAR string updates and fragment size corrections for all read pairs along with updating the bam file header according to the supplied chain file.

command: bamLiftOver alignmentsInOldBuild.bam(input) chain-file.chain(input) alignmentsInNewBuild.bam(output)

Optionally, you can use mergeHaps to merge two BAM files containing the same reads aligned to 2 different references(haplotypes for example) after lifting them back to the reference space.
mergeHaps selects the best alignment(based on alignment score, AS tag) for each read/read-pair and writes those to primary.bam along with a new tag XH:1/2 indicating which file the alignment came from (0 if they are equal).
Other files generated by mergeHaps are:\

  • hap1.specific.bam -> Contains all alignments from file1 without an equivalent alignment in file2
  • hap2.specific.bam -> Contains all alignments from file2 without an equivalent alignment in file1
  • equalSecondary.bam -> Contains all alignments equal for both files without being the best alignments A third parameter can also be supplied to mergeHaps in the form of a BAM file containing reads aligned directly to the build the others were lifted to.
    mergeHaps then generates summary statistics regarding between the litfted over alignments and the direct alignment (also based on alignment score).

command: mergeHaps 1.liftover.bam(input) 2.liftover.bam(input) [refAligned.bam](input)

Compilation commands:
make bamLiftOver
make mergeHaps
Requires htslib, available here and SeqAnHTS(included as a submodule, git cloning must be done recursively)

bamliftover's People

Contributors

hannespetur avatar

Stargazers

Songtao Gui avatar  avatar  avatar

Watchers

Vilmundur Pálmason avatar James Cloos avatar Pall Melsted avatar  avatar  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.