Skip to content

Commit

Permalink
First Working commit of FastRemap implementation to the SAFARI reposi…
Browse files Browse the repository at this point in the history
…tory
  • Loading branch information
jeremiek committed Nov 6, 2021
1 parent c327b83 commit 86e5f66
Show file tree
Hide file tree
Showing 21 changed files with 1,722 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "zlib"]
path = zlib
url = https://github.com/madler/zlib
ignore = dirty
[submodule "seqan2"]
path = seqan2
url = https://github.com/seqan/seqan
ignore = dirty
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CC = g++
SRCDIR = src
SRCEXT = cpp
OBJEXT = o
BUILDDIR = build
LDFLAGS = -L./zlib -lz -lpthread
CFLAGS = -c -O3 -Wall -std=c++2a -pthread -I ./seqan2/include -I./seqan2/include -I./zlib -DSEQAN_HAS_ZLIB=1
SOURCES = $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))


OBJECTS = $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))
OBJECTS = $(SOURCES:.cpp=.o)

EXECUTABLE = bin/FastRemap

$(EXECUTABLE): $(OBJECTS)
$(CC) -std=c++11 $(OBJECTS) -o $@ $(LDFLAGS)
cp bin/FastRemap ./

.cpp.o:
$(CC) $(CFLAGS) $< -o $@

clean:
rm -f $(BUILDDIR)/*.o $(SRCDIR)/*.o bin/FastRemap

45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# FastRemap
A tool for quickly remapping reads between genome assemblies
# FastRemap: A Tool for Quickly Remapping Reads between Genome Assemblies

## FastRemap:
- Currently only supports BAM files as input
- if not using gcc 10 or higher, can use the following library: https://github.com/tcbrindle/span

## To clone:
```
git clone --recurse-submodules git@github.com:CMU-SAFARI/FastRemap.git FastRemap
```

## To compile:
### zlib:
```
FastRemap/zlib$ ./configure
FastRemap/zlib$ make
```

### FastRemap:
may need to use '-lstdc++fs' in LDFLAGS depending on compiler / system.
```
FastRemap$ make
```

## To run:
```
./FastRemap bam [chain file] [input bam file] [unmapped file] [out file]
```
test using the small sample files in test_data folder
- input / output files should be paths relative to the current directory.
- e.g.,
./FastRemap bam test_data/ce6ToCe10.over.chain test_data/little.bam test.unmapped test.out

optional arguments
- --append-tags (-a) to append tags in output bam file
- --mean (-m) to set insert size
- --stdev (-s) to set insert_size_stdev
- --times (-t) to set insert_size_fold

## To validate and compare two bam outputs:
```
python ./validation/compare_outputs.py [input bam file 1] [input bam file 2]
```
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
1 change: 1 addition & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
1 change: 1 addition & 0 deletions seqan2
Submodule seqan2 added at f5f658
33 changes: 33 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_CXX_FLAGS_RELEASE "-O3")

cmake_minimum_required (VERSION 3.4)
project (seqan3_tutorial CXX)
set(CMAKE_CXX_STANDARD 17)

#set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/usr/local/opt/boost\@1.76")
#SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "/usr/local/opt/boost\@1.76/lib")

#set(BOOST_ROOT "/usr/local/opt/boost\@1.76")
#set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS} "/usr/local/opt/boost\@1.76")
#set(Boost_DEBUG 1)
#set(Boost_USE_STATIC_LIBS OFF)
#set(Boost_USE_MULTITHREADED ON)
#set(Boost_USE_STATIC_RUNTIME OFF)
#find_package(Boost COMPONENTS)


# add seqan3 to search path
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../seqan2")

# require seqan3 with a version between >=3.0.0 and <4.0.0
find_package (seqan2 2.0 REQUIRED)

# build app with seqan3
#include_directories(${Boost_INCLUDE_DIR})
add_executable (FastRemap main.cpp utils.cpp mapbam.cpp)
target_link_libraries (FastRemap seqan2::seqan2) # ${Boost_LIBRARIES})

Loading

0 comments on commit 86e5f66

Please sign in to comment.