Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.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 src/core/sequence/sequtil.hh
11 /// @brief small bundle of utilities for dealing with sequences
12 /// @author James Thompson
13 
14 #ifndef INCLUDED_core_sequence_util_hh
15 #define INCLUDED_core_sequence_util_hh
16 
17 // C/C++ headers
18 // AUTO-REMOVED #include <string>
19 
20 // Utility headers
21 #include <utility/vector1.fwd.hh>
22 
23 // Project headers
24 #include <core/types.hh>
26 // AUTO-REMOVED #include <core/pose/Pose.hh>
27 
28 // Package headers
33 
34 #include <core/pose/Pose.fwd.hh>
35 #include <utility/vector1.hh>
36 
37 
38 namespace core {
39 namespace sequence {
40 
41 /// @brief Populates the non-null vector <alignments> with all of the sequence
42 /// alignments found in <files>. Each alignment is required to have
43 /// format <format>.
44 void read_all_alignments(const std::string& format,
45  const utility::vector1<std::string>& files,
47 
48 /// @brief helper function for reading a SequenceMapping from an alignment
49 /// file.
50 void
52  std::string const & filename,
53  std::string & seq1,
54  std::string & seq2,
55  core::sequence::DerivedSequenceMapping & mapping // from numbering in sequence 1 to numbering in sequence 2
56 );
57 
58 /// @brief Read in sequences from a fasta-formatted file.
62 
63 /// @brief Read in a SequenceMapping from a file. File
64 /// format is super-simple, it just contains single
65 /// lines like this that claim that residue resi and
66 /// resj are aligned: resi resj
68 
70  std::string const & format,
71  std::string const & filename
72 );
73 
75 
76 /// @brief read generalized alignment format.
78  std::istream & input
79 );
80 
82  std::string const & filename
83 );
84 
86  std::string const & filename
87 );
88 
89 // @brief returns the number of correctly aligned positions in candidate_aln
90 // relative to true_aln.
92  SequenceAlignment & candidate_aln,
93  SequenceAlignment & true_aln
94 );
95 
96 /// @brief takes the sequences in the provided vector1 and makes them match
97 /// the alignment in aln_to_steal by matching gaps. This assumes that the
98 /// ungapped sequences at index j in the vector1< SequenceOP > match the
99 /// ungapped sequences at index j in aln_to_steal.
100 SequenceAlignment steal_alignment(
101  SequenceAlignment aln_to_steal,
103 );
104 
105 /// @brief Constructs a SequenceAlignment from the given SequenceMapping and
106 /// the two sequences.
107 SequenceAlignment mapping_to_alignment(
108  core::id::SequenceMapping const & mapping,
109  SequenceOP seq1,
110  SequenceOP seq2
111 );
112 
113 /// @brief Assuming that map1 maps sequence A to sequence B, and map2 maps
114 /// sequence B to sequence C, this function returns the SequenceMapping
115 /// representing the direct map of sequence A to sequence C.
117  core::id::SequenceMapping const & map1,
118  core::id::SequenceMapping const & map2
119 );
120 
121 /// @brief Generates a mapping of sequence 1 onto sequence 2 using dynamic
122 /// programming with a simple scoring framework.
126 );
127 
128 /// @brief Generate a naive sequence alignment between two sequences.
132 );
133 
135  core::pose::Pose & pose1,
136  core::pose::Pose & pose2
137 );
138 
143 );
144 
147  core::pose::Pose & pose
148 );
149 
152  core::pose::Pose & pose
153 );
154 /*
155 core::Real
156 calpha_superimpose_via_alignment(
157  core::pose::Pose & mod_pose,
158  core::pose::Pose const & ref_pose,
159  core::sequence::SequenceAlignment const & aln
160 ); */
161 
164  core::pose::Pose & mod_pose,
165  core::pose::Pose const & ref_pose,
166  core::id::SequenceMapping const & mapping // mod_pose -> ref_pose
167 );
168 
169 } // sequence
170 } // core
171 
172 #endif