You are here

Problem with outputing decoys in the process of AbinitioRelax

4 posts / 0 new
Last post
Problem with outputing decoys in the process of AbinitioRelax

Dear all,

I am new to rosetta and trying to record the information in the process of AbinioRelax followed by analysis. In this case,it's necessary to output plenty of decoys generated after fragment assembly.However,I can't output these decoys to just one file.Using the function "pose.dump_pdb()",I can output them to mutiple .pdb files,which is  not convenient and take too much time.

I found there is a way to figure out this problem:using silent file.Could anyone tell me how to output decoys to one silent file  with detailed procedures?It is better if anyone can prvide relevant C++ source code or other methods to this problem.I very appreciate any help and advise.

Thank you.


Post Situation: 
Thu, 2017-07-13 23:27

Writing to a silent file is a little involved, you can take a look at src/protocols/jd2/ for an example of how the main silent file output works. It's probably a little hard to follow, as it's written to be part of the IO framework.

It basically boils down to the following (caution, not tested):

std::string tag("pose_name_0001");
std::string silent_struct_type("binary");
std::string silent_filename("filename.out");

core::io::silent::SilentFileOptions opts;

core::io::silent::SilentFileDataOP sfd( new SilentFileData( opts ) );

core::io::silent::SilentStructOP ss = core::io::silent::SilentStructFactory::get_instance()->get_silent_struct( silent_struct_type, opts );
ss->fill_struct( pose, tag );
sfd->write_silent_struct( ss, silentfilename );


The indirection of SilentStruct/SilentFileData is because there's flexibility in different silent struct types, as well as writing multiple silent structs at once. If you're curious, take a look at the SilentFileData/SilentStruct/SilentFileOptions definitions for additional functions/methods that might be useful.

Mon, 2017-07-17 08:39

Following your guidance,I have successfully achieve the function of outputting multiple conformations to one silent file with following  source codes:

std::string tag("count" + ObjexxFCL::string_of(flag_in)+ObjexxFCL::string_of(count));
std::string silent_struct_type("binary");
std::string silent_filename("filename.out");

core::io::silent::SilentFileDataOP sfd(new core::io::silent::SilentFileData());

core::io::silent::SilentStructOP ss = core::io::silent::SilentStructFactory::get_instance()->get_silent_struct(silent_struct_type);

Then,I got a binarry silent file uploaded at the bottom.

Now,I'm tryiing to get this set of conformations' ContactMap matrix in the file through contactMap protocol,with the follwing command:

~$ /home/miss77/rosetta_bin_linux_2016.32.58837_bundle/main/source/bin/contactMap.linuxgccdebug -in:file:silent filename.out

There''re many warnings occured that i can't understand: [ WARNING ] Number of atoms in pose and silent file disagree! Attempting to continue ... [ WARNING ]    (in residue MET:NtermProteinFull at 1  natoms_pose=19atm_seqpos 1  natoms_struct=7) [ WARNING ] Number of atoms in pose and silent file disagree! Attempting to continue ... [ WARNING ]    (in residue ASP at 2  natoms_pose=12atm_seqpos 2  natoms_struct=7)

I dont konow whether warnings above effect the final result and how to avoid these warnings.

I found these warnings's relavant source codes in .../rosetta_bin_linux_2016.32.58837_bundle/main/source/src/core/io/silent/

	for ( Size seqpos = 1; seqpos <= nres_pose; ++seqpos ) {
		core::conformation::Residue const & rsd = pose.residue(seqpos);
		Size natoms_pose = rsd.natoms() ;
		Size atm_seqpos =  symmetry_info()->get_asymmetric_seqpos( seqpos ) ;
		Size natoms_struct = atm_coords_[atm_seqpos].size();
		bool fixup( false );
		if ( natoms_pose != natoms_struct ) {

			// for backwards compatibility -- sorry for hack. If this
			// hack needs to be expanded, would be best to move into separate function.
			// N_ACETYLATION & C_METHYLAMIDATION lost 3 hydrogen atoms.
			if ( (natoms_pose + 3) == natoms_struct && rsd.has_variant_type( chemical::C_METHYLAMIDATION ) ) fixup = true;
			if ( (natoms_pose + 3) == natoms_struct && rsd.has_variant_type( chemical::N_ACETYLATION ) ) fixup = true;

			if ( !fixup )  {
				tr.Warning  << tr.Red << "[ WARNING ] "
					<< "Number of atoms in pose and silent file disagree! "
					<< "Attempting to continue ..." << std::endl
					<< "[ WARNING ]    (in residue " << pose.residue(seqpos).name() << " at " << seqpos
					<< "  natoms_pose=" << natoms_pose
					<< "atm_seqpos " << atm_seqpos << "  natoms_struct="
					<< natoms_struct << ")" << tr.Reset << std::endl;

There probably were some mistake when the silent file  was constructed.

Thanks for your reply.

File attachments: 
Tue, 2017-07-25 01:49

Those warnings - particularly if they're for all the residudes in the structures, indicate a fullatom/centroid mismatch.

Were the structures you saved intended to be fullatom or centroid structures? From the warning message, it looks like you have centroid structures in your silent file. The issue is that it looks like the application is expecting fullatom structures, and is getting slightly confused when it only gets the coordinates for the centroid structures.

If you intended to output centroid structures, you need to tell contactMap that you're providing centroid structures - try using the option `-in:file:centroid`  (If you wanted to tell Rosetta to expect fullatom structures in the silent file, it would be `-in:file:fullatom`, but that's normally - but not always - the default assumption.)

If you weren't expecting  to produce centroid structures in the silent file, you need to examine your saving proceedure. First check that the pose is indeed a fullatom pose at the point you're saving it. In case it is, you might want to fiddle with the silent file parameters, setting `-out:file:fullatom`, or the equivalent in the SilentFileOptions object.

Thu, 2017-08-03 08:50