1 #ifndef UTIL_SEQUTIL___SEQUTIL_MANIP__HPP 2 #define UTIL_SEQUTIL___SEQUTIL_MANIP__HPP 3 4 /* $Id: sequtil_manip.hpp 103491 2007-05-04 17:18:18Z kazimird $ 5 * =========================================================================== 6 * 7 * PUBLIC DOMAIN NOTICE 8 * National Center for Biotechnology Information 9 * 10 * This software/database is a "United States Government Work" under the 11 * terms of the United States Copyright Act. It was written as part of 12 * the author's official duties as a United States Government employee and 13 * thus cannot be copyrighted. This software/database is freely available 14 * to the public for use. The National Library of Medicine and the U.S. 15 * Government have not placed any restriction on its use or reproduction. 16 * 17 * Although all reasonable efforts have been taken to ensure the accuracy 18 * and reliability of the software and data, the NLM and the U.S. 19 * Government do not and cannot warrant the performance or results that 20 * may be obtained by using this software or data. The NLM and the U.S. 21 * Government disclaim all warranties, express or implied, including 22 * warranties of performance, merchantability or fitness for any particular 23 * purpose. 24 * 25 * Please cite the author in any work or product based on this material. 26 * 27 * =========================================================================== 28 * 29 * Author: Mati Shomrat 30 * 31 * File Description: 32 * Various sequnce manipulations 33 */ 34 #include <corelib/ncbistd.hpp> 35 #include <corelib/ncbistr.hpp> 36 #include <vector> 37 38 #include <util/sequtil/sequtil.hpp> 39 40 41 BEGIN_NCBI_SCOPE 42 43 44 ///////////////////////////////////////////////////////////////////////////// 45 // 46 // Sequence Manipulations 47 // 48 49 50 class NCBI_XUTIL_EXPORT CSeqManip 51 { 52 public: 53 54 // types 55 typedef CSeqUtil::TCoding TCoding; 56 57 // Reverse 58 static SIZE_TYPE Reverse(const string& src, TCoding src_coding, 59 TSeqPos pos, TSeqPos length, 60 string& dst); 61 static SIZE_TYPE Reverse(const vector<char>& src, TCoding src_coding, 62 TSeqPos pos, TSeqPos length, 63 vector<char>& dst); 64 static SIZE_TYPE Reverse(const char* src, TCoding src_coding, 65 TSeqPos pos, TSeqPos length, 66 char* dst); 67 68 // Complement 69 static SIZE_TYPE Complement(const string& src, TCoding src_coding, 70 TSeqPos pos, TSeqPos length, 71 string& dst); 72 static SIZE_TYPE Complement(const vector<char>& src, TCoding src_coding, 73 TSeqPos pos, TSeqPos length, 74 vector<char>& dst); 75 static SIZE_TYPE Complement(const char* src, TCoding src_coding, 76 TSeqPos pos, TSeqPos length, 77 char* dst); 78 79 // Reverse + Complement 80 81 // place result in an auxiliary container 82 static SIZE_TYPE ReverseComplement(const string& src, TCoding src_coding, 83 TSeqPos pos, TSeqPos length, 84 string& dst); 85 static SIZE_TYPE ReverseComplement(const vector<char>& src, TCoding src_coding, 86 TSeqPos pos, TSeqPos length, 87 vector<char>& dst); 88 static SIZE_TYPE ReverseComplement(const char* src, TCoding src_coding, 89 TSeqPos pos, TSeqPos length, 90 char* dst); 91 92 // in place operation 93 static SIZE_TYPE ReverseComplement(string& src, TCoding src_coding, 94 TSeqPos pos, TSeqPos length); 95 static SIZE_TYPE ReverseComplement(vector<char>& src, TCoding src_coding, 96 TSeqPos pos, TSeqPos length); 97 static SIZE_TYPE ReverseComplement(char* src, TCoding src_coding, 98 TSeqPos pos, TSeqPos length); 99 }; 100 101 102 END_NCBI_SCOPE 103 104 105 #endif /* UTIL_SEQUTIL___SEQUTIL_MANIP__HPP */ 106