[med-svn] [Git][med-team/htqc][master] 10 commits: New upstream version 1.92.3

Andreas Tille gitlab at salsa.debian.org
Sun Oct 28 18:01:13 GMT 2018


Andreas Tille pushed to branch master at Debian Med / htqc


Commits:
66923111 by Andreas Tille at 2018-10-28T17:50:01Z
New upstream version 1.92.3
- - - - -
ee2e29a6 by Andreas Tille at 2018-10-28T17:50:04Z
Update upstream source from tag 'upstream/1.92.3'

Update to upstream version '1.92.3'
with Debian dir df89476acf785da44e7c25e99771cd3a1b6c9250
- - - - -
90411bce by Andreas Tille at 2018-10-28T17:50:04Z
New upstream version

- - - - -
4cb5a5cd by Andreas Tille at 2018-10-28T17:50:04Z
debhelper 11

- - - - -
fb492658 by Andreas Tille at 2018-10-28T17:50:07Z
Point Vcs fields to salsa.debian.org

- - - - -
cbdd3ee7 by Andreas Tille at 2018-10-28T17:50:07Z
Standards-Version: 4.2.1

- - - - -
eb60e3bc by Andreas Tille at 2018-10-28T17:50:08Z
Secure URI in copyright format

- - - - -
5b0d7e24 by Andreas Tille at 2018-10-28T17:51:29Z
Respect DEB_BUILD_OPTIONS in override_dh_auto_test target

- - - - -
424988a8 by Andreas Tille at 2018-10-28T17:52:03Z
Do not parse d/changelog

- - - - -
39013693 by Andreas Tille at 2018-10-28T18:00:45Z
Cleanup changelog of not yet released package

- - - - -


10 changed files:

- CMakeLists.txt
- Changes.md
- debian/changelog
- debian/compat
- debian/control
- debian/copyright
- debian/rules
- src/htio2/OptionParser.cpp
- src/htio2/OptionParser.h
- t/t_ht_overlap.cpp


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -27,7 +27,7 @@ list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
 
 set(CPACK_PACKAGE_VERSION_MAJOR 1)
 set(CPACK_PACKAGE_VERSION_MINOR 92)
-set(CPACK_PACKAGE_VERSION_PATCH 1)
+set(CPACK_PACKAGE_VERSION_PATCH 3)
 set(CPACK_GENERATOR TGZ)
 set(CPACK_SOURCE_GENERATOR TGZ)
 set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} ".kdev4" "~" "build" "nbproject" "test_data" "CMakeLists.txt.user*")


=====================================
Changes.md
=====================================
@@ -1,6 +1,24 @@
 Changes
 =======
 
+1.92.3
+======
+
+  - htio2 library
+
+    Fixed bugs on missing move constructor of Option class, and now it works
+    properly with GCC 4.7.
+
+1.92.2
+======
+
+  - Refined unit test for ht2-overlap.
+
+  - htio2 library
+
+    Fixed a bug on command-line option parser, where values with leading "-"
+    was recognized as option key.
+
 1.92.1
 ======
 


=====================================
debian/changelog
=====================================
@@ -1,7 +1,5 @@
-htqc (1.92.1-1) UNRELEASED; urgency=low
+htqc (1.92.3-1) UNRELEASED; urgency=low
 
   * Initial release (Closes: #<bug>)
-  * debian/upstream/metadata: Added refs to registries
-    (Steffen Moeller)
 
- -- Andreas Tille <tille at debian.org>  Mon, 22 Jun 2015 19:19:19 +0200
+ -- Andreas Tille <tille at debian.org>  Sun, 28 Oct 2018 18:50:04 +0100


=====================================
debian/compat
=====================================
@@ -1 +1 @@
-9
+11


=====================================
debian/control
=====================================
@@ -1,20 +1,21 @@
 Source: htqc
-Section: science
-Priority: optional
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
 Uploaders: Andreas Tille <tille at debian.org>
-Build-Depends: debhelper (>= 9),
+Section: science
+Priority: optional
+Build-Depends: debhelper (>= 11~),
                cmake,
                zlib1g-dev,
                ruby-ronn
-Standards-Version: 3.9.6
-Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/htqc.git
-Vcs-Git: git://anonscm.debian.org/debian-med/htqc.git
+Standards-Version: 4.2.1
+Vcs-Browser: https://salsa.debian.org/med-team/htqc
+Vcs-Git: https://salsa.debian.org/med-team/htqc.git
 Homepage: http://sourceforge.net/projects/htqc/
 
 Package: htqc
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends},
+         ${misc:Depends}
 Description: Quality control and filtration for illumina sequencing data
  HTQC is a toolkit including statistics tool for illumina high-throughput
  sequencing data, and filtration tools for sequence quality, length, tail


=====================================
debian/copyright
=====================================
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Contact: Xi Yang <jiandingzhe at 163.com>
 Upstream-Name: HTQC
 Source: http://sourceforge.net/projects/htqc/files/


=====================================
debian/rules
=====================================
@@ -2,8 +2,8 @@
 
 # DH_VERBOSE := 1
 
-DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
-mandir=$(CURDIR)/debian/$(DEBPKGNAME)/usr/share/man/man1/
+include /usr/share/dpkg/default.mk
+mandir=$(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1/
 
 # alternatively to manually set those variables you can
 #  include /usr/share/cdbs/1/rules/buildvars.mk
@@ -30,10 +30,3 @@ override_dh_installman:
 override_dh_installdocs:
 	ronn --html README.md
 	dh_installdocs
-
-override_dh_auto_test:
-ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
-	echo skip testing due to DEB_BUILD_OPTIONS
-else
-	dh_auto_test
-endif


=====================================
src/htio2/OptionParser.cpp
=====================================
@@ -101,9 +101,22 @@ string Option::BoolSwitch::to_string()
     return "";
 }
 
+Option::Option(Option &&other) noexcept
+    : name_long(other.name_long)
+    , name_short(other.name_short)
+    , group(other.group)
+    , store(other.store)
+    , flags(other.flags)
+    , option_desc(other.option_desc)
+    , value_desc(other.value_desc)
+{
+    other.store = nullptr;
+}
+
 Option::~Option()
 {
-    delete store;
+    if (store)
+        delete store;
 }
 
 string Option::format_doc(size_t w_line, size_t w_key_left, size_t w_key, size_t w_key_right) const
@@ -263,36 +276,50 @@ void OptionParser::parse_options(int& argc, char** argv)
                 // long key in "--xxx" style
                 if (curr_token[1] == '-')
                 {
-                    // clear previous values
-                    _dump_value_group_(values_by_option, curr_option, curr_value_group);
+                    Option* next_option = find_option_long(curr_token);
 
-                    // find option object
-                    curr_option = find_option_long(curr_token);
+                    if (next_option)
+                    {
+                        // clear previous values
+                        _dump_value_group_(values_by_option, curr_option, curr_value_group);
+                        curr_option = next_option;
+                    }
+                    else
+                    {
+                        curr_value_group.emplace_back(i, curr_token);
+                    }
                 }
 
                 // short key in "-x" style
                 else
                 {
-                    // clear previous values
-                    _dump_value_group_(values_by_option, curr_option, curr_value_group);
-
-                    // find option object
-                    curr_option = find_option_short(curr_token[1]);
+                    Option* next_option = find_option_short(curr_token[1]);
 
-                    // short key contains a value
-                    if (curr_token.length() > 2)
+                    if (next_option)
                     {
-                        string curr_token_value = curr_token.substr(2);
+                        // clear previous values
+                        _dump_value_group_(values_by_option, curr_option, curr_value_group);
+                        curr_option = next_option;
 
-                        // extra check for that the option must accept value
-                        if (curr_option->store->limit.max == 0)
+                        // short key contains a value
+                        if (curr_token.length() > 2)
                         {
-                            fprintf(stderr, "ERROR: option -%c is bool switch, but a value \"%s\" is given via \"%s\"\n",
-                                    curr_option->name_short, curr_token_value.c_str(), curr_token.c_str());
-                            exit(EXIT_FAILURE);
-                        }
+                            string curr_token_value = curr_token.substr(2);
+
+                            // extra check for that the option must accept value
+                            if (curr_option->store->limit.max == 0)
+                            {
+                                fprintf(stderr, "ERROR: option -%c is bool switch, but a value \"%s\" is given via \"%s\"\n",
+                                        curr_option->name_short, curr_token_value.c_str(), curr_token.c_str());
+                                exit(EXIT_FAILURE);
+                            }
 
-                        curr_value_group.push_back(make_pair(i, curr_token_value));
+                            curr_value_group.emplace_back(i, curr_token_value);
+                        }
+                    }
+                    else
+                    {
+                        curr_value_group.emplace_back(i, curr_token);
                     }
                 }
             }
@@ -515,8 +542,7 @@ Option* OptionParser::find_option_long(const string &key)
 
     if (matched_keys.size() == 0)
     {
-        fprintf(stderr, "ERROR: unknown option \"%s\"\n", key.c_str());
-        exit(EXIT_FAILURE);
+        return nullptr;
     }
     else if (matched_keys.size() == 1)
     {
@@ -538,8 +564,7 @@ Option* OptionParser::find_option_short(char key)
         return options[it->second];
     else
     {
-        fprintf(stderr, "ERROR: unknown option \"-%c\"\n", key);
-        exit(EXIT_FAILURE);
+        return nullptr;
     }
 }
 


=====================================
src/htio2/OptionParser.h
=====================================
@@ -180,11 +180,13 @@ public:
     {
     }
 
-    virtual ~Option();
+    Option(Option&& other) noexcept;
+
+    // copying is not allowed
+    Option(const Option& other) = delete;
+    Option& operator = (const Option& other) = delete;
 
-private:
-    Option(const Option& other);
-    Option& operator = (const Option& other);
+    virtual ~Option();
 
 protected:
     static bool validate_name(char name);


=====================================
t/t_ht_overlap.cpp
=====================================
@@ -1,11 +1,126 @@
 #include "TestFramework.h"
 #include "TestConfig.h"
 
+#include "htio2/FastqIO.h"
+#include "htio2/PairedEndIO.h"
+#include "htio2/FastqSeq.h"
+
+#include <map>
+
+using namespace std;
+using namespace htio2;
+using namespace htio2::juce;
+
+void parse_fields(const string& desc, map<string, int>& result)
+{
+    StringArray tokens;
+    tokens.addTokens(String(desc), " =", "");
+    if (tokens.size() % 2)
+    {
+        fprintf(stderr, "invalid token size %d, not even\n", tokens.size());
+        abort();
+    }
+    for (int i = 0; i < tokens.size(); i+=2)
+    {
+        const String& key = tokens[i];
+        const String& value = tokens[i+1];
+        result[key.toStdString()] = value.getIntValue();
+    }
+}
+
 void TestFramework::content()
 {
     const char* cmd = "../src/ht2-overlap -q -i " TEST_SOURCE_DIR "/test1.fastq.gz " TEST_SOURCE_DIR "/test2.fastq.gz -o ovlp -u novlp";
     ok(!system(cmd), cmd);
-    OK(text_file_eq("ovlp.fastq.gz", TEST_SOURCE_DIR "/test_ovlp.fastq.gz"));
-    OK(text_file_eq("novlp_1.fastq.gz", TEST_SOURCE_DIR "/test_novlp_1.fastq.gz"));
-    OK(text_file_eq("novlp_2.fastq.gz", TEST_SOURCE_DIR "/test_novlp_2.fastq.gz"));
+
+
+    map<string,string> ovlp_seqs;
+    map<string,int> offsets;
+    {
+        htio2::FastqIO fh_ovlp("ovlp.fastq.gz", htio2::READ);
+        htio2::FastqSeq seq;
+        while (fh_ovlp.next_seq(seq))
+        {
+            map<string,int> attrs;
+            parse_fields(seq.desc, attrs);
+            if (!attrs.count("kmer_pos_a"))
+            {
+                fprintf(stderr, "no attribute kmer_pos_a\n");
+                abort();
+            }
+            if (!attrs.count("kmer_pos_b"))
+            {
+                fprintf(stderr, "no attribute kmer_pos_b\n");
+                abort();
+            }
+
+            ovlp_seqs[seq.id] = seq.seq;
+            offsets[seq.id] = attrs["kmer_pos_b"] - attrs["kmer_pos_a"];
+        }
+    }
+
+    {
+        htio2::FastqSeq seq1;
+        htio2::FastqSeq seq2;
+        htio2::PairedEndIO fh_in(TEST_SOURCE_DIR "/test1.fastq.gz", TEST_SOURCE_DIR "/test2.fastq.gz",
+                                 htio2::READ);
+        while (fh_in.next_pair(seq1,seq2))
+        {
+            if (seq1.id != seq2.id)
+            {
+                fprintf(stderr, "conflict ID: %s and %s\n", seq1.id.c_str(), seq2.id.c_str());
+                abort();
+            }
+
+            if (!ovlp_seqs.count(seq1.id))
+                continue;
+
+            const string& merged_seq = ovlp_seqs[seq1.id];
+            int offset = offsets[seq1.id];
+
+            for (int i = 0; i < merged_seq.length(); i++)
+            {
+                int i1 = numeric_limits<int>::max();
+                int i2 = numeric_limits<int>::max();
+
+                if (offset >= 0)
+                {
+                    i1 = i - offset;
+                    i2 = i;
+                }
+                else
+                {
+                    i1 = i;
+                    i2 = i + offset;
+                }
+
+                if (0 <= i1 && i1 < seq1.length())
+                {
+                    if (0 <= i2 && i2 < seq2.length())
+                    {
+                        if (seq1.quality[i1] >= seq2.quality[i2])
+                            IS(seq1.seq[i1], merged_seq[i]);
+                        else
+                            IS(seq2.seq[i2], merged_seq[i]);
+                    }
+                    else
+                    {
+                        IS(seq1.seq[i1], merged_seq[i]);
+                    }
+                }
+                else
+                {
+                    if (0 <= i2 && i2 < seq2.length())
+                    {
+                        IS(seq2.seq[i2], merged_seq[i]);
+                    }
+                    else
+                    {
+                        fprintf(stderr, "invalid position %d and %d at %d", i1, i2, i);
+                        abort();
+                    }
+                }
+            }
+        }
+    }
 }



View it on GitLab: https://salsa.debian.org/med-team/htqc/compare/2ec383cec13f45f4d8c1bff862060abd47589a35...39013693fc5db7d118ef8933af169740446c7a08

-- 
View it on GitLab: https://salsa.debian.org/med-team/htqc/compare/2ec383cec13f45f4d8c1bff862060abd47589a35...39013693fc5db7d118ef8933af169740446c7a08
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/20181028/474426b6/attachment-0001.html>


More information about the debian-med-commit mailing list