Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MatrixScoringScheme.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file MatrixScoringScheme.hh
11 /// @brief class definition for a given scoring scheme for an alignment.
12 /// @detailed Simply based on comparing single characters from two protein
13 /// sequences, along with affine gap penalties of the form penalty = A + Bk, where
14 /// A represents the penalty for starting a gap, and B represents the penalty for
15 /// extending a previously opened gap by k characters.
16 /// @author James Thompson
17 
18 #ifndef INCLUDED_core_sequence_MatrixScoringScheme_hh
19 #define INCLUDED_core_sequence_MatrixScoringScheme_hh
20 
21 #include <core/types.hh>
24 #include <core/chemical/AA.hh>
25 
26 #include <utility/io/izstream.fwd.hh>
27 #include <utility/file/FileName.fwd.hh>
28 
29 #include <utility/vector1_bool.hh>
30 
31 
32 namespace core {
33 namespace sequence {
34 
36 
37 public:
38 
40  // gap open and gap extend set to default parameters
41  // for NCBI BLASTP.
42  gap_open ( -11 );
43  gap_extend( -1 );
44  init_type();
45  }
46 
47  /// @brief ctor
49  Real open,
50  Real extend,
51  utility::file::FileName const & fn
52  )
53  {
54  read_from_file( fn );
55  gap_open ( open );
56  gap_extend( extend );
57  init_type();
58  }
59 
61  Real open,
62  Real extend,
64  ) : scoring_matrix_( matrix ) {
65  gap_open ( open );
66  gap_extend( extend );
67  init_type();
68  }
69 
70  /// @brief returns owning pointer to a new object with a deep copy of
71  /// this object's values.
73  return new MatrixScoringScheme(
74  gap_open(),
75  gap_extend(),
77  );
78  }
79 
80  /// @brief dtor
81  virtual ~MatrixScoringScheme() {}
82 
83  /// @brief Read an alignment matrix from the given database filename using the
84  /// NCBI BLOSUM format for matrices.
85  void read_from_database( std::string name="BLOSUM62" );
86  /// @brief Read an alignment matrix from the given filename using the
87  /// NCBI BLOSUM format for matrices.
88  void read_from_file( utility::file::FileName const & fn );
89  void read_data( utility::io::izstream & input );
90 
91  /// @brief Get the values for amino acid aa, in Rosetta aa order.
93  /// @brief Get the values for amino acid aa, in Rosetta aa order.
96 
97  virtual Real score( SequenceOP seq1, SequenceOP seq2, Size pos1, Size pos2 );
98 
99 private:
100  void init_type() {
101  type( "Matrix" );
102  }
103 
105 }; // class MatrixScoringScheme
106 
107 } // sequence
108 } // core
109 
110 #endif