15 #include <core/types.hh>
20 #include <core/chemical/util.hh>
22 #include <core/id/SequenceMapping.hh>
23 #include <core/io/pdb/pdb_writer.hh>
29 #include <core/sequence/util.hh>
30 #include <core/sequence/Sequence.hh>
31 #include <core/sequence/SequenceAlignment.hh>
35 #include <core/pose/Pose.hh>
36 #include <core/pose/Pose.fwd.hh>
37 #include <core/pose/annotated_sequence.hh>
39 #include <protocols/comparative_modeling/PartialThreadingMover.hh>
55 #include <basic/options/keys/in.OptionKeys.gen.hh>
56 #include <basic/options/keys/cm.OptionKeys.gen.hh>
58 #include <core/import_pose/import_pose.hh>
61 #include <core/conformation/Residue.hh>
62 #include <core/kinematics/Jump.hh>
65 std::map< std::string, core::pose::Pose >
74 using core::import_pose::pose_from_file;
75 using namespace core::chemical;
77 ResidueTypeSetCOP rsd_set( rsd_set_from_cmd_line() );
78 map< string, Pose > poses;
81 for ( iter it = fn_list.begin(),
end = fn_list.end(); it !=
end; ++it ) {
84 core::import_pose::pose_from_file( pose, *rsd_set, *it , core::import_pose::PDB_file);
86 name = name.substr( 0, 5 );
95 main(
int argc,
char* argv [] ) {
105 using core::pose::PoseOP;
107 using core::import_pose::pose_from_file;
108 using core::pose::make_pose_from_sequence;
109 using protocols::comparative_modeling::PartialThreadingMover;
112 using namespace basic::options::OptionKeys;
113 using namespace core::chemical;
118 SequenceOP fasta_seq = core::sequence::read_fasta_file(
119 option[ in::file::fasta ]()[1]
123 vector1< string > align_fns =
option[ in::file::alignment ]();
126 option[ in::file::template_pdb ]()
140 for ( aln_iter aln_fn = align_fns.begin(), aln_end = align_fns.end();
141 aln_fn != aln_end; ++aln_fn
143 vector1< SequenceAlignment > alns = core::sequence::read_aln(
144 option[ cm::aln_format ](), *aln_fn
147 for ( vector1< SequenceAlignment >::iterator it = alns.begin(),
151 string const template_id( it->sequence(2)->id().substr(0,5) );
152 tr << *it << std::endl;
153 tr <<
"id " << it->sequence(2)->id() <<
" => " << template_id
155 string const ungapped_query( it->sequence(1)->ungapped_sequence() );
158 map< string, Pose >::iterator pose_it = poses.find( template_id );
159 if ( pose_it == poses.end() ) {
160 string msg(
"Error: can't find pose (id = "
164 tr.
Error << msg << std::endl;
166 Pose query_pose, template_pose;
167 make_pose_from_sequence(
170 fasta_seq->sequence(),
171 *(rsd_set_from_cmd_line().lock())
173 template_pose = pose_it->second;
174 PartialThreadingMover mover(*it,template_pose);
175 mover.apply(query_pose);
179 string const id_out( it->sequence(2)->id() );
184 core::id::SequenceMapping map( it->sequence_mapping(1,2) );
185 output <<
"REMARK query_anchored_aln ";
187 if ( map[
ii] ) output << fasta_seq->at(ii);
191 core::io::pdb::dump_pdb( query_pose, output );
198 tr.
Debug <<
"finished building partial models." << std::endl;
201 std::cout <<
"caught exception " << e.
msg() << std::endl;
virtual std::string const msg() const
utility::keys::KeyLookup< KeyType >::const_iterator const_iterator
Key collection iterators.
void init(int argc, char *argv[])
Command line init() version.
utility::keys::lookup::end< KeyType > const end
Platform independent operations on files (except I/O)
int main(int argc, char *argv[])
common derived classes for thrown exceptions
void flush_all_channels()
flush tracer buffer and flush buffers of all sub-channels ie: Fatal, Error, Warning, Info, Debug, Trace
std::string file_basename(const std::string &full_path)
std::map< std::string, core::pose::Pose > poses_from_cmd_line(utility::vector1< std::string > const &fn_list)
Program exit functions and macros.
File name class supporting Windows and UN*X/Linux format names.
rule< Scanner, options_closure::context_t > options
utility::options::OptionCollection option
OptionCollection global.
Output file stream wrapper for uncompressed and compressed files.
ocstream cout(std::cout)
Wrapper around std::cout.
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
bool file_exists(std::string const &path)
Does File Exist?
rule< Scanner, string_closure::context_t > name
ozstream: Output file stream wrapper for uncompressed and compressed files
Some std::string helper functions.
Program options global and initialization function.
THREAD_LOCAL basic::Tracer tr("struc_set_fragment_picker")