Changeset 3384
- Timestamp:
- Mar 11, 2015, 4:02:19 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/bam.cc
r3359 r3384 1 1 // $Id$ 2 2 // 3 // Copyright (C) 2013, 2014 Peter Johansson3 // Copyright (C) 2013, 2014, 2015 Peter Johansson 4 4 // 5 5 // This program is free software; you can redistribute it and/or modify … … 105 105 if (!suite.add(same_query_name(b, bam))) 106 106 suite.err() << "error: \n'" << b.name() << "'\n'" << bam.name() << "'\n"; 107 if (!suite.add(!less_query_name(b, bam))) 108 suite.err() << "error: less_query_name:\n'" 109 << b.name() << "'\n'" << bam.name() << "'\n"; 110 111 BamLessName less_name; 112 if (!suite.add(!less_name(b, bam))) 113 suite.err() << "error: BamLessName:\n'" 114 << b.name() << "'\n'" << bam.name() << "'\n"; 107 115 108 116 if (!suite.add(b.sequence()==bam.sequence())) -
trunk/yat/omic/BamRead.cc
r3355 r3384 2 2 3 3 /* 4 Copyright (C) 2012, 2013, 2014 Peter Johansson4 Copyright (C) 2012, 2013, 2014, 2015 Peter Johansson 5 5 6 6 This file is part of the yat library, http://dev.thep.lu.se/yat … … 441 441 442 442 443 bool less_query_name(const BamRead& lhs, const BamRead& rhs) 444 { 445 return std::lexicographical_compare(lhs.name(), 446 lhs.name()+lhs.core().l_qname, 447 rhs.name(), 448 rhs.name()+rhs.core().l_qname); 449 } 450 451 443 452 void swap(BamRead& lhs, BamRead& rhs) 444 453 { 445 454 lhs.swap(rhs); 446 455 } 456 447 457 448 458 bool same_query_name(const BamRead& lhs, const BamRead& rhs) … … 501 511 } 502 512 513 514 bool BamLessName::operator()(const BamRead& lhs, const BamRead& rhs) const 515 { 516 return less_query_name(lhs, rhs); 517 } 518 503 519 }}} -
trunk/yat/omic/BamRead.h
r3380 r3384 5 5 6 6 /* 7 Copyright (C) 2012, 2013, 2014 Peter Johansson7 Copyright (C) 2012, 2013, 2014, 2015 Peter Johansson 8 8 9 9 This file is part of the yat library, http://dev.thep.lu.se/yat … … 371 371 372 372 /** 373 return \c true if lhs query name is less than rhs query name 374 375 \see BamRead::name() 376 377 \since New in yat 0.13 378 379 \relates BamRead 380 */ 381 bool less_query_name(const BamRead& lhs, const BamRead& rhs); 382 383 /** 373 384 Functor to compare two reads with respect to their leftmost 374 385 coordinate. … … 411 422 }; 412 423 424 /** 425 Functor to compare two reads with respect to their query names. 426 427 \see BamRead 428 \see less_query_name(const BamRead&, const BamRead&) 429 430 \since New in yat 0.13 431 */ 432 struct BamLessName 433 : public std::binary_function<const BamRead&, const BamRead&, bool> 434 { 435 /** 436 \return \c true if lhs query name is less than rhs query name 437 */ 438 bool operator()(const BamRead& lhs, const BamRead& rhs) const; 439 }; 440 413 441 }}} 414 442 #endif
Note: See TracChangeset
for help on using the changeset viewer.