-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged branch release-0.1.1 into master
- Loading branch information
Showing
14 changed files
with
346 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,98 @@ | ||
sudo: required | ||
dist: trusty | ||
|
||
language: cpp | ||
language: generic | ||
osx_image: xcode8 | ||
|
||
before_install: | ||
install: | ||
############################################################################ | ||
# All the Linux dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ | ||
############################################################################ | ||
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" | ||
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} | ||
|
||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DEBIAN_FRONTEND=noninteractive; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qy; fi | ||
|
||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi | ||
|
||
############################################################################ | ||
# Install CMake | ||
############################################################################ | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
sudo add-apt-repository ppa:george-edison55/cmake-3.x -y; | ||
sudo apt-get update -q; | ||
sudo apt-get upgrade cmake -y; | ||
sudo apt-get install python3 -y; | ||
sudo apt-get upgrade libboost-all-dev -y; | ||
git clone https://github.com/samtools/htslib.git; | ||
cd htslib && autoheader && autoconf && ./configure && make && sudo make install; | ||
CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz"; | ||
mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake; | ||
export PATH=${DEPS_DIR}/cmake/bin:${PATH}; | ||
else | ||
brew outdated cmake || brew upgrade cmake; | ||
fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then | ||
brew update; | ||
brew outdated cmake || upgrade cmake; | ||
|
||
############################################################################ | ||
# Install Boost | ||
############################################################################ | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
BOOST_VERSION=trunk; | ||
BOOST_DIR=${DEPS_DIR}/boost-${BOOST_VERSION}; | ||
BOOST_URL="http://github.com/boostorg/boost.git"; | ||
travis_retry git clone --depth 1 --recursive --quiet ${BOOST_URL} ${BOOST_DIR} || exit 1; | ||
cd ${BOOST_DIR} && ./bootstrap.sh && ./b2 headers; | ||
cd ${BOOST_DIR}/tools/build && ./bootstrap.sh && ./b2 install --prefix=${DEPS_DIR}/b2; | ||
export PATH=${DEPS_DIR}/b2/bin:${PATH}; | ||
fi | ||
|
||
############################################################################ | ||
# Install Python3 | ||
############################################################################ | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
sudo apt-get install python3 -qy; | ||
else | ||
brew install python3; | ||
brew outdated boost || upgrade boost; | ||
fi | ||
|
||
############################################################################ | ||
# Install htslib | ||
############################################################################ | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
git clone https://github.com/samtools/htslib.git; | ||
cd htslib && autoheader && autoconf && ./configure && make && sudo make install; | ||
else | ||
brew tap homebrew/science; | ||
brew install htslib; | ||
fi | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
compiler: gcc | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-6 | ||
env: COMPILER=g++-6 | ||
- os: linux | ||
compiler: clang | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-precise-3.8 | ||
packages: | ||
- clang-3.8 | ||
env: COMPILER=clang++-3.8 | ||
# - os: linux | ||
# compiler: gcc | ||
# addons: | ||
# apt: | ||
# sources: | ||
# - ubuntu-toolchain-r-test | ||
# packages: | ||
# - g++-6 | ||
# env: COMPILER=g++ | ||
# - os: linux | ||
# compiler: clang | ||
# addons: | ||
# apt: | ||
# sources: | ||
# - ubuntu-toolchain-r-test | ||
# - llvm-toolchain-precise-3.8 | ||
# packages: | ||
# - clang-3.8 | ||
# env: COMPILER=clang++ | ||
- os: osx | ||
compiler: clang | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-precise-3.8 | ||
packages: | ||
- clang-3.8 | ||
install: export PATH=/usr/local/clang/bin:$PATH | ||
env: COMPILER=clang++-3.8 | ||
- os: osx | ||
compiler: gcc | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-6 | ||
env: COMPILER=g++-6 | ||
before_install: | ||
- brew install --with-clang llvm | ||
- brew outdated boost || brew upgrade boost | ||
env: COMPILER=clang++ | ||
|
||
before_script: | ||
- cd "${TRAVIS_BUILD_DIR}" | ||
|
||
script: | ||
- ./install.py --compiler=$COMPILER | ||
- ./install.py --compiler=$COMPILER | ||
|
||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) 2016 Daniel Cooke | ||
// Use of this source code is governed by the MIT license that can be found in the LICENSE file. | ||
|
||
#include "ploidy_map.hpp" | ||
|
||
#include <iterator> | ||
|
||
namespace octopus { | ||
|
||
PloidyMap::PloidyMap(unsigned organism) | ||
: organism_ {organism} | ||
{} | ||
|
||
void PloidyMap::set(const ContigName& contig, unsigned ploidy) | ||
{ | ||
contigs_.emplace(contig, ploidy); | ||
} | ||
|
||
void PloidyMap::set(const SampleName& sample, const ContigName& contig, unsigned ploidy) | ||
{ | ||
sample_contigs_[sample].emplace(contig, ploidy); | ||
} | ||
|
||
unsigned PloidyMap::organism() const noexcept | ||
{ | ||
return organism_; | ||
} | ||
|
||
unsigned PloidyMap::operator()(const SampleName& sample, const ContigName& contig) const noexcept | ||
{ | ||
const auto sample_itr = sample_contigs_.find(sample); | ||
if (sample_itr != std::cend(sample_contigs_)) { | ||
const auto contig_itr = sample_itr->second.find(contig); | ||
if (contig_itr != std::cend(sample_itr->second)) { | ||
return contig_itr->second; | ||
} | ||
} else { | ||
const auto contig_itr = contigs_.find(contig); | ||
if (contig_itr != std::cend(contigs_)) { | ||
return contig_itr->second; | ||
} | ||
} | ||
return organism_; | ||
} | ||
|
||
} // namespace octopus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2016 Daniel Cooke | ||
// Use of this source code is governed by the MIT license that can be found in the LICENSE file. | ||
|
||
#ifndef ploidy_map_hpp | ||
#define ploidy_map_hpp | ||
|
||
#include <unordered_map> | ||
|
||
#include "config/common.hpp" | ||
|
||
namespace octopus { | ||
|
||
class PloidyMap | ||
{ | ||
public: | ||
PloidyMap(unsigned organism = 2); | ||
|
||
PloidyMap(const PloidyMap&) = default; | ||
PloidyMap& operator=(const PloidyMap&) = default; | ||
PloidyMap(PloidyMap&&) = default; | ||
PloidyMap& operator=(PloidyMap&&) = default; | ||
|
||
~PloidyMap() = default; | ||
|
||
void set(const SampleName& sample, const ContigName& contig, unsigned ploidy); | ||
void set(const ContigName& contig, unsigned ploidy); | ||
|
||
unsigned organism() const noexcept; | ||
unsigned operator()(const SampleName& sample, const ContigName& contig) const noexcept; | ||
|
||
private: | ||
using ContigPloidyMap = std::unordered_map<ContigName, unsigned>; | ||
|
||
unsigned organism_; | ||
ContigPloidyMap contigs_; | ||
std::unordered_map<SampleName, ContigPloidyMap> sample_contigs_; | ||
}; | ||
|
||
} // namespace octopus | ||
|
||
#endif |
Oops, something went wrong.