Skip to content
Commits on Source (10)
......@@ -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
=======
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
======
......
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@debian.org> Mon, 22 Jun 2015 19:19:19 +0200
-- Andreas Tille <tille@debian.org> Sun, 28 Oct 2018 18:50:04 +0100
Source: htqc
Section: science
Priority: optional
Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Uploaders: Andreas Tille <tille@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
......
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@163.com>
Upstream-Name: HTQC
Source: http://sourceforge.net/projects/htqc/files/
......
......@@ -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
......@@ -101,8 +101,21 @@ 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()
{
if (store)
delete store;
}
......@@ -262,22 +275,31 @@ void OptionParser::parse_options(int& argc, char** argv)
{
// long key in "--xxx" style
if (curr_token[1] == '-')
{
Option* next_option = find_option_long(curr_token);
if (next_option)
{
// clear previous values
_dump_value_group_(values_by_option, curr_option, curr_value_group);
// find option object
curr_option = find_option_long(curr_token);
curr_option = next_option;
}
else
{
curr_value_group.emplace_back(i, curr_token);
}
}
// short key in "-x" style
else
{
Option* next_option = find_option_short(curr_token[1]);
if (next_option)
{
// 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]);
curr_option = next_option;
// short key contains a value
if (curr_token.length() > 2)
......@@ -292,7 +314,12 @@ void OptionParser::parse_options(int& argc, char** argv)
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;
}
}
......
......@@ -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);
......
#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();
}
}
}
}
}
}