GithubHelp home page GithubHelp logo

bamcmp's Introduction

bamcmp

bamcmp is a tools for deconvolving host and graft reads. The algorithm makes use of full-length alignments and their scores and can use values extracted from the CIGAR string or mapping quality scores when alignment scores are unavailable. With paired end data, conflicts are resolved at the individual read level, not the fragment level, allowing more data to be retained. This approach allows a weak but significant match to one organism to be ignored in favor of a stronger match to the other.

Quick Install

bamcmp requires htslib (http://www.htslib.org).

Please set the environment variable $HTSLIBDIR to the proper folder before running make

export HTSLIBDIR=/nonstandard/htslib
cd bamcmp/
make

Usage

bamcmp -n -1 ABC_human.bam -2 ABC_mouse.bam -a ABC_humanOnly.bam  
-A ABC_humanBetter.bam -b ABC_mouseOnly.bam -B ABC_mouseBetter.bam –C
ABC_humanLoss.bam -D ABC_mouseLoss.bam -s [as/match/mapq/balwayswins].

Citation

Garima Khandelwal, Maria Girotti, Christopher Smowton, Sam Taylor, Chris Wirth, Marek Dynowski, Kris Frese, Ged Brady, Deborah Burt, Richard Marais, Crispin Miller. Next-Gen Sequencing Analysis and Algorithms for PDX and CDX Models. Molecular Cancer Research. 2017, 15:8, PMID: 28442585 DOI: 10.1158/1541-7786.MCR-16-0431

License

This project is licensed under GPL-3.0.

bamcmp's People

Contributors

crukmi-computationalbiology avatar mdynowski-crukmi avatar

Stargazers

Darryl Nousome avatar Darly avatar kcao avatar smallworld avatar Joakim Karlsson avatar

Watchers

Jingzhong Xie avatar Jiwoong Kim avatar

Forkers

firekingit

bamcmp's Issues

terminate called after throwing an instance of 'std::logic_error'

Hello,
I installed "bamcmp" and run with this command.

$ bamcmp -1 s1.bam -2 s2.bam -A s1_better.bam -B s2_better.bam
And I got this stdout log.

       bamcmp Copyright (C) 2016 Christopher Smowton

This program comes with ABSOLUTELY NO WARRANTY; for details check LICENSE file.
This is free software, and you are welcome to redistribute it
under certain conditions; check LICENSE file for details.

terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Aborted (core dumped)

I also tried this command, but I got a same result above.
$ bamcmp -n -1 s1.bam -2 s2.bam -a s1_only.bam -b s2_only.bam -A s1_better.bam -B s2_better.bam -C s1_worse.bam -D s2_worse.bam -s match

It would be a great pleasure if you solve this problem.

Thanks,

P.S. I think tool was installed properly, because when I excuted "bamcmp" I got this result.

       bamcmp Copyright (C) 2016 Christopher Smowton

This program comes with ABSOLUTELY NO WARRANTY; for details check LICENSE file.
This is free software, and you are welcome to redistribute it
under certain conditions; check LICENSE file for details.

Usage: bamcmp -1 input1.s/b/cram -2 input2.s/b/cram [-a first_only.xam] [-b second_only.xam] [-A first_better.xam] [-B second_better.xam] [-C first_worse.xam] [-D second_worse.xam] [-t nthreads] [-n | -N] [-s scoring_method]
-n Expect input sorted as per samtools -n (Mixed string / integer ordering, default)
-N Expect input sorted as per Picard / htsjdk name ordering (lexical ordering)
-s match Score hits by the number of bases that match the reference, as given by the CIGAR string and NM / MD attributes (default)
-s as Score hits according to the AS attribute written by some aligners
-s mapq Score hits according to the MAPQ SAM field
-s balwayswins Always award hits to input B, regardless of alignment scores (equivalent to filtering A by any read mapped in B)

How to install Bamcmp in a modularized HPC environment

Not sure if this is the correct place to ask this but I'm in need of instruction on how to install this software in our HPC. I've setup the folder structure and modified the Makefile as I thought was needed to reflect the install location but constantly get errors trying to compile.

/usr/bin/ld: cannot find -lhts
collect2: error: ld returned 1 exit status
make: *** [bamcmp] Error 1

Here's my Makefile mods:

bamcmp Makefile

ifndef HTSLIBDIR
HTSLIBDIR=/apps/htslib/1.13/
endif

CC=gcc
CFLAGS=-g -Wall-fexceptions
CPP=g++
CPPFLAGS=-g -Wall -fexceptions
LDFLAG=-g
LDLIBS=hts

SRCDIR=/apps/bamcmp/2.2/src/src/
INCDIR=/apps/bamcmp/2.2/src/include/
BUILDDIR=/apps/bamcmp/2.2/src/build/
SRCS=SamReader.cpp BamRecVector.cpp HTSFileWrapper.cpp util.cpp bamcmp.cpp
OBJS=$(BUILDDIR)SamReader.o $(BUILDDIR)BamRecVector.o
$(BUILDDIR)HTSFileWrapper.o $(BUILDDIR)util.o $(BUILDDIR)bamcmp.o

bamcmp: ${OBJS} $(BUILDDIR)
$(CPP) $(LDFLAGS) -o $(BUILDDIR)/bamcmp $(OBJS) -L $(HTSLIBDIR) -l $(LDLIBS) -Wl,-rpath,/apps/bamcmp/2.2/

$(BUILDDIR)%.o: $(SRCDIR)%.cpp $(BUILDDIR)
$(CPP) $(CPPFLAGS) -I $(INCDIR) -I $(HTSLIBDIR)/include -o $@ -c $<

$(BUILDDIR):
mkdir $(BUILDDIR)

clean:
rm -f $(OBJS) $(BUILDIR)/bamcmp

Since we use a modularize app environment, I have to load the htslib library beforehand.

[username@servername src]$ module list
Currently Loaded Modulefiles:

gcc/8.2.0 2) slurm/18.08.9 3) htslib/1.13
If I do not load it, I get:

[username@servername src]$ make
g++ -g -Wall -fexceptions -I /apps/bamcmp/2.2/src/include/ -I /apps/htslib/1.13//include -o /apps/bamcmp/2.2/src/build/SamReader.o -c /apps/bamcmp/2.2/src/src/SamReader.cpp
In file included from /apps/bamcmp/2.2/src/src/SamReader.cpp:21:
/apps/bamcmp/2.2/src/include/SamReader.h:5:10: fatal error: htslib/sam.h: No such file or directory
#include <htslib/sam.h>
^~~~~~~~~~~~~~
compilation terminated.
make: *** [/apps/bamcmp/2.2/src/build/SamReader.o] Error 1

So it should be available to the complier in my thinking. Again, I'm fairly new at installing apps in this type of environment.

I definitely don't know what I'm doing and wondered if anyone could help?

Thanks.

Cannot finish installation

Hello!
I am trying to install bamcmp and keep running into this error:

src/bamcmp.cpp: In function ‘uint32_t get_alignment_score(bam1_t*, bool)’:
src/bamcmp.cpp:100:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < rec->core.n_cigar; ++i)

this are the commands after doing make:
mkdir build/
g++ -g -Wall -fexceptions -I include/ -I /home/ec2-user/miniconda2/pkgs/htslib-1.9-hc238db4_4/include -o build/SamReader.o -c src/SamReader.cpp
g++ -g -Wall -fexceptions -I include/ -I /home/ec2-user/miniconda2/pkgs/htslib-1.9-hc238db4_4/include -o build/BamRecVector.o -c src/BamRecVector.cpp
g++ -g -Wall -fexceptions -I include/ -I /home/ec2-user/miniconda2/pkgs/htslib-1.9-hc238db4_4/include -o build/HTSFileWrapper.o -c src/HTSFileWrapper.cpp
g++ -g -Wall -fexceptions -I include/ -I /home/ec2-user/miniconda2/pkgs/htslib-1.9-hc238db4_4/include -o build/util.o -c src/util.cpp
g++ -g -Wall -fexceptions -I include/ -I /home/ec2-user/miniconda2/pkgs/htslib-1.9-hc238db4_4/include -o build/bamcmp.o -c src/bamcmp.cpp
src/bamcmp.cpp: In function ‘uint32_t get_alignment_score(bam1_t*, bool)’:
src/bamcmp.cpp:100:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < rec->core.n_cigar; ++i)
~~^~~~~~~~~~~~~~~~~~~
g++ -o build//bamcmp build/SamReader.o build/BamRecVector.o build/HTSFileWrapper.o build/util.o build/bamcmp.o -L /home/ec2-user/miniconda2/pkgs/htslib-1.9-hc238db4_4/lib -l hts

Then it just stops without installing anything.
Any thoughts on what may be happening?
Thank you!
Daiana

Minimum System Requirements

Could you recommend a minimum system requirements for bamcmp?
The important information included operating systems, memory, CPU cores number and storage.
Looking forward to your reply, thanks.

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.