Changeset 3870


Ignore:
Timestamp:
Feb 24, 2020, 6:00:35 AM (4 years ago)
Author:
Peter
Message:

merge changes from 0.17-stable branch

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/NEWS

    r3857 r3870  
    1111
    1212version 0.17 (released NOT YET)
     13  - Class Percentiler and functions using the class (percentile2,
     14    median, and mad) are now documented to require lvalue access (see
     15    bug #935)
    1316  - cxx11 features are now available also when YAT_WITH_CXX11 is not
    1417    defined; user can still turn off cxx11 features with
  • trunk/m4/yat_check_htslib.m4

    r3763 r3870  
    11## $Id$
    22#
    3 # serial 3 (yat 0.16)
     3# serial 4 (yat 0.17)
    44#
    5 #   Copyright (C) 2016, 2018 Peter Johansson
     5#   Copyright (C) 2016, 2018, 2020 Peter Johansson
    66#
    77#   This file is part of the yat library, http://dev.thep.lu.se/yat
     
    111111    _YAT_BAM_INCLUDES
    112112    @%:@if YAT_HAVE_HTSLIB
    113     void my_func(bam_hdr_t* hdr) { bam_hdr_destroy(hdr); }
     113    void my_func(void) { hts_version(); }
    114114    @%:@else
    115115    void my_func(bam_header_t* hdr) { bam_header_destroy(hdr); }
  • trunk/m4/yat_check_libbam.m4

    r3728 r3870  
    11## $Id$
    22#
    3 # serial 8 (yat 0.16)
    4 #
    5 #
    6 #   Copyright (C) 2012, 2013, 2014, 2015, 2018 Peter Johansson
     3# serial 9 (yat 0.17)
     4#
     5#
     6#   Copyright (C) 2012, 2013, 2014, 2015, 2018, 2020 Peter Johansson
    77#
    88#   This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4949[
    5050BAM_LIBS=no
    51 YAT_SEARCH_LIBS([bam_hdr_destroy], [hts],
    52                [BAM_LIBS=$yat_cv_search_bam_hdr_destroy
     51YAT_SEARCH_LIBS([hts_version], [hts],
     52               [BAM_LIBS=$yat_cv_search_hts_version
    5353                $1],
    5454               [$2])
  • trunk/test/doxygen_test.sh

    r3855 r3870  
    2828echo "doxygen $version"
    2929
    30 # doxygen 1.8.15 causes warnings as reported here
     30# doxygen 1.8.15 (and 1.8.17) causes warnings as reported here
    3131# https://github.com/doxygen/doxygen/issues/851
    32 test x$version = x"1.8.15" && exit_skip
     32echo x$version | grep "^x1.8.1[5-7]$" > /dev/null && exit_skip
    3333
    3434cat $abs_top_builddir/doc/doxygen.error || test_fail
  • trunk/test/gff.cc

    r3840 r3870  
    4444void test_gff(test::Suite&, GFF&);
    4545void test_ticket697(test::Suite&);
     46void test_ticket937(test::Suite&);
     47void test_value_without_quote(test::Suite&);
    4648
    4749int main(int argc, char* argv[])
     
    5254  gff3(suite);
    5355  test_ticket697(suite);
     56  test_ticket937(suite);
     57  test_value_without_quote(suite);
    5458
    5559  return suite.return_value();
     
    134138  is.close();
    135139}
     140
     141
     142void test_ticket937(test::Suite& suite)
     143{
     144  suite.out() << "test ticket 937\n";
     145
     146  std::stringstream ss;
     147  ss << "1\tStringTie\ttranscript\t134901\t139379\t1000\t-\t.\t"
     148     << "gene_id \"ENSG00000237683.5\"; transcript_id \"ENST00000423372.3\"; "
     149     << "ref_gene_name \"AL627309.1\"; cov \"7.649971\"; FPKM \"3.057291\"; "
     150     << "TPM \"7.858644\";";
     151
     152  GFF2 gff;
     153  getline(ss, gff);
     154  std::string id = gff.attribute("transcript_id");
     155  if (id != "ENST00000423372.3") {
     156    suite.err() << "error: incorrect ID: "
     157                << "transcript_id: " << id << "\n";
     158    suite.add(false);
     159  }
     160}
     161
     162
     163void test_value_without_quote(test::Suite& suite)
     164{
     165  suite.out() << "test value without quote\n";
     166  std::stringstream ss;
     167  ss << "1\tStringTie\ttranscript\t134901\t139379\t1000\t-\t.\tlevel 1;";
     168
     169  GFF2 gff;
     170  getline(ss, gff);
     171  try {
     172    std::string val = gff.attribute("level");
     173    if (val != "1") {
     174      suite.err() << "error: incorrect value: " << val << "\n";
     175      suite.add(false);
     176    }
     177  }
     178  catch (std::exception& e) {
     179    suite.err() << "error: exception thrown: what(): " << e.what() << "\n";
     180    suite.add(false);
     181  }
     182}
  • trunk/test/statistics.cc

    r3792 r3870  
    8888  if (false) {
    8989    using statistics::median;
    90     typedef boost::iterator_archetypes::readable_iterator_t Access;
     90    typedef boost::iterator_archetypes::readable_lvalue_iterator_t Access;
    9191    typedef boost::random_access_traversal_tag Traversal;
    9292    boost::iterator_archetype<double, Access, Traversal> input;
     
    270270  if (false) {
    271271    using statistics::mad;
    272     typedef boost::iterator_archetypes::readable_iterator_t Access;
     272    typedef boost::iterator_archetypes::readable_lvalue_iterator_t Access;
    273273    typedef boost::random_access_traversal_tag Traversal;
    274274    boost::iterator_archetype<double, Access, Traversal> input;
    275275    double x = mad(input, input);
    276     boost::iterator_archetype<utility::DataWeight, Access, Traversal> input2;
     276    typedef boost::iterator_archetypes::readable_iterator_t Access2;
     277    boost::iterator_archetype<utility::DataWeight, Access2, Traversal> input2;
    277278    x = mad(input2, input2);
    278279    test::avoid_compiler_warning(x);
     
    372373  if (false) {
    373374    statistics::Percentiler percentiler(50);
    374     typedef boost::iterator_archetypes::readable_iterator_t Access;
     375    typedef boost::iterator_archetypes::readable_lvalue_iterator_t Access;
    375376    typedef boost::random_access_traversal_tag Traversal;
    376377    boost::iterator_archetype<double, Access, Traversal> input;
  • trunk/test/tukey.cc

    r3550 r3870  
    6565  // do not run compilation tests
    6666  if (false) {
    67     typedef boost::iterator_archetypes::readable_iterator_t Access;
     67    typedef boost::iterator_archetypes::readable_lvalue_iterator_t Access;
    6868    typedef boost::random_access_traversal_tag Traversal;
    6969    boost::iterator_archetype<double, Access, Traversal> input;
    7070    TukeyBiweightEstimator estimator;
    7171    double x = estimator(input, input);
    72     boost::iterator_archetype<utility::DataWeight, Access, Traversal> input2;
     72    typedef boost::iterator_archetypes::readable_iterator_t Access2;
     73    boost::iterator_archetype<utility::DataWeight, Access2, Traversal> input2;
    7374    x = estimator(input2, input2);
    7475    test::avoid_compiler_warning(x);
  • trunk/yat/omic/BamRead.cc

    r3752 r3870  
    9696  {
    9797    if (bam_!=rhs.bam_)
    98       bam_copy1(bam_, rhs.bam_);
     98      if (!bam_copy1(bam_, rhs.bam_))
     99        throw utility::runtime_error("BamRead assignment failed");
    99100    return *this;
    100101  }
  • trunk/yat/omic/GFF.cc

    r2881 r3870  
    149149    os << gff.vec()[0];
    150150    for (size_t i=1; i<gff.vec().size(); ++i)
    151       os << "n" << gff.vec()[i];
     151      os << "\t" << gff.vec()[i];
    152152    return os;
    153153  }
  • trunk/yat/omic/GFF2.cc

    r3840 r3870  
    3636  {
    3737    size_t offset = str.find_first_not_of(' ');
     38    if (offset == std::string::npos)
     39      return;
    3840    size_t i = str.find_first_of(' ', offset);
     41    assert(i != std::string::npos);
    3942    assert(i >= offset);
    4043    std::string key = str.substr(offset, i-offset);
     
    4649    // skip trailing spaces
    4750    size_t n = str.find_last_not_of(' ');
    48     // skip training '"'
     51    // skip trailing '"'
    4952    if (str[n] == '"')
    5053      --n;
  • trunk/yat/omic/GFF3.cc

    r2919 r3870  
    3939    std::vector<std::string> v;
    4040    utility::split(v, str, '=');
     41    if (v.size() == 1) {
     42      if (v[0] == "")
     43        return;
     44      m[v[0]] = "";
     45    }
    4146    m[v[0]] = v[1];
    4247  }
  • trunk/yat/statistics/Percentiler.h

    r3550 r3870  
    9494       concept_data_iterator
    9595       - \c RandomAccessIterator must be a \random_access_traversal_iterator
     96       - \c For unweighted iterator, RandomAccessIterator must be an
     97         \lvalue_iterator as implied by \forward_iterator.
    9698
    9799       \return percentile of range
     
    103105      BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<RandomAccessIterator>));
    104106      BOOST_CONCEPT_ASSERT((boost_concepts::RandomAccessTraversal<RandomAccessIterator>));
     107      //
    105108      if (first==last)
    106109        return std::numeric_limits<double>::quiet_NaN();
     
    141144                         utility::unweighted_iterator_tag tag) const
    142145  {
     146    BOOST_CONCEPT_ASSERT((boost_concepts::LvalueIterator<RandomAccessIterator>));
    143147    size_t n = last - first;
    144148    // range is one value only is a special case
  • trunk/yat/statistics/TukeyBiweightEstimator.h

    r3550 r3870  
    8282       concept_data_iterator
    8383       - \c RandomAccessIterator must be a \random_access_traversal_iterator
     84       - \c For unweighted iterator, RandomAccessIterator must be an
     85         \lvalue_iterator as implied by \forward_iterator.
    8486
    8587       \return Tukey's Biweight Estimate
  • trunk/yat/statistics/utility.h

    r3792 r3870  
    198198     concept_data_iterator
    199199     - \c RandomAccessIterator must be a \random_access_traversal_iterator
     200     - \c For unweighted iterator, RandomAccessIterator must be an
     201       \lvalue_iterator as implied by \forward_iterator.
    200202
    201203     Since 0.6 function also work with a \ref
     
    221223     concept_data_iterator
    222224     - \c RandomAccessIterator must be a \random_access_traversal_iterator
     225     - \c For unweighted iterator, RandomAccessIterator must be an
     226       \lvalue_iterator as implied by \forward_iterator.
    223227
    224228     \return median of range
     
    289293     concept_data_iterator
    290294     - \c RandomAccessIterator must be a \random_access_traversal_iterator
     295     - \c For unweighted iterator, RandomAccessIterator must be an
     296       \lvalue_iterator as implied by \forward_iterator.
    291297
    292298     \since new in yat 0.5
  • trunk/yat/utility/Scheduler.cc

    r3855 r3870  
    455455
    456456  Scheduler::JobHandler::JobHandler(Scheduler::JobHandlerData& data)
    457     : data_(&data), n_target_workers_(0)
    458   {}
     457    : data_(&data), scheduler_is_waiting_(false), job_count_(0),
     458      n_target_workers_(0)
     459  {
     460  }
    459461
    460462
Note: See TracChangeset for help on using the changeset viewer.