[med-svn] [Git][med-team/freebayes][upstream] New upstream version 1.3.9

Andreas Tille (@tille) gitlab at salsa.debian.org
Sun Feb 16 15:03:17 GMT 2025



Andreas Tille pushed to branch upstream at Debian Med / freebayes


Commits:
0829d1e4 by Andreas Tille at 2025-02-16T15:13:02+01:00
New upstream version 1.3.9
- - - - -


16 changed files:

- .github/workflows/ci_test.yml
- .gitmodules
- README.md
- RELEASE-NOTES.md
- contrib/README.md
- − contrib/freebayes/GenotypePriors.cpp
- − contrib/freebayes/GenotypePriors.h
- − contrib/freebayes/alleles.cpp
- − contrib/freebayes/bamfiltertech.cpp
- − contrib/freebayes/dummy.cpp
- − contrib/freebayes/levenshtein.cpp
- guix.scm
- meson.build
- src/AlleleParser.h
- src/BedReader.h
- src/ResultData.h


Changes:

=====================================
.github/workflows/ci_test.yml
=====================================
@@ -9,10 +9,8 @@ jobs:
         os: [ubuntu-latest]
         python-version: [3.8]
     steps:
-    - name: Update ubuntu
-      run: sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+ && sudo apt-get update
     - name: Install dependencies
-      run: sudo apt-get -y -f install samtools bc parallel libvcflib-tools libvcflib-dev fastahack smithwaterman libwfa2-dev
+      run: sudo apt-get -y -f install samtools bc parallel libvcflib-tools libseqlib2 libseqlib-dev libvcflib-dev libfastahack-dev fastahack smithwaterman libwfa2-dev libsimde-dev
     - uses: actions/checkout at v3
     - uses: actions/setup-python at v4
       with:
@@ -49,6 +47,7 @@ jobs:
         install: |
           apt-get update -q -y
           apt-get install -q -y gcc g++ python3.8 python3-pip samtools bc parallel libvcflib-tools libvcflib-dev fastahack smithwaterman
+          apt-get -q -y -f install samtools bc parallel libvcflib-tools libseqlib2 libseqlib-dev libvcflib-dev libfastahack-dev fastahack smithwaterman libwfa2-dev libsimde-dev
           pip install meson ninja
         run: |
           set -x
@@ -59,4 +58,3 @@ jobs:
           ninja -C build/
           # TEST
           meson test --timeout-multiplier 4 --print-errorlogs -C build/
-          


=====================================
.gitmodules
=====================================
@@ -12,4 +12,4 @@
 	url = https://github.com/ekg/fastahack.git
 [submodule "contrib/multichoose"]
 	path = contrib/multichoose
-	url = git at github.com:vcflib/multichoose.git
+	url = https://github.com/vcflib/multichoose.git


=====================================
README.md
=====================================
@@ -3,7 +3,7 @@
 
 
 [![Github-CI](https://github.com/freebayes/freebayes/workflows/CI/badge.svg)](https://github.com/freebayes/freebayes/actions) [![Travis-CI](https://travis-ci.com/freebayes/freebayes.svg?branch=master)](https://travis-ci.com/freebayes/freebayes)
-[![DL](https://anaconda.org/bioconda/freebayes/badges/downloads.svg)](https://anaconda.org/bioconda/freebayes) [![BrewBadge](https://img.shields.io/badge/%F0%9F%8D%BAbrew-freebayes-brightgreen.svg)](https://github.com/brewsci/homebrew-bio) [![GuixBadge](https://img.shields.io/badge/gnuguix-freebayes-brightgreen.svg)](https://packages.guix.gnu.org/packages/freebayes/) [![DebianBadge](https://badges.debian.net/badges/debian/testing/freebayes/version.svg)](https://packages.debian.org/testing/freebayes) [![Chat on Matrix](https://matrix.to/img/matrix-badge.svg)](https://matrix.to/#/#vcflib:matrix.org)
+[![DL](https://anaconda.org/bioconda/freebayes/badges/downloads.svg)](https://anaconda.org/bioconda/freebayes) [![BrewBadge](https://img.shields.io/badge/%F0%9F%8D%BAbrew-freebayes-brightgreen.svg)](https://github.com/brewsci/homebrew-bio) [![GuixBadge](https://img.shields.io/badge/gnuguix-freebayes-brightgreen.svg)](https://packages.guix.gnu.org/packages/freebayes/) [![DebianBadge](https://badges.debian.net/badges/debian/testing/freebayes/version.svg)](https://tracker.debian.org/pkg/freebayes) [![Chat on Matrix](https://matrix.to/img/matrix-badge.svg)](https://matrix.to/#/#vcflib:matrix.org)
 --------
 
 ## Overview
@@ -469,7 +469,7 @@ On Debian you'll need a gcc compiler and want packages:
 - meson
 - ninja-build
 - libvcflib-tools
-- vcftools
+- vcftools (or vcflib)
 
 Build dependencies are listed in [guix.scm](./guix.scm) and
 [travis](.travis.yml). Builds have been tested with gcc 7 and clang 9.
@@ -517,4 +517,4 @@ container with all the build tools with
 
     guix shell -C -D -f guix.scm
 
-See also [guix.scm](./guix.scm).
+See also the header of [guix.scm](./guix.scm).


=====================================
RELEASE-NOTES.md
=====================================
@@ -4,6 +4,16 @@ see
 and
 [commits](https://github.com/freebayes/freebayes/commits/master).
 
+## ChangeLog v1.3.9 (20250215)
+
+This is a maintenance release of Freebayes:
+
++ again fixes for Debian and Ubuntu
++ github actions should clear with newer vcflib
++ try cleaner meson build on Debian
++ A recent version of vcflib installs include files in include/vcflib. freebayes breaks with older vcflib.
++ Removed unused GenotypePriors.cpp, alleles.cpp, dummy.cpp
+
 ## ChangeLog v1.3.8 (20240423)
 
 This is a maintenance release of Freebayes:


=====================================
contrib/README.md
=====================================
@@ -1,19 +1,41 @@
 # Contrib
 
-This directory contains (stripped down) editions of projects that are
-no longer actively maintained.
+This directory contains (stripped down) editions of projects that are not really actively maintained.
 
-The goal is to have a clean repository of files that are in (active)
-use for freebayes.
+The goal is to have a clean repository of files that are in (active) use for freebayes.
 
-## Htslib
+## fastahack
 
-Freebayes has a submodule for htslib CRAM/BAM reading
+libfastahack-dev is in Debian. This is actually a vcflib dependency that can be removed when vcflib moves fastahack out of its libvcflib.so (Variant.h)
+
+## SmithWaterman
+
+libsmithwaterman-dev is in Debian. This is actually a vcflib dependency that can be removed when vcflib moves SW out of its libvcflib.so (Variant.h)
+
+## vcflib
+
+libvcflib-dev is in Debian.
+
+## tabixpp
+
+libtabixpp-dev is in Debian.
+
+## htslib
+
+htslib is in Debian. To do a local build we have some prepared include files in contrib/htslib
 
 ## SeqLib
 
-A subset of SeqLib is included that is patched for ARM64 using simde
+SeqLib sources are included for Guix. Should upstream that.
+
+A subset of SeqLib was included that was patched for ARM64 using simde
 in ssw.c:
 
     #define SIMDE_ENABLE_NATIVE_ALIASES
     #include <simde/x86/sse2.h>
+
+I think the default simde is fine now and we no longer uses this submodule.
+
+## ttmath
+
+A few big double operations are included. The code gives warnings, but the newer version of ttmath does not solve that. We should look at using another library instead.


=====================================
contrib/freebayes/GenotypePriors.cpp deleted
=====================================
@@ -1,188 +0,0 @@
-#include "GenotypePriors.h"
-
-/*
-long double alleleFrequencyProbability(const map<int, int>& alleleFrequencyCounts, long double theta) {
-
-    int M = 0;
-    long double p = 1;
-
-    for (map<int, int>::const_iterator f = alleleFrequencyCounts.begin(); f != alleleFrequencyCounts.end(); ++f) {
-        int frequency = f->first;
-        int count = f->second;
-        M += frequency * count;
-        p *= (double) pow((double) theta, (double) count) / (double) pow((double) frequency, (double) count) * factorial(count);
-    }
-
-    long double thetaH = 1;
-    for (int h = 1; h < M; ++h)
-        thetaH *= theta + h;
-
-    return factorial(M) / (theta * thetaH) * p;
-
-}
-
-AlleleFrequencyProbabilityCache alleleFrequencyProbabilityCache;
-
-long double alleleFrequencyProbabilityln(const map<int, int>& alleleFrequencyCounts, long double theta) {
-    return alleleFrequencyProbabilityCache.alleleFrequencyProbabilityln(alleleFrequencyCounts, theta);
-}
-
-// Implements Ewens' Sampling Formula, which provides probability of a given
-// partition of alleles in a sample from a population
-long double __alleleFrequencyProbabilityln(const map<int, int>& alleleFrequencyCounts, long double theta) {
-
-    int M = 0; // multiplicity of site
-    long double p = 0;
-    long double thetaln = log(theta);
-
-    for (map<int, int>::const_iterator f = alleleFrequencyCounts.begin(); f != alleleFrequencyCounts.end(); ++f) {
-        int frequency = f->first;
-        int count = f->second;
-        M += frequency * count;
-        p += powln(thetaln, count) - powln(log(frequency), count) + factorialln(count);
-    }
-
-    long double thetaH = 0;
-    for (int h = 1; h < M; ++h)
-        thetaH += log(theta + h);
-
-    return factorialln(M) - (thetaln + thetaH) + p;
-
-}
-*/
-
-
-long double probabilityGenotypeComboGivenAlleleFrequencyln(GenotypeCombo& genotypeCombo, Allele& allele) {
-
-    int n = genotypeCombo.numberOfAlleles();
-    long double lnhetscalar = 0;
-
-    for (GenotypeCombo::iterator gc = genotypeCombo.begin(); gc != genotypeCombo.end(); ++gc) {
-        SampleDataLikelihood& sgp = **gc;
-        if (!sgp.genotype->homozygous) {
-            lnhetscalar += multinomialCoefficientLn(sgp.genotype->ploidy, sgp.genotype->counts());
-        }
-    }
-
-    return lnhetscalar - multinomialCoefficientLn(n, genotypeCombo.counts());
-
-}
-
-
-// core calculation of genotype combination likelihoods
-//
-GenotypeComboResult
-genotypeCombinationPriorProbability(
-        GenotypeCombo* combo,
-        Allele& refAllele,
-        long double theta,
-        bool pooled,
-        bool binomialObsPriors,
-        bool alleleBalancePriors,
-        long double diffusionPriorScalar) {
-
-        // when we are operating on pooled samples, we will not be able to
-        // ascertain the number of heterozygotes in the pool,
-        // rendering P(Genotype combo | Allele frequency) meaningless
-        long double priorProbabilityOfGenotypeComboG_Af = 0;
-        if (!pooled) {
-            priorProbabilityOfGenotypeComboG_Af = probabilityGenotypeComboGivenAlleleFrequencyln(*combo, refAllele);
-        }
-
-        long double priorObservationExpectationProb = 0;
-
-        if (binomialObsPriors) {
-            // for each alternate and the reference allele
-            // calculate the binomial probability that we see the given strand balance and read placement prob
-            vector<string> alleles = combo->alleles();
-            // cerr << *combo << endl;
-            for (vector<string>::iterator a = alleles.begin(); a != alleles.end(); ++a) {
-                const string& allele = *a;
-                map<string, AlleleCounter>::iterator ac = combo->alleleCounters.find(allele);
-                if (ac != combo->alleleCounters.end()) {
-                    const AlleleCounter& alleleCounter = ac->second;
-                    int obs = alleleCounter.observations;
-                    /*
-                    cerr << allele <<  " counts: " << alleleCounter.frequency
-                        << " observations " << alleleCounter.observations
-                        << " " << alleleCounter.forwardStrand
-                        << "," << alleleCounter.reverseStrand
-                        << " " << alleleCounter.placedLeft
-                        << "," << alleleCounter.placedRight
-                        << " " << alleleCounter.placedStart
-                        << "," << alleleCounter.placedEnd
-                        << endl;
-                    cerr << "priorObservationExpectationProb = " << priorObservationExpectationProb << endl;
-                    cerr << "binprobln strand = " << binomialProbln(alleleCounter.forwardStrand, obs, 0.5) << endl;
-                    cerr << "binprobln position = " << binomialProbln(alleleCounter.placedLeft, obs, 0.5) << endl;
-                    cerr << "binprobln start = " << binomialProbln(alleleCounter.placedStart, obs, 0.5) << endl;
-                    cerr << "priorObservationExpectationProb = " << priorObservationExpectationProb << endl;
-                    */
-
-                    priorObservationExpectationProb
-                        += binomialProbln(alleleCounter.forwardStrand, obs, 0.5)
-                        +  binomialProbln(alleleCounter.placedLeft, obs, 0.5)
-                        +  binomialProbln(alleleCounter.placedStart, obs, 0.5);
-
-                }
-            }
-            // ok... now do the same move for the observation counts
-            // --- this should capture "Allele Balance"
-        }
-
-        if (alleleBalancePriors) {
-            priorObservationExpectationProb += multinomialSamplingProbLn(combo->alleleProbs(), combo->observationCounts());
-        }
-
-        // with larger population samples, the effect of 
-        // P(Genotype combo | Allele frequency) may bias us against reporting
-        // true variants which are under selection despite overwhelming evidence
-        // for variation.  this allows us to scale the effect of this prior
-        if (diffusionPriorScalar != 1) {
-            priorProbabilityOfGenotypeComboG_Af /= diffusionPriorScalar;
-        }
-
-        // Ewens' Sampling Formula
-        long double priorProbabilityOfGenotypeComboAf = 
-            alleleFrequencyProbabilityln(combo->countFrequencies(), theta);
-        long double priorProbabilityOfGenotypeCombo = 
-            priorProbabilityOfGenotypeComboG_Af + priorProbabilityOfGenotypeComboAf;
-        long double priorComboProb = priorProbabilityOfGenotypeCombo + combo->prob + priorObservationExpectationProb;
-
-        return GenotypeComboResult(combo,
-                    priorComboProb,
-                    combo->prob,
-                    priorProbabilityOfGenotypeCombo,
-                    priorProbabilityOfGenotypeComboG_Af,
-                    priorProbabilityOfGenotypeComboAf,
-                    priorObservationExpectationProb);
-
-}
-
-void
-genotypeCombinationsPriorProbability(
-        vector<GenotypeComboResult>& genotypeComboProbs,
-        vector<GenotypeCombo>& bandedCombos,
-        Allele& refAllele,
-        long double theta,
-        bool pooled,
-        bool binomialObsPriors,
-        bool alleleBalancePriors,
-        long double diffusionPriorScalar) {
-
-    for (vector<GenotypeCombo>::iterator c = bandedCombos.begin(); c != bandedCombos.end(); ++c) {
-
-        GenotypeCombo* combo = &*c;
-
-        genotypeComboProbs.push_back(
-                genotypeCombinationPriorProbability(
-                    combo,
-                    refAllele,
-                    theta,
-                    pooled,
-                    binomialObsPriors,
-                    alleleBalancePriors,
-                    diffusionPriorScalar));
-
-    }
-}


=====================================
contrib/freebayes/GenotypePriors.h deleted
=====================================
@@ -1,54 +0,0 @@
-#ifndef __GENOTYPE_PRIORS_H
-#define __GENOTYPE_PRIORS_H
-
-#include <map>
-#include "Allele.h"
-#include "Genotype.h"
-#include "Multinomial.h"
-#include "CNV.h"
-#include "Utility.h"
-
-using namespace std;
-
-map<Allele, int> countAlleles(vector<Genotype*>& genotypeCombo);
-map<int, int> countFrequencies(vector<Genotype*>& genotypeCombo);
-long double alleleFrequencyProbability(const map<int, int>& alleleFrequencyCounts, long double theta);
-long double alleleFrequencyProbabilityln(const map<int, int>& alleleFrequencyCounts, long double theta);
-long double __alleleFrequencyProbabilityln(const map<int, int>& alleleFrequencyCounts, long double theta);
-long double probabilityGenotypeComboGivenAlleleFrequencyln(GenotypeCombo& genotypeCombo, Allele& allele);
-
-class AlleleFrequencyProbabilityCache : public map<map<int, int>, long double> {
-public:
-    long double alleleFrequencyProbabilityln(const map<int, int>& counts, long double theta) {
-        map<map<int, int>, long double>::iterator p = find(counts);
-        if (p == end()) {
-            long double pln = __alleleFrequencyProbabilityln(counts, theta);
-            insert(make_pair(counts, pln));
-            return pln;
-        } else {
-            return p->second;
-        }
-    }
-};
-
-GenotypeComboResult
-genotypeCombinationsPriorProbability(
-        GenotypeCombo* combo,
-        Allele& refAllele,
-        long double theta,
-        bool pooled,
-        bool obsBinomialPriors,
-        bool alleleBalancePriors,
-        long double diffusionPriorScalarln);
-
-void genotypeCombinationsPriorProbability(
-        vector<GenotypeComboResult>& genotypeComboProbs,
-        vector<GenotypeCombo>& bandedCombos,
-        Allele& refAllele,
-        long double theta,
-        bool pooled,
-        bool obsBinomialPriors,
-        bool alleleBalancePriors,
-        long double diffusionPriorScalarln);
-
-#endif


=====================================
contrib/freebayes/alleles.cpp deleted
=====================================
@@ -1,92 +0,0 @@
-// alleles.cpp
-// outputs a json-formatted stream of alleles over target regions
-//
-// Erik Garrison <erik.garrison at bc.edu>
-// Marth Lab, Boston College
-// July 14, 2010
-//
-// standard includes
-//#include <cstdio>
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <vector>
-#include <map>
-#include <iterator>
-#include <algorithm>
-#include <cmath>
-#include <time.h>
-
-// private libraries
-#include "BamReader.h"
-#include "Fasta.h"
-#include "TryCatch.h"
-#include "Parameters.h"
-#include "Allele.h"
-#include "AlleleParser.h"
-#include "split.h"
-
-#include "multichoose.h"
-#include "multipermute.h"
-
-using namespace std; 
-
-// Allele object recycling:
-//
-// We use the Allele freelist for performance reasons.  When an Allele object
-// is destroyed, it is pushed onto this freelist.  When a new Allele object is
-// created, new first checks if we have a free Allele object on the freelist.
-// Because we are dynamically linked, we have to declare the freelist here,
-// although it exists as a static member of the Allele class.
-//
-AlleleFreeList Allele::_freeList;
-
-int main (int argc, char *argv[]) {
-
-    AlleleParser* parser = new AlleleParser(argc, argv);
-    list<Allele*> alleles;
-
-    int allowedAlleleTypes = ALLELE_REFERENCE | ALLELE_SNP | ALLELE_INSERTION | ALLELE_DELETION;
-
-    map<string, vector<Allele*> > sampleGroups;
-
-    while (parser->getNextAlleles(sampleGroups, allowedAlleleTypes)) {
-
-        int coverage = countAlleles(sampleGroups);
-
-        // skips 0-coverage regions
-        if (coverage == 0)
-            continue;
-
-        // report in json-formatted stream
-        //
-        cout << "{\"sequence\":\"" << parser->currentTarget->seq << "\","
-            << "\"total coverage\":" << coverage << ","
-            << "\"position\":" << parser->currentPosition + 1 << ","  /// XXX basing somehow is 1-off... 
-            << "\"reference base\":\"" << parser->currentReferenceBase << "\","
-            //<< "\"raDepth\":" << parser->registeredAlleles.size() << ","
-            << "\"samples\":{";  // TODO ... quality (~pSnp)
-
-        bool suppressComma = true; // output flag
-        for (map<string, vector<Allele*> >::iterator 
-                sample = sampleGroups.begin();
-                sample != sampleGroups.end(); ++sample) {
-
-            if (!suppressComma) { cout << ","; } else { suppressComma = false; }
-
-            cout << "\"" << sample->first << "\":{"
-                << "\"coverage\":" << sample->second.size()
-                << ",\"alleles\":" << tojson(sample->second)
-                << "}";
-
-        }
-
-        cout << "}}" << endl;
-
-    }
-
-    delete parser;
-
-    return 0;
-
-}


=====================================
contrib/freebayes/bamfiltertech.cpp deleted
=====================================
@@ -1,109 +0,0 @@
-#include <iostream>
-#include <getopt.h>
-#include <fstream>
-#include <iostream>
-#include <sstream>
-#include <signal.h>
-#include <stdlib.h>
-#include <cmath>
-#include <algorithm>
-#include <map>
-
-#include "BamAlignment.h"
-#include "BamReader.h"
-#include "BamWriter.h"
-
-#include "split.h"
-
-using namespace std;
-using namespace BamTools;
-
-int main(int argc, char** argv) {
-
-    if (argc == 1) {
-        cerr << "usage: " << argv[0] << " [technology name] [ [technology name] ... ]" << endl;
-        cerr << "filters BAM file piped on stdin for reads generated by a sequencing technology listed on the command line" << endl;
-        return 1;
-    }
-
-    map<string, bool> technologies;
-
-    for (int i = 1; i < argc; ++i) {
-        technologies[argv[i]] = true;
-    }
-
-    BamReader reader;
-    if (!reader.Open("stdin")) {
-        cerr << "Could not open stdin for reading" << endl;
-        return 1;
-    }
-
-    // retrieve header information
-    map<string, string> readGroupToTechnology;
-
-    string bamHeader = reader.GetHeaderText();
-
-    vector<string> headerLines = split(bamHeader, '\n');
-
-    for (vector<string>::const_iterator it = headerLines.begin(); it != headerLines.end(); ++it) {
-
-        // get next line from header, skip if empty
-        string headerLine = *it;
-        if ( headerLine.empty() ) { continue; }
-
-        // lines of the header look like:
-        // "@RG     ID:-    SM:NA11832      CN:BCM  PL:454"
-        //                     ^^^^^^^\ is our sample name
-        if ( headerLine.find("@RG") == 0 ) {
-            vector<string> readGroupParts = split(headerLine, "\t ");
-            string tech;
-            string readGroupID;
-            for (vector<string>::const_iterator r = readGroupParts.begin(); r != readGroupParts.end(); ++r) {
-                vector<string> nameParts = split(*r, ":");
-                if (nameParts.at(0) == "PL") {
-                   tech = nameParts.at(1);
-                } else if (nameParts.at(0) == "ID") {
-                   readGroupID = nameParts.at(1);
-                }
-            }
-            if (tech.empty()) {
-                cerr << " could not find PL: in @RG tag " << endl << headerLine << endl;
-                return 1;
-            }
-            if (readGroupID.empty()) {
-                cerr << " could not find ID: in @RG tag " << endl << headerLine << endl;
-                return 1;
-            }
-            //string name = nameParts.back();
-            //mergedHeader.append(1, '\n');
-            //cerr << "found read group id " << readGroupID << " containing sample " << name << endl;
-            readGroupToTechnology[readGroupID] = tech;
-        }
-    }
-
-    // open writer, uncompressed BAM
-    BamWriter writer;
-    bool writeUncompressed = true;
-    if ( !writer.Open("stdout", bamHeader, reader.GetReferenceData(), writeUncompressed) ) {
-        cerr << "Could not open stdout for writing." << endl;
-        return 1;
-    }
-
-    BamAlignment alignment;
-
-    while (reader.GetNextAlignment(alignment)) {
-        string name;
-        if (alignment.GetTag("RG", name)) {
-            if (technologies.find(readGroupToTechnology[name]) != technologies.end()) {
-                //cout << name << " "  << readGroupToTechnology[name] << endl;
-                writer.SaveAlignment(alignment);
-            }
-        }
-    }
-
-    reader.Close();
-    writer.Close();
-
-    return 0;
-
-}


=====================================
contrib/freebayes/dummy.cpp deleted
=====================================
@@ -1,46 +0,0 @@
-// alleles.cpp
-// outputs a json-formatted stream of alleles over target regions
-//
-// Erik Garrison <erik.garrison at bc.edu>
-// Marth Lab, Boston College
-// July 14, 2010
-//
-// standard includes
-//#include <cstdio>
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <vector>
-#include <map>
-#include <iterator>
-#include <algorithm>
-#include <cmath>
-#include <time.h>
-
-// private libraries
-#include "BamReader.h"
-#include "Fasta.h"
-#include "TryCatch.h"
-#include "Parameters.h"
-#include "Allele.h"
-#include "AlleleParser.h"
-
-#include "multichoose.h"
-#include "multipermute.h"
-
-using namespace std; 
-
-AlleleFreeList Allele::_freeList;
-
-int main (int argc, char *argv[]) {
-
-    AlleleParser* parser = new AlleleParser(argc, argv);
-
-    while (parser->dummyProcessNextTarget()) {
-    }
-
-    delete parser;
-
-    return 0;
-
-}


=====================================
contrib/freebayes/levenshtein.cpp deleted
=====================================
@@ -1,93 +0,0 @@
-// Levenshtein Distance Algorithm: C++ Implementation
-// by Anders Sewerin Johansen
-// http://www.merriampark.com/ldcpp.htm
-
-#include <string>
-#include <vector>
-
-int levenshteinDistance(const std::string source, const std::string target) {
-
-  // Step 1
-
-  const int n = source.length();
-  const int m = target.length();
-  if (n == 0) {
-    return m;
-  }
-  if (m == 0) {
-    return n;
-  }
-
-  // Good form to declare a TYPEDEF
-
-  typedef std::vector< std::vector<int> > Tmatrix; 
-
-  Tmatrix matrix(n+1);
-
-  // Size the vectors in the 2.nd dimension. Unfortunately C++ doesn't
-  // allow for allocation on declaration of 2.nd dimension of vec of vec
-
-  for (int i = 0; i <= n; i++) {
-    matrix[i].resize(m+1);
-  }
-
-  // Step 2
-
-  for (int i = 0; i <= n; i++) {
-    matrix[i][0]=i;
-  }
-
-  for (int j = 0; j <= m; j++) {
-    matrix[0][j]=j;
-  }
-
-  // Step 3
-
-  for (int i = 1; i <= n; i++) {
-
-    const char s_i = source[i-1];
-
-    // Step 4
-
-    for (int j = 1; j <= m; j++) {
-
-      const char t_j = target[j-1];
-
-      // Step 5
-
-      int cost;
-      if (s_i == t_j) {
-        cost = 0;
-      }
-      else {
-        cost = 1;
-      }
-
-      // Step 6
-
-      const int above = matrix[i-1][j];
-      const int left = matrix[i][j-1];
-      const int diag = matrix[i-1][j-1];
-      const int cell = min( above + 1, min(left + 1, diag + cost));
-
-      // Step 6A: Cover transposition, in addition to deletion,
-      // insertion and substitution. This step is taken from:
-      // Berghel, Hal ; Roach, David : "An Extension of Ukkonen's 
-      // Enhanced Dynamic Programming ASM Algorithm"
-      // (http://www.acm.org/~hlb/publications/asm/asm.html)
-
-      if (i>2 && j>2) {
-        int trans=matrix[i-2][j-2]+1;
-        if (source[i-2]!=t_j) trans++;
-        if (s_i!=target[j-2]) trans++;
-        if (cell>trans) cell=trans;
-      }
-
-      matrix[i][j]=cell;
-    }
-  }
-
-  // Step 7
-
-  return matrix[n][m];
-}


=====================================
guix.scm
=====================================
@@ -4,7 +4,7 @@
 ;;
 ;; To get a development container
 ;;
-;;   guix shell -C -D -f guix.scm
+;;   guix shell -C -D -F -f guix.scm
 ;;
 ;; For the tests you need /usr/bin/env. Inside the container:
 ;;
@@ -54,8 +54,9 @@
     (build-system meson-build-system)
     (propagated-inputs
      `(
+       ;; for the libs also see contrib/README.md
        ("bzip2-static" ,bzip2 "static")    ; libz2 part of htslib for static builds
-       ;; ("fastahack" ,fastahack) ; bundle for Debian
+       ("fastahack" ,fastahack) ; shared lib used by vcflib; bundle for Debian
        ("grep" ,grep)          ; for testing
        ("htslib" ,htslib)      ; does work, but lacks codecs
        ("intervaltree" ,intervaltree)
@@ -63,10 +64,10 @@
        ("python" ,python)      ; for testing
        ("samtools" ,samtools)  ; for testing
        ("simde" ,simde)
-       ;; ("smithwaterman" ,smithwaterman) ; bundle for Debian
+       ("smithwaterman" ,smithwaterman) ; vcflib shared lib dependency ; bundle for Debian
        ("tabixpp" ,tabixpp)    ; for htslib
        ("vcflib" ,vcflib)      ; for testing freebayes-parallel
-       ("wfa2-lib" ,wfa2-lib)  ; vcflib dependency
+       ("wfa2-lib" ,wfa2-lib)  ; vcflib shared lib dependency
        ("which" ,which)        ; for version
        ("xz-static" ,xz "static")     ; for static builds
        ("zlib-static" ,zlib "static")))


=====================================
meson.build
=====================================
@@ -3,19 +3,18 @@
 #     meson --buildtype [debug|release] [--default-library static] build/
 #     meson test -C build /
 #
-# Meson builds with locally installed htslib, vcflib, tabixpp and seqlib.
-# If one is missing it should pick up the sources from git submodules.
-#
-# to compile htslib with local sources use
+# To compile with local git module sources use
 #
 #     meson build -Dprefer_system_deps=false
 #
 # to build static binary for release
 #
 #     meson build -Dstatic=true -Dprefer_system_deps=false --buildtype release
+#
+# See also meson_options.txt and contrib/README.md
 
 project('freebayes', ['cpp', 'c'],
-        version : '1.3.8',
+        version : '1.3.9',
         default_options : ['warning_level=1', 'cpp_std=c++17', 'optimization=3'])
 static_build = get_option('static')
 
@@ -25,172 +24,85 @@ cc = meson.get_compiler('cpp')
 
 # fastahack_dep = cc.find_library('libfastahack')
 lzma_dep = dependency('liblzma', static: static_build)
-seqlib_dep = dependency('libseqlib', static: static_build, required: false)
-# smithwaterman_dep = cc.find_library('libsmithwaterman')
-tabixpp_dep = cc.find_library('tabixpp', required: false, static: static_build)
 thread_dep = dependency('threads', static: static_build)
-vcflib_dep = cc.find_library('libvcflib')
-wfa2lib_dep = cc.find_library('libwfa2')
+wfa2lib_dep = cc.find_library('libwfa2') # need to link for vcflib code
 zlib_dep = dependency('zlib', static: static_build)
+htslib_dep = dependency('htslib', static: static_build, required: false)
+vcflib_dep = cc.find_library('libvcflib', required: false)
+seqlib_dep = dependency('libseqlib', static: static_build, required: false)
+tabixpp_dep = cc.find_library('tabixpp', required: false, static: static_build)
 
-# to compile htslib use
-#   meson build -Dprefer_system_deps=false
-# otherwise it tries to pick up the local system libs
-if get_option('prefer_system_deps')
-  htslib_dep = dependency('htslib', static: static_build, required: false)
+# later versions of vcflib have Variant.hpp in a system subdirectory
+fs = import('fs')
+if fs.is_dir('/usr/include/vcflib')
+  message('Using /usr/include/vcflib dir')
+  vcflib_inc = include_directories('/usr/include/vcflib')
 else
-  # uses the local git submodules
-  htslib_dep = dependency('', required : false)
-  tabixpp_dep = dependency('', required : false)
-  vcflib_dep = dependency('', required : false)
-  seqlib_dep = dependency('', required : false)
+  vcflib_inc = files()
 endif
 
-# for setting a warning_level on the external code in custom_* targets below
-warn_quiet = ['warning_level=0']
-
-# We pull in the include files because they are currently not packaged in Debian, note that we expect
-# the share libs nevertheless
-fastahack_inc = include_directories('contrib/fastahack')
-fastahack_src = files(
-    'contrib/fastahack/Fasta.cpp',
-    )
-
-multichoose_inc = include_directories('contrib/multichoose')
-multichoose_src = files(
-    )
 
-smithwaterman_inc = include_directories('contrib/smithwaterman')
-smithwaterman_src = files(
-    'contrib/smithwaterman/SmithWatermanGotoh.cpp',
-    'contrib/smithwaterman/disorder.cpp',
-    'contrib/smithwaterman/Repeats.cpp',
-    'contrib/smithwaterman/LeftAlign.cpp',
-    'contrib/smithwaterman/IndelAllele.cpp',
-    )
+if get_option('prefer_system_deps') # defaults to true, otherwise use git modules and local sources
+  fastahack_dep = cc.find_library('libfastahack', required: true) # also link in for vcflib
+  smithwaterman_dep = cc.find_library('libsmithwaterman')
+  if fs.is_dir('/usr/include/fastahack')
+    message('Using /usr/include/fastahack dir')
+    fastahack_inc = include_directories('/usr/include/fastahack')
+  else
+    fastahack_inc = files()
+  endif
 
-# optionally build from source. As we unbundled just check out the vcflib repo in contrib.
-# note that the build version adds support for lzma and bzip2 in CRAM
-if not htslib_dep.found()
-  htslib_inc = include_directories(
-    'contrib/vcflib/contrib/tabixpp/htslib/',
-    'contrib/htslib_config',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram',
-    )
-  htslib_src = files(
-    'contrib/vcflib/contrib/tabixpp/htslib/tbx.c',      # used by vcflib
-    'contrib/vcflib/contrib/tabixpp/htslib/bgzf.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/sam.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/hts.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/hfile.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/textutils.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/thread_pool.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/region.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/hts_os.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/cram_index.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/cram_io.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/header.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/pooled_alloc.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/string_alloc.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/md5.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/cram_encode.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/cram_stats.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/cram_codecs.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/cram_decode.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/kstring.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/cram_external.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/mFILE.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/faidx.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/hts_expr.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/rANS_static.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/arith_dynamic.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/fqzcomp_qual.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/htscodecs.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/rANS_static.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/tokenise_name3.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/utils.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/cram/open_trace_file.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/multipart.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/rANS_static4x16pr.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/rANS_static32x16pr.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/pack.c',
-    'contrib/vcflib/contrib/tabixpp/htslib/htscodecs/htscodecs/rle.c',
-)
-    htslib_lib = static_library('custom_htslib',
-                                htslib_src,
-                                include_directories : htslib_inc,
-                                override_options : warn_quiet)
-    htslib_dep = declare_dependency(link_with : htslib_lib,
-                                    include_directories : htslib_inc)
 else
-    htslib_inc = []
-endif
-
+  # uses the minimal local git submodules or checkout trees in ./contrib/
+  # see `git submodule`
+  # htslib and vcflib have to come from the underlying distro
+  fastahack_dep = dependency('', required : false)
+
+  fastahack_inc = include_directories('contrib/fastahack')
+  fastahack_src = files(
+      'contrib/fastahack/Fasta.cpp',
+  )
+
+  multichoose_inc = include_directories('contrib/multichoose')
+  multichoose_src = files(
+  )
+
+  smithwaterman_inc = include_directories('contrib/smithwaterman')
+  smithwaterman_src = files(
+      'contrib/smithwaterman/SmithWatermanGotoh.cpp',
+      'contrib/smithwaterman/disorder.cpp',
+      'contrib/smithwaterman/Repeats.cpp',
+      'contrib/smithwaterman/LeftAlign.cpp',
+      'contrib/smithwaterman/IndelAllele.cpp',
+  )
+
+endif # build git modules
 
-if not tabixpp_dep.found()
-    tabixpp_inc = include_directories('contrib/vcflib/contrib/tabixpp/')
-    tabixpp_src = files('contrib/vcflib/contrib/tabixpp/tabix.cpp')
-    tabixpp_lib = static_library('custom_tabixpp',
-                                 tabixpp_src,
-                                 include_directories : [tabixpp_inc, htslib_inc],
-                                 override_options : warn_quiet)
-    tabixpp_dep = declare_dependency(link_with : tabixpp_lib,
-                                     include_directories : tabixpp_inc)
-else
-    tabixpp_inc = []
-endif
-
-vcflib_inc = include_directories()
-
-# optionally build from source. As we unbundled just check out the vcflib repo in contrib.
-if not vcflib_dep.found()
-  vcflib_inc = include_directories(
-    'contrib/vcflib/src',
-    'contrib/vcflib/contrib/smithwaterman',
-    'contrib/vcflib/contrib/multichoose',
-    'contrib/vcflib/contrib/filevercmp',
-    'contrib/vcflib/contrib/fastahack',
-    )
-  vcflib_src = files(
-    'contrib/vcflib/src/Variant.cpp',
-    'contrib/vcflib/src/allele.cpp',
-    'contrib/vcflib/src/cigar.cpp',
-    'contrib/vcflib/src/split.cpp',
-    )
-  vcflib_lib = static_library('custom_vcflib',
-                              vcflib_src,
-                              include_directories : [htslib_inc, tabixpp_inc, vcflib_inc],
-                              override_options : warn_quiet)
-  vcflib_dep = declare_dependency(link_with : vcflib_lib,
-                                  include_directories : vcflib_inc)
-endif
-
-
-if not seqlib_dep.found()
+# for setting a warning_level on the external code in custom_* targets below
+warn_quiet = ['warning_level=0']
 
+if not seqlib_dep.found() # Seqlib is not in Guix (yet) but it is in Debian
   seqlib_inc = include_directories(
-    'contrib',
-    'contrib/SeqLib',
-    )
+      'contrib/SeqLib',
+  )
   seqlib_src = files(
-    'contrib/SeqLib/src/BamReader.cpp',
-    'contrib/SeqLib/src/BamRecord.cpp',
-    'contrib/SeqLib/src/BamHeader.cpp',
-    'contrib/SeqLib/src/BamWriter.cpp',
-    'contrib/SeqLib/src/GenomicRegion.cpp',
-    'contrib/SeqLib/src/ssw_cpp.cpp',
-    'contrib/SeqLib/src/ssw.c',
-    )
+      'contrib/SeqLib/src/BamReader.cpp',
+      'contrib/SeqLib/src/BamRecord.cpp',
+      'contrib/SeqLib/src/BamHeader.cpp',
+      'contrib/SeqLib/src/BamWriter.cpp',
+      'contrib/SeqLib/src/GenomicRegion.cpp',
+      'contrib/SeqLib/src/ssw_cpp.cpp',
+      'contrib/SeqLib/src/ssw.c',
+  )
 
   seqlib_lib = static_library('custom_seqlib',
                               seqlib_src,
-                              include_directories : [htslib_inc, vcflib_inc, seqlib_inc],
+                              include_directories : [seqlib_inc],
                               override_options : warn_quiet)
   seqlib_dep = declare_dependency(link_with : seqlib_lib,
                                   include_directories : seqlib_inc)
 endif
 
-
 #
 # Sources
 #
@@ -238,7 +150,7 @@ extra_cpp_args = cc.get_supported_arguments(
 freebayes_lib = static_library(
     'freebayes_common',
     freebayes_common_src,
-    include_directories : [multichoose_inc, fastahack_inc, smithwaterman_inc, incdir],
+    include_directories : [incdir, vcflib_inc, fastahack_inc],
     cpp_args : extra_cpp_args,
     dependencies : [zlib_dep, lzma_dep, thread_dep, htslib_dep, tabixpp_dep,
                     vcflib_dep, wfa2lib_dep, seqlib_dep],
@@ -252,8 +164,8 @@ else
 endif
 
 executable('freebayes',
-           [freebayes_src,multichoose_src,fastahack_src,smithwaterman_src],
-           include_directories : [multichoose_inc, fastahack_inc, smithwaterman_inc, incdir],
+           [freebayes_src],
+           include_directories : [incdir, vcflib_inc, fastahack_inc],
            cpp_args : extra_cpp_args,
            link_args: link_arguments,
            dependencies: [zlib_dep,
@@ -263,16 +175,16 @@ executable('freebayes',
                           tabixpp_dep,
                           vcflib_dep,
                           seqlib_dep,
-                          # fastahack_dep,
-                          # smithwaterman_dep,
+                          fastahack_dep, # for vcflib
+                          smithwaterman_dep, # for vcflib
                           wfa2lib_dep],
            link_with : freebayes_lib,
            install: true
           )
 
 executable('bamleftalign',
-           [bamleftalign_src,fastahack_src,smithwaterman_src],
-           include_directories : [multichoose_inc, fastahack_inc, smithwaterman_inc, incdir],
+           [bamleftalign_src],
+           include_directories : [incdir, vcflib_inc, fastahack_inc],
            cpp_args : extra_cpp_args,
            link_args: link_arguments,
            dependencies: [zlib_dep,
@@ -281,8 +193,8 @@ executable('bamleftalign',
                           htslib_dep,
                           vcflib_dep,
                           seqlib_dep,
-                          # fastahack_dep,
-                          # smithwaterman_dep,
+                          fastahack_dep, # for vcflib
+                          smithwaterman_dep, # for vcflib
                           wfa2lib_dep],
            link_with : freebayes_lib,
            install: true


=====================================
src/AlleleParser.h
=====================================
@@ -29,7 +29,7 @@
 #include "CNV.h"
 #include "Result.h"
 #include "LeftAlign.h"
-#include "Variant.h"
+#include <Variant.h> // note this can end in vcflib/Variant.h
 #include "version_git.h"
 
 // the size of the window of the reference which is always cached in memory


=====================================
src/BedReader.h
=====================================
@@ -9,7 +9,7 @@
 #include <map>
 #include <iterator>
 #include <algorithm>
-#include <IntervalTree.h>
+#include <intervaltree/IntervalTree.h>
 #include "split.h"
 
 using namespace std;


=====================================
src/ResultData.h
=====================================
@@ -8,7 +8,7 @@
 #include "Allele.h"
 #include "Utility.h"
 #include "AlleleParser.h"
-#include "Variant.h"
+#include <Variant.h>
 #include "version_git.h"
 #include "Result.h"
 #include "NonCall.h"



View it on GitLab: https://salsa.debian.org/med-team/freebayes/-/commit/0829d1e47fe9ee85283a4923c9cced7a97db65f7

-- 
View it on GitLab: https://salsa.debian.org/med-team/freebayes/-/commit/0829d1e47fe9ee85283a4923c9cced7a97db65f7
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250216/245b060f/attachment-0001.htm>


More information about the debian-med-commit mailing list