Changeset 3295


Ignore:
Timestamp:
Jul 25, 2014, 6:24:39 AM (9 years ago)
Author:
Peter
Message:

merge release 0.12 into trunk

Location:
trunk
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/NEWS

    r3276 r3295  
    1313yat 0.12.x series from http://dev.thep.lu.se/yat/svn/branches/0.12-stable
    1414
    15 version 0.12 (released NOT YET)
     15version 0.12 (released 25 July 2014)
     16  - BamRead::cigar(const std::vector<uint32_t>&) is deprecated
    1617  - Aligner(double, double) is now explicit (see r3207)
    1718  - GetlineIterator(istream&, char) is now explicit (see r3148)
     19  - rename(2) and remove(1) are now implemented (bug #804)
    1820
    1921  A complete list of closed tickets can be found here [[br]]
  • trunk/configure.ac

    r3250 r3295  
    1010# Copyright (C) 2010, 2011 Peter Johansson
    1111# Copyright (C) 2012 Jari Häkkinen, Peter Johansson
    12 # Copyright (C) 2013, 2014 Peter Johansson
     12# Copyright (C) 2013 Peter Johansson
     13# Copyright (C) 2014 Jari Häkkinen, Peter Johansson
    1314#
    1415# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    460461])
    461462
     463# When compiling boost::Mutable_*Iterator some versions of clang complains:
     464# warning: unsequenced modification and access to 'i' [-Wunsequenced]
     465# Test if compiler gives that warning, and if it does turn it off.
     466yat_save_CXXFLAGS=$CXXFLAGS
     467AC_MSG_CHECKING([whether 'boost/concept_check.hpp' causes compiler warnings])
     468CXXFLAGS="$INTERNAL_CXXFLAGS $CXXFLAGS"
     469AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
     470  [
     471    @%:@include <boost/concept_check.hpp>
     472  ],[
     473    BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<double* >));
     474  ])
     475], [ # IF-SUCCESSFUL
     476  AC_MSG_RESULT([no])
     477  # restore CXXFLAGS
     478  CXXFLAGS=$yat_save_CXXFLAGS
     479], [ # IF-FAILED
     480  AC_MSG_RESULT([yes])
     481  CXXFLAGS=$yat_save_CXXFLAGS
     482  YAT_CXX_ADD_FLAG([CXXFLAGS], [-Wno-unsequenced])
     483])
     484
     485
    462486AS_IF([test x$enable_debug = xyes], [
    463487  # some versions of boost uses long long - turn off compiler warnings
  • trunk/doc/concepts.doxygen

    r2504 r3295  
    22//
    33// Copyright (C) 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
    4 // Copyright (C) 2009, 2010, 2011 Peter Johansson
     4// Copyright (C) 2009, 2010, 2011, 2014 Peter Johansson
    55//
    66// This file is part of the yat library, http://dev.thep.lu.se/yat
     
    3737\page concept_container_2d Container2D
    3838
    39 \section Description
     39\section concept_container_2d_description Description
    4040
    4141\ref concept_container_2d is a <a
     
    4646row.
    4747
    48 \section Requirements
     48\section concept_container_2d_requirments Requirements
    4949
    5050A \ref concept_container_2d provides the following:
    5151
    52 \subsection Types
     52\subsection concept_container_2d_types Types
    5353
    5454<table cellspacing=0 border=1>
     
    6262<tr>
    6363<td>Const iterator type</td>
    64 <td><tt>X::const_iterator</tt></td> 
     64<td><tt>X::const_iterator</tt></td>
    6565<td>
    6666A read-only iterator that can be used to iterate over the entire \ref
     
    7272<tr>
    7373<td>Const column iterator type</td>
    74 <td><tt>X::const_column_iterator</tt></td> 
     74<td><tt>X::const_column_iterator</tt></td>
    7575<td>
    7676A read-only iterator that can be used to examine the elements in one
     
    8080<tr>
    8181<td>Const row iterator type</td>
    82 <td><tt>X::const_row_iterator</tt></td> 
     82<td><tt>X::const_row_iterator</tt></td>
    8383<td>
    8484A read-only iterator that can be used to examine the elements in one
     
    8888</table>
    8989
    90 \subsection public_functions Public Functions
     90\subsection concept_container_2d_public_functions Public Functions
    9191
    9292<table cellspacing=0 border=1>
     
    154154<td>Element Access</td>
    155155<td><tt>a(size_t row, size_t column)</tt></td>
    156 <td><tt>0 &lt;= row &lt; a.rows()</tt> and 
     156<td><tt>0 &lt;= row &lt; a.rows()</tt> and
    157157<tt>0 &lt;= column &lt; a.columns()</tt></td>
    158158<td><tt>const_reference</tt></td>
     
    161161</table>
    162162
    163 \section Implementations
     163\section concept_container_2d_implementations Implementations
    164164
    165165Examples of concept \ref concept_container_2d include:
     
    173173\page concept_mutable_container_2d Mutable Container2D
    174174
    175 \section Description
     175\section concept_mutable_container_2d_description Description
    176176
    177177\ref concept_mutable_container_2d is a \ref concept_container_2d that
    178178also provides non-const access to its elements.
    179179
    180 \section Requirements
     180\section concept_mutable_container_2d_requirments Requirements
    181181
    182182In addition to the requirements defined in \ref concept_container_2d,
    183183a \ref concept_mutable_container_2d also provides the following:
    184184
    185 \subsection Types
     185\subsection concept_mutable_container_2d_types Types
    186186
    187187<table cellspacing=0 border=1>
     
    192192<tr>
    193193<td>Iterator type</td>
    194 <td><tt>X::iterator</tt></td> 
     194<td><tt>X::iterator</tt></td>
    195195<td>
    196196
     
    204204<tr>
    205205<td>Column iterator type</td>
    206 <td><tt>X::column_iterator</tt></td> 
     206<td><tt>X::column_iterator</tt></td>
    207207<td>
    208208A mutable iterator that can be used to modify the elements in one
     
    212212<tr>
    213213<td>Row iterator type</td>
    214 <td><tt>X::row_iterator</tt></td> 
     214<td><tt>X::row_iterator</tt></td>
    215215<td>
    216216A mutable iterator that can be used to modify the elements in one
     
    220220</table>
    221221
    222 \subsection public_functions Public Functions
     222\subsection concept_mutable_container_2d_public_functions Public Functions
    223223
    224224<table cellspacing=0 border=1>
     
    272272<td>Element Access</td>
    273273<td><tt>a(size_t row, size_t column)</tt></td>
    274 <td><tt>0 &lt;= row &lt; a.rows()</tt> and 
     274<td><tt>0 &lt;= row &lt; a.rows()</tt> and
    275275<tt>0 &lt;= column &lt; a.columns()</tt></td>
    276276<td><tt>reference</tt></td>
     
    279279</table>
    280280
    281 \section Implementations
     281\section concept_mutable_container_2d_implementations Implementations
    282282
    283283Examples of concept \ref concept_mutable_container_2d include:
     
    290290\page concept_distance Distance
    291291
    292 \section Description
     292\section concept_distance_description Description
    293293
    294294\ref concept_distance is a concept for classes implementing different
    295295alternatives to calculate the distance between two points.
    296296
    297 \section Requirements
     297\section concept_distance_requirments Requirements
    298298
    299299Classes modelling the concept \ref concept_distance should have a copy
    300 constructor 
     300constructor
    301301
    302302\verbatim
     
    320320have both a value and a weight. The selection between unweighted and
    321321weighted implementations should utilize
    322 theplu::yat::utility::unweighted_iterator_tag and 
     322theplu::yat::utility::unweighted_iterator_tag and
    323323theplu::yat::utility::weighted_iterator_tag. Moreover
    324324theplu::yat::utility::weighted_if_any2 should be utilized to provide a
     
    326326unweighted implementation when both ranges are unweighted.
    327327
    328 \section Implementations
     328\section concept_distance_implementations Implementations
    329329
    330330Examples of classes modelling the concept \ref concept_distance
     
    339339\page concept_neighbor_weighting Neighbor Weighting Method
    340340
    341 \section Description
     341\section concept_neighbor_weighting_description Description
    342342
    343343\ref concept_neighbor_weighting is a concept used in connection with
     
    345345NeighborWeighting should implement this concept.
    346346
    347 \section Requirements
     347\section concept_neighbor_weighting_requirements Requirements
    348348
    349349Classes modelling the concept \ref concept_neighbor_weighting should
    350 be DefaultConstructible and Assignable as well as 
     350be DefaultConstructible and Assignable as well as
    351351implement the following public function:
    352  
    353 \verbatim   
    354 void operator()(const utility::VectorBase& distance, 
     352
     353\verbatim
     354void operator()(const utility::VectorBase& distance,
    355355                const std::vector<size_t>& k_sorted,
    356                 const Target& target, 
     356                const Target& target,
    357357                utility::VectorMutable& prediction) const
    358358\endverbatim
     
    371371neighbors with distance infinity do not vote.
    372372
    373 \section Implementations
     373\section concept_neighbor_weighting_implementations Implementations
    374374
    375375Examples of classes modelling the concept \ref
     
    384384\page concept_weighted_iterator Weighted Iterator
    385385
    386 \section Description
     386\section concept_weighted_iterator_description Description
    387387
    388388Most functionality in yat come in two versions: one optimized for
     
    396396Access Iterator.
    397397
    398 \section Requirements
     398\section concept_weighted_iterator_requirements Requirements
    399399
    400400When implementing a new iterator that may be a \ref
     
    443443\page concept_data_iterator Data Iterator
    444444
    445 \section Description
    446 
    447 \ref concept_data_iterator is an iterator that is either: 
     445\section concept_data_iterator_description Description
     446
     447\ref concept_data_iterator is an iterator that is either:
    448448
    449449  - a \ref concept_weighted_iterator with value type convertible to
     
    451451  - an unweighted iterator with value type convertible to \c double.
    452452
    453 \section Implementations
     453\section concept_data_iterator_implementations Implementations
    454454
    455455Examples of concept \ref concept_data_iterator include:
  • trunk/test/Suite.h

    r3273 r3295  
    413413    add(tmp==*iter);
    414414    TrivialIterator default_constructed;
    415     default_constructed == default_constructed; // avoid compiler warning
     415    dummie_function(default_constructed);
    416416  }
    417417
  • trunk/test/bam.cc

    r3201 r3295  
    2424#include "yat/omic/BamRead.h"
    2525#endif
     26
     27#include "yat/utility/Aligner.h"
    2628
    2729#include <cassert>
     
    5456  suite.out() << "size: " << size << " " << bam.aux_size() << "\n";
    5557  suite.add(bam.aux_size() == size+4);
     58  bam.aux();
    5659  bam.aux("ZZ");
    5760  char c1 = bam_aux2A(bam.aux("ZZ"));
     
    6871  BamRead bam(b);
    6972
     73  bam.cigar();
     74  bam.cigar(0);
     75  bam.cigar_op(0);
     76  bam.cigar_oplen(0);
     77
    7078  suite.out() << "test cigar:\n";
    7179  suite.out() << bam.cigar_str() << "\n";
    7280  OutBamFile os("cigar_test.bam", hdr);
    73   std::vector<uint32_t> cig;
     81  utility::Aligner::Cigar cig;
    7482
    7583  bam.cigar(cig);
     
    7886  os.write(bam);
    7987
    80   cig.resize(1);
    81   cig[0] = bam_cigar_gen(bam.sequence_length(), BAM_CMATCH);
     88  cig.push_back(BAM_CMATCH, bam.sequence_length());
    8289  bam.cigar(cig);
    8390  suite.out() << bam.cigar_str() << "\n";
     
    8592  os.write(bam);
    8693
    87   cig.resize(3);
    88   cig[0] = bam_cigar_gen(50, BAM_CMATCH);
    89   cig[1] = bam_cigar_gen(2, BAM_CDEL);
    90   cig[2] = bam_cigar_gen(50, BAM_CMATCH);
     94  cig.clear();
     95  cig.push_back(BAM_CMATCH, 50);
     96  cig.push_back(BAM_CDEL, 2);
     97  cig.push_back(BAM_CMATCH, 50);
    9198  bam.cigar(cig);
    9299  suite.out() << bam.cigar_str() << "\n";
     
    132139
    133140  // just for consistency
    134   std::vector<uint32_t> cig;
     141  utility::Aligner::Cigar cig;
    135142  bam.cigar(cig);
    136143  bam.core().flag &= ~BAM_FUNMAP;
     
    226233  BamRead bam;
    227234  in.read(bam);
     235  // test that functions are implemented
     236  bam.end();
     237  bam.flag();
     238  bam.mpos();
     239  bam.mtid();
     240  bam.pos();
     241  bam.tid();
     242  bam.swap(bam);
    228243  std::string str = "AGCTTTGTTATTATTTGAGGGTGTGGTTCAGTTGTAAACAGTGTATG"
    229244    "TTTTAGAATTTGTGTTATTGTGATGGCGATGACCAAGTACAACATATTTCCCA";
  • trunk/test/bam_pair_analyse.cc

    r3210 r3295  
    1818#include <config.h>
    1919
    20 #include "Suite.h"
    21 
    22 using namespace theplu::yat;
    23 
    2420#if YAT_HAVE_LIBBAM
    2521#include "yat/omic/algorithm.h"
     
    2723#include "yat/omic/BamReadIterator.h"
    2824#endif
     25
     26// include Suite.h late to see that algorithm.h is OK to include
     27// first. See ticket #793.
     28#include "Suite.h"
     29using namespace theplu::yat;
    2930
    3031void test1(test::Suite& suite);
  • trunk/test/bam_pair_iterator.cc

    r3209 r3295  
    1818#include <config.h>
    1919
    20 #include "Suite.h"
    21 
    2220#ifdef YAT_HAVE_LIBBAM
    2321#include "yat/omic/BamFile.h"
     
    3129#include <cassert>
    3230#include <string>
     31
     32// include Suite.h late to expose bug #797
     33#include "Suite.h"
    3334
    3435using namespace theplu::yat;
  • trunk/test/utility.cc

    r3287 r3295  
    5959void test_fnmatch(test::Suite& suite);
    6060bool test_fnmatch(bool, std::string, std::string);
     61void test_remove(test::Suite& suite);
     62void test_rename(test::Suite& suite);
    6163void test_replace(test::Suite& suite);
    6264
     
    221223  test_dirname(suite);
    222224  test_fnmatch(suite);
     225  test_remove(suite);
     226  test_rename(suite);
    223227  test_replace(suite);
    224228
     
    725729
    726730
     731void test_remove(test::Suite& suite)
     732{
     733  // at least test linking
     734  if (false)
     735    utility::remove("foo");
     736}
     737
     738
     739void test_rename(test::Suite& suite)
     740{
     741  // at least test linking
     742  if (false)
     743    utility::rename("foo", "bar");
     744}
     745
     746
    727747void test_replace(test::Suite& suite)
    728748{
  • trunk/yat/classifier/DataLookupWeighted1D.h

    r2119 r3295  
    77  Copyright (C) 2006 Jari Häkkinen, Peter Johansson
    88  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
    9   Copyright (C) 2009 Peter Johansson
     9  Copyright (C) 2009, 2014 Peter Johansson
    1010
    1111  This file is part of the yat library, http://dev.thep.lu.se/yat
  • trunk/yat/classifier/KernelLookup.h

    r2919 r3295  
    88  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    99  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    10   Copyright (C) 2010, 2012 Peter Johansson
     10  Copyright (C) 2010, 2012, 2014 Peter Johansson
    1111
    1212  This file is part of the yat library, http://dev.thep.lu.se/yat
  • trunk/yat/classifier/MatrixLookup.h

    r2863 r3295  
    88  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    99  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    10   Copyright (C) 2009, 2010, 2012 Peter Johansson
     10  Copyright (C) 2009, 2010, 2012, 2014 Peter Johansson
    1111
    1212  This file is part of the yat library, http://dev.thep.lu.se/yat
  • trunk/yat/classifier/MatrixLookupWeighted.h

    r2862 r3295  
    77  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    88  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    9   Copyright (C) 2009, 2010, 2012 Peter Johansson
     9  Copyright (C) 2009, 2010, 2012, 2014 Peter Johansson
    1010
    1111  This file is part of the yat library, http://dev.thep.lu.se/yat
  • trunk/yat/normalizer/RowNormalizer.h

    r2992 r3295  
    11#ifndef _theplu_yat_normalizer_row_normalizer_
    2 #define _theplu_yat_normalizer_rows_normalizer_
     2#define _theplu_yat_normalizer_row_normalizer_
    33
    44// $Id$
     
    66/*
    77  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
    8   Copyright (C) 2009, 2010 Peter Johansson
     8  Copyright (C) 2009, 2010, 2014 Peter Johansson
    99
    1010  This file is part of the yat library, http://dev.thep.lu.se/yat
  • trunk/yat/omic/BamPairIterator.h

    r3199 r3295  
    3030
    3131#include <boost/concept/assert.hpp>
     32#include <boost/iterator/iterator_concepts.hpp>
    3233#include <boost/iterator/iterator_facade.hpp>
    3334#include <boost/shared_ptr.hpp>
     
    157158    BOOST_CONCEPT_ASSERT((boost::InputIterator<Base>));
    158159    using boost::Convertible;
    159     typedef typename std::iterator_traits<Base>::reference reference_type;
    160     BOOST_CONCEPT_ASSERT((Convertible<reference_type, BamRead>));
     160    typedef typename std::iterator_traits<Base>::value_type value_type;
     161    BOOST_CONCEPT_ASSERT((Convertible<value_type, BamRead>));
    161162    find_next();
    162163  }
     
    168169    BOOST_CONCEPT_ASSERT((boost::InputIterator<Base>));
    169170    using boost::Convertible;
    170     typedef typename std::iterator_traits<Base>::reference reference_type;
    171     BOOST_CONCEPT_ASSERT((Convertible<reference_type, BamRead>));
     171    typedef typename std::iterator_traits<Base>::value_type value_type;
     172    BOOST_CONCEPT_ASSERT((Convertible<value_type, BamRead>));
    172173  }
    173174
  • trunk/yat/omic/BamRead.cc

    r3210 r3295  
    149149
    150150  void BamRead::cigar(const std::vector<uint32_t>& c)
     151  {
     152    // use the new function cigar(1) to implement this old deprecated variant
     153    utility::Aligner::Cigar cig;
     154    for (size_t i=0; i<c.size(); ++i)
     155      cig.push_back(bam_cigar_op(c[i]), bam_cigar_oplen(c[i]));
     156    cigar(cig);
     157  }
     158
     159
     160  void BamRead::cigar(const utility::Aligner::Cigar& c)
    151161  {
    152162    int offset = 4*c.size() - 4*core().n_cigar;
     
    161171
    162172    // copy new cigar
    163     if (c.size())
    164       // each cigar element is 4 bytes
    165       memcpy(bam1_cigar(bam_), &c[0], 4*c.size());
     173    for (size_t i=0; i<c.size(); ++i)
     174      bam1_cigar(bam_)[i] = c[i];
     175
    166176    bam_->data_len += offset;
    167177    core().n_cigar = c.size();
     
    177187  { return bam_->core; }
    178188
     189
     190  uint16_t BamRead::flag(void) const
     191  {
     192    return bam_->core.flag;
     193  }
    179194
    180195  const char* BamRead::name(void) const
  • trunk/yat/omic/BamRead.h

    r3212 r3295  
    2727#include YAT_SAM_HEADER
    2828
     29#include "yat/utility/Aligner.h"
    2930// This file has to be included to keep compatibility with yat 0.11
    30 #include <yat/utility/Cigar.h>
     31#include "yat/utility/Cigar.h"
     32#include "yat/utility/deprecate.h"
    3133
    3234#include <functional>
     
    171173
    172174       \param c new cigar
     175
     176       \deprecated Provided for backward compatibility with 0.11
     177       API. Use cigar(const utility::Aligner::Cigar&) instead.
    173178    */
    174     void cigar(const std::vector<uint32_t>& c);
     179    void cigar(const std::vector<uint32_t>& c) YAT_DEPRECATE;
     180
     181    /**
     182       \brief set CIGAR
     183
     184       \param cigar new cigar
     185
     186       \since new in yat 0.12
     187    */
     188    void cigar(const utility::Aligner::Cigar& cigar);
     189
     190    /**
     191       \brief rightmost coordinate
     192
     193       Coordinate is 0-based, i.e., the end is one passed the last
     194       matching position.
     195
     196       \see bam_calend
     197     */
     198    int32_t end(void) const;
     199
     200    /**
     201       \brief bitwise flag
     202
     203       \see Preprocessor defines BAM_F*
     204
     205       \since implemented since yat 0.12
     206     */
     207    uint16_t flag(void) const;
     208
     209    /**
     210       \brief leftmost position for mate
     211     */
     212    int32_t mpos(void) const;
     213
     214    /**
     215       \brief Chromosome ID for mate
     216     */
     217    int32_t mtid(void) const;
     218
     219    /**
     220       \return query name
     221
     222       Length of array is described by core().l_qname
     223     */
     224    const char* name(void) const;
     225
     226    /**
     227       \brief modify name
     228
     229       \since New in yat 0.11
     230    */
     231    void name(const std::string& n);
     232
     233    /**
     234       \brief 0-based laftmost coordinate
     235     */
     236    int32_t pos(void) const;
    175237
    176238    /**
     
    190252
    191253    /**
    192        \return query name
    193 
    194        Length of array is described by core().l_qname
    195      */
    196     const char* name(void) const;
    197 
    198     /**
    199        \brief modify name
    200 
    201        \since New in yat 0.11
    202     */
    203     void name(const std::string& n);
     254       Each character in returned sequence is either A, C, G, T, or N.
     255
     256       \return sequence
     257     */
     258    std::string sequence(void) const;
     259
     260    /**
     261       4-bit integer describing base \a index
     262
     263       \see bam_nt16_rev_table
     264     */
     265    uint8_t sequence(size_t index) const;
     266
     267    /**
     268       \brief modify a base in sequence
     269
     270       Set i-th base in sequence to \a x, where seq is a 4-bit integer.
     271
     272       \see bam_nt16_table
     273
     274       \since New in yat 0.11
     275     */
     276    void sequence(size_t i, uint8_t x);
     277
     278    /**
     279       \brief set sequence and quality
     280
     281       \since New in yat 0.11
     282     */
     283    void sequence(const std::string& seq, const std::vector<uint8_t>& qual);
     284
     285    /**
     286       \see core().l_qseq
     287     */
     288    uint32_t sequence_length(void) const;
     289
     290    /**
     291       Exchanging this read with \a other.
     292
     293       \see swap(BamRead&, BamRead&)
     294     */
     295    void swap(BamRead& other);
    204296
    205297    /**
     
    207299     */
    208300    int32_t tid(void) const;
    209 
    210     /**
    211        \brief 0-based laftmost coordinate
    212      */
    213     int32_t pos(void) const;
    214 
    215     /**
    216        \brief rightmost coordinate
    217 
    218        Coordinate is 0-based, i.e., the end is one passed the last
    219        matching position.
    220 
    221        \see bam_calend
    222      */
    223     int32_t end(void) const;
    224 
    225     /**
    226        \brief Chromosome ID for mate
    227      */
    228     int32_t mtid(void) const;
    229 
    230     /**
    231        \brief leftmost position for mate
    232      */
    233     int32_t mpos(void) const;
    234 
    235     /**
    236        Each character in returned sequence is either A, C, G, T, or N.
    237 
    238        \return sequence
    239      */
    240     std::string sequence(void) const;
    241 
    242     /**
    243        4-bit integer describing base \a index
    244 
    245        \see bam_nt16_rev_table
    246      */
    247     uint8_t sequence(size_t index) const;
    248 
    249     /**
    250        \brief modify a base in sequence
    251 
    252        Set i-th base in sequence to \a x, where seq is a 4-bit integer.
    253 
    254        \see bam_nt16_table
    255 
    256        \since New in yat 0.11
    257      */
    258     void sequence(size_t i, uint8_t x);
    259 
    260     /**
    261        \brief set sequence and quality
    262 
    263        \since New in yat 0.11
    264      */
    265     void sequence(const std::string& seq, const std::vector<uint8_t>& qual);
    266 
    267     /**
    268        \see core().l_qseq
    269      */
    270     uint32_t sequence_length(void) const;
    271 
    272     /**
    273        \brief bitwise flag
    274 
    275        \see Preprocessor defines BAM_F*
    276      */
    277     uint16_t flag(void) const;
    278 
    279     /**
    280        Exchanging this read with \a other.
    281 
    282        \see swap(BamRead&, BamRead&)
    283      */
    284     void swap(BamRead& other);
    285301
    286302  private:
  • trunk/yat/omic/algorithm.h

    r3210 r3295  
    2424
    2525#include "BamPairIterator.h"
    26 #include "BamRead.h"
    27 #include "GenomicPosition.h"
    28 
    29 #include <boost/concept/assert.hpp>
    30 
    31 #include <iterator>
    32 #include <map>
    33 #include <string>
    34 #include <utility>
    3526
    3627namespace theplu {
  • trunk/yat/statistics/KolmogorovSmirnov.h

    r3018 r3295  
    214214  {
    215215    BOOST_CONCEPT_ASSERT((boost::ForwardIterator<ForwardIterator>));
    216     typedef typename std::iterator_traits<ForwardIterator>::reference ref;
    217     BOOST_CONCEPT_ASSERT((boost::Convertible<ref, KolmogorovSmirnov::Element>));
    218216    ForwardIterator iter(first);
    219217    typename data_w::const_iterator hint(data_.begin());
  • trunk/yat/utility/Aligner.cc

    r3213 r3295  
    22
    33/*
    4   Copyright (C) 2012, 2014 Peter Johansson
     4  Copyright (C) 2012 Peter Johansson
     5  Copyright (C) 2014 Jari Häkkinen, Peter Johansson
    56
    67  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2829#include <cassert>
    2930#include <limits>
     31#include <ostream>
    3032
    3133namespace theplu {
  • trunk/yat/utility/Container2DIterator.h

    r2384 r3295  
    7676    {
    7777      BOOST_CONCEPT_ASSERT((Container2D<Container>));
    78       BOOST_CONCEPT_ASSERT((boost::Convertible<reference,value>));
    7978    };
    8079
     
    9089    {
    9190      BOOST_CONCEPT_ASSERT((Container2D<Container>));
    92       BOOST_CONCEPT_ASSERT((boost::Convertible<reference,value>));
    9391    }
    9492
  • trunk/yat/utility/DataWeightProxy.h

    r2992 r3295  
    6565      // DataIterator::value must be convertible to double
    6666      BOOST_CONCEPT_ASSERT((Convertible<data_type, double>));
    67       // this is for function data(void) const
    68       BOOST_CONCEPT_ASSERT((Convertible<data_reference, const double&>));
    6967
    7068      // same check for WeightIterator
    7169      BOOST_CONCEPT_ASSERT((Convertible<weight_type, double>));
    72       BOOST_CONCEPT_ASSERT((Convertible<weight_reference, const double&>));
    7370    }
    7471
     
    8582    typename std::iterator_traits<DataIterator>::reference data(void)
    8683    {
    87       BOOST_CONCEPT_ASSERT((boost::Convertible<data_reference, double>));
    8884      return *data_;
    8985    }
     
    106102    typename std::iterator_traits<WeightIterator>::reference weight(void)
    107103    {
    108       BOOST_CONCEPT_ASSERT((boost::Convertible<weight_reference, double>));
    109104      return *weight_;
    110105    }
  • trunk/yat/utility/GetlineIterator.cc

    r2919 r3295  
    33/*
    44  Copyright (C) 2009, 2012 Peter Johansson
     5  Copyright (C) 2014 Jari Häkkinen
    56
    67  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2526#include "GetlineIterator.h"
    2627
     28#include <istream>
    2729#include <string>
    2830
  • trunk/yat/utility/deprecate.h

    r2124 r3295  
    11#ifndef _theplu_yat_utility_deprecate_
    2 #define _theplu_yat_utility_deprecate_ 
     2#define _theplu_yat_utility_deprecate_
    33
    44// $Id$
    55
    66/*
    7   Copyright (C) 2008, 2009 Peter Johansson
     7  Copyright (C) 2008, 2009, 2014 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
  • trunk/yat/utility/stl_utility.h

    r3286 r3295  
    181181      : f_(f), g_(g), h_(h)
    182182    {
    183       BOOST_CONCEPT_ASSERT((boost::Convertible<typename G::result_type
    184                             , typename F::first_argument_type>));
    185       BOOST_CONCEPT_ASSERT((boost::Convertible<typename H::result_type
    186                             , typename F::second_argument_type>));
    187 
    188183    }
    189184
     
    258253      : f_(f), g_(g)
    259254    {
    260       BOOST_CONCEPT_ASSERT((boost::Convertible<typename G::result_type
    261                             , typename F::argument_type>));
    262255    }
    263256
     
    334327      : f_(f), g_(g)
    335328    {
    336       BOOST_CONCEPT_ASSERT((boost::Convertible<typename G::result_type
    337                             , typename F::argument_type>));
    338329    }
    339330
     
    412403      : f_(f), g_(g), h_(h)
    413404    {
    414       BOOST_CONCEPT_ASSERT((boost::Convertible<typename G::result_type
    415                             , typename F::first_argument_type>));
    416       BOOST_CONCEPT_ASSERT((boost::Convertible<typename H::result_type
    417                             , typename F::second_argument_type>));
    418405    }
    419406
  • trunk/yat/utility/utility.cc

    r3114 r3295  
    44  Copyright (C) 2005, 2006 Jari Häkkinen, Markus Ringnér
    55  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    6   Copyright (C) 2010, 2012, 2013 Peter Johansson
     6  Copyright (C) 2010, 2012, 2013, 2014 Peter Johansson
    77
    88  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    183183    mkdir_p(dirname(dir), mode);
    184184    mkdir(dir, mode);
     185  }
     186
     187
     188  void remove(const std::string& fn)
     189  {
     190    if (::remove(fn.c_str())) {
     191      std::string msg("remove: ");
     192      msg += fn;
     193      throw errno_error(msg);
     194    }
     195  }
     196
     197
     198  void rename(const std::string& from, const std::string& to)
     199  {
     200    if (::rename(from.c_str(), to.c_str())) {
     201      std::stringstream ss;
     202      ss << "rename" << from << " to " << to << ": ";
     203      throw errno_error(ss.str());
     204    }
    185205  }
    186206
  • trunk/yat/utility/utility.h

    r3288 r3295  
    306306     \see http://linux.die.net/man/3/remove
    307307
    308      \since New in yat 0.10
     308     \since New in yat 0.12
    309309   */
    310310  void remove(const std::string& fn);
     
    316316     \see http://linux.die.net/man/3/rename
    317317
    318      \since New in yat 0.10
     318     \since New in yat 0.12
    319319   */
    320320  void rename(const std::string& from, const std::string to);
     
    420420/// \endcond
    421421
     422
     423     No error if \a dir already exist. Make parent directories as needed.
     424
     425     \since New in yat 0.10
     426   */
     427  void mkdir_p(const std::string& dir, mode_t mode=0777);
     428
     429  /**
     430     same as C function remove but throws errno_error at failure
     431
     432     \see http://linux.die.net/man/3/remove
     433
     434     \since New in yat 0.12
     435   */
     436  void remove(const std::string& fn);
     437
     438  /**
     439     same as C function with same name but throws errno_error if error
     440     is encountered
     441
     442     \see http://linux.die.net/man/3/rename
     443
     444     \since New in yat 0.12
     445   */
     446  void rename(const std::string& from, const std::string& to);
     447
     448  /**
     449     In \a full_str replace every sub-string \a old_str with \a
     450     new_str;
     451
     452     \since New in yat 0.10
     453   */
     454  void replace(std::string& full_str, std::string old_str, std::string new_str);
    422455
    423456  // template implementations
Note: See TracChangeset for help on using the changeset viewer.