Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ThreadingJob.cc
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 protocols/comparative_modeling/ThreadingJob.cc
11 /// @author James Thompson
12 
15 
21 // AUTO-REMOVED #include <core/sequence/util.hh>
22 
24 #include <protocols/loops/Loop.hh>
25 #include <protocols/loops/Loops.hh>
26 
27 #include <basic/Tracer.hh>
28 
29 #include <core/types.hh>
30 
31 #include <core/pose/Pose.hh>
32 #include <utility/vector1.hh>
33 
34 
35 namespace protocols {
36 namespace comparative_modeling {
37 
39  core::pose::PoseCOP template_pdb,
41  std::string const & input_tag,
42  core::Size nstruct_max
43 ) : InnerJob( template_pdb, input_tag, nstruct_max ) {
44  alignment_ = alignment; // the alignment from the input file
45 
46  //fpd Make a transitve map from the template alignment to the template pdb seq
47  //fpd Accounts for missing density in the PDB
48  static basic::Tracer tr("protocols.comparative_modeling.ThreadingJob");
49  using namespace core::sequence;
50 
51  SequenceOP query_sequence(
52  new Sequence(
53  alignment->sequence( 1 )->ungapped_sequence(),
54  alignment->sequence( 1 )->id(),
55  alignment->sequence( 1 )->start()
56  )
57  );
58 
59  SequenceOP aligned_template(
60  alignment->sequence( 2 )->clone()
61  );
62 
63  SequenceOP t_align_seq(
64  new Sequence(
65  aligned_template->ungapped_sequence(),
66  aligned_template->id(),
67  aligned_template->start()
68  )
69  );
70 
71 
72  SequenceOP t_pdb_seq(
73  new Sequence (
74  template_pdb->sequence(),
75  alignment->sequence( 2 )->id(),
76  1
77  )
78  );
79 
80  // construct an intermediate alignment of the sequence from the alignment
81  // to the sequence in the PDB file.
82  SWAligner sw_align;
83  ScoringSchemeOP ss( new SimpleScoringScheme( 120, 0, -100, 0 ) );
84 
85  fasta2template_ = new core::sequence::SequenceAlignment( sw_align.align( t_align_seq, t_pdb_seq, ss ) );
86  nres_template_ = aligned_template->ungapped_length();
87 
88  // std::cerr << "OLD" << std::endl;
89  // std::cerr << *alignment << std::endl;
90  // std::cerr << "NEW" << std::endl;
91  // std::cerr << *alignment_ << std::endl;
92 }
93 
94 ///@brief returns the "standard" loop definition (as conservative as possible)
96  using namespace protocols::loops;
97  using namespace protocols::comparative_modeling;
99 
100  // remove loops that overlap stolen residues
101  Loops valid_loops;
102  for ( loops::Loops::const_iterator it = loops->begin(), it_end = loops->end(); it != it_end; ++it ) {
103  bool valid(true);
104  for ( Size ii = 1; ii <= extra_residues_to_steal_.size(); ++ii ) {
105  Size const extra_res( extra_residues_to_steal_[ii] );
106  if ( it->start() <= extra_res && extra_res <= it->stop() ) {
107  valid = false;
108  }
109  }
110  if ( valid ) valid_loops.add_loop( *it );
111  }
112 
113  return valid_loops;
114 }
115 
118 }
119 
122 }
123 
124 } // namespace comparative_modeling
125 } // namespace protocols