Commit 2cb437ea authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 1.2.4

parent b6adc7e6
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -15,17 +15,21 @@ addons:
    packages:
      clang

# NOTE: Currently I commented out testing of python binding on OSX because they do not support
# Python building and I have to provide the tools myself. I could probably install correct pip
# (and maybe python) version myself (homebrew?), however I haven't gotten to that yet.

install:
  - if [ $TRAVIS_OS_NAME == "linux" ]; then sudo apt-get install valgrind; fi
  - sudo -H pip install cython  # Needed to build Python module.
  - if [ $TRAVIS_OS_NAME == "linux" ]; then sudo -H pip install cython; fi  # Needed to build Python module.

before_script:
  # Build C/C++ library and apps.
  - mkdir -p build && cd build && cmake .. && make && cd ..

  # Build Python source distribution and install Edlib from it.
  - cd bindings/python && make sdist && cd ../..
  - sudo -H pip install bindings/python/dist/edlib*.tar.gz
  - if [ $TRAVIS_OS_NAME == "linux" ]; then cd bindings/python && make sdist && cd ../..; fi
  - if [ $TRAVIS_OS_NAME == "linux" ]; then sudo -H pip install bindings/python/dist/edlib*.tar.gz; fi

script:
  # Test C/C++ library.
@@ -37,4 +41,4 @@ script:
  - if [ $TRAVIS_OS_NAME == "linux" ]; then valgrind --quiet --error-exitcode=2 --tool=memcheck --leak-check=full build/bin/runTests 2; fi

  # Test Python module.
  - sudo -H python bindings/python/test.py
  - if [ $TRAVIS_OS_NAME == "linux" ]; then sudo -H python bindings/python/test.py; fi

Dockerfile

0 → 100644
+17 −0
Original line number Diff line number Diff line
FROM alpine

MAINTAINER Martin Sosic <sosic.martin@gmail.com>

WORKDIR ~

# Install needed packages to compile Edlib, then pull it from git repo, compile it,
# move edlib-aligner to bin/ so it can be executed, delete edlib source files and delete all packages
# except for libstdc++ (which is needed for edlib-aligner to run) and bash for convenience, in order to keep docker image small.
RUN apk --no-cache add cmake clang clang-dev make gcc g++ libc-dev linux-headers git libstdc++ bash && \
    git clone -b v1.2.3 https://github.com/Martinsos/edlib.git edlib-git && \
    cd edlib-git && cd build && cmake -D CMAKE_BUILD_TYPE=Release .. && make edlib-aligner && \
    cp bin/edlib-aligner /bin && \
    cd ../.. && rm -r edlib-git && \
    apk del cmake clang clang-dev make gcc g++ libc-dev linux-headers git

CMD ["edlib-aligner"]
+2 −1
Original line number Diff line number Diff line
Edlib
=====
&middot;
[![Latest Github release](https://img.shields.io/github/release/Martinsos/edlib.svg)](https://github.com/Martinsos/edlib/releases/latest)
[![Build status of the master branch on Linux/OSX](https://img.shields.io/travis/Martinsos/edlib/master.svg?label=Linux%20%2F%20OSX%20build)](https://travis-ci.org/Martinsos/edlib)
[![Build status of the master branch on Windows](https://img.shields.io/appveyor/ci/Martinsos/edlib.svg?label=Windows%20build)](https://ci.appveyor.com/project/Martinsos/edlib/branch/master)
[![Chat on Gitter](https://img.shields.io/gitter/room/Martinsos/edlib.svg?colorB=753a88)](https://gitter.im/Martinsos/edlib)
[![Published in Bioinformatics](https://img.shields.io/badge/Published%20in-Bioinformatics-167DA4.svg)](https://doi.org/10.1093/bioinformatics/btw753)
=====

A lightweight and super fast C/C++ library for sequence alignment using [edit distance](https://en.wikipedia.org/wiki/Edit_distance).

+15 −4
Original line number Diff line number Diff line
@@ -39,13 +39,14 @@ int main(int argc, char * const argv[]) {
    bool findStartLocations = false;
    int option;
    int kArg = -1;
    int numRepeats = 1;

    // If "STD" or "EXT", cigar string will be printed. if "NICE" nice representation
    // of alignment will be printed.
    char alignmentFormat[16] = "NICE";

    bool invalidOption = false;
    while ((option = getopt(argc, argv, "m:n:k:f:spl")) >= 0) {
    while ((option = getopt(argc, argv, "m:n:k:f:r:spl")) >= 0) {
        switch (option) {
        case 'm': strcpy(mode, optarg); break;
        case 'n': numBestSeqs = atoi(optarg); break;
@@ -54,6 +55,7 @@ int main(int argc, char * const argv[]) {
        case 's': silent = true; break;
        case 'p': findAlignment = true; break;
        case 'l': findStartLocations = true; break;
        case 'r': numRepeats = atoi(optarg); break;
        default: invalidOption = true;
        }
    }
@@ -77,6 +79,9 @@ int main(int argc, char * const argv[]) {
        fprintf(stderr, "\t-f NICE|CIG_STD|CIG_EXT  Format that will be used to print alignment path,"
                " can be used only with -p. NICE will give visually attractive format, CIG_STD will "
                " give standard cigar format and CIG_EXT will give extended cigar format. [default: NICE]\n");
        fprintf(stderr, "\t-r N  Core part of calculation will be repeated N times."
                " This is useful only for performance measurement, when single execution is too short to measure."
                " [default: 1]\n");
        return 1;
    }
    //-------------------------------------------------------------------------//
@@ -157,9 +162,15 @@ int main(int argc, char * const argv[]) {
    for (int i = 0; i < numQueries; i++) {
        char* query = (*querySequences)[i].data();
        int queryLength = (*querySequences)[i].size();

        // Calculate score
        EdlibAlignResult result = edlibAlign(query, queryLength, target, targetLength,
        EdlibAlignResult result;
        for (int rep = 0; rep < numRepeats; rep++) {  // Redundant repetition, for performance measurements.
            result = edlibAlign(query, queryLength, target, targetLength,
                                edlibNewAlignConfig(k, modeCode, alignTask, NULL, 0));
            if (rep < numRepeats - 1) edlibFreeAlignResult(result);
        }

        scores[i] = result.editDistance;
        endLocations[i] = result.endLocations;
        startLocations[i] = result.startLocations;
+1 −1
Original line number Diff line number Diff line
cdef extern from "edlib.h":
cdef extern from "edlib.h" nogil:

     ctypedef enum EdlibAlignMode: EDLIB_MODE_NW, EDLIB_MODE_SHW, EDLIB_MODE_HW
     ctypedef enum EdlibAlignTask: EDLIB_TASK_DISTANCE, EDLIB_TASK_LOC, EDLIB_TASK_PATH
Loading