You are here

input_score_filter not taken by program cluster ?

10 posts / 0 new
Last post
input_score_filter not taken by program cluster ?

Hi, I have Rosetta 3.4 here.
When I run cluster using parameter -cluster:input_score_filter , it seems to me the parameter is just ignored and all decoys (no matter its score is higher or lower than the limit) are considered. I got the same results no matter I set the parameter or not. I read the source file at rosetta_source/src/apps/public/ and it seems variable input_score_filter is not used (together with some other parameters). Function GatherPosesMover::set_filter in rosetta_source/src/protocols/cluster/ seems never invoked anywhere.

Post Situation: 
Mon, 2012-06-11 09:14

You are correct, the flag is not used. I'm going to remove it since it doesn't work anyway.

Sun, 2012-06-24 14:12

When I read the cluster code, it seems to me the parameter input_score_filter is indeed considered in clustering.
Just the getopt did not properly read in the parameter.

Mon, 2012-06-25 05:00

Where do you see functional code for input_score_filter in The option is there, but it's not hooked up to anything. If there's code to hook it up to I can do that instead (and return a patch to you; although at that point you'd already know how to fix it yourself)

Tue, 2012-06-26 14:37

in src/protocols/cluster/

there is a function setting filter value:

void GatherPosesMover::set_filter( Real filter ) {
filter_ = filter;

this variable filter_ is used in

void GatherPosesMover::apply( Pose & pose ) {

// filter structures if the filter is active
if ( score > filter_ ) return; // ignore pose if filter value is too high

It is just the function set_filter() is not invoked in the cluster interface to digest user-input filter value.

Wed, 2012-06-27 01:47

try adding

mover_add_structures->set_filter( option[ OptionKeys::cluster::input_score_filter ].value());

After the line where mover_add_structures is created ( mover_add_structures->set_filter( option[ OptionKeys::cluster::input_score_filter ].value()); ). If that works I'll commit it for 3.5.

Wed, 2012-06-27 14:06

no, there is not such a variable (mover_add_structures) in the file. Thus I went ahead and add one line in


and the line I added is:

clustering->set_filter( option[basic::options::OptionKeys::cluster::input_score_filter ]() );

after the lines setting up all other parameters. I tested it afterwards and it did filter out decoys correctly.

Thu, 2012-06-28 03:10

Additional modification:

I was having the exact same problem (cluster was ignoring the input_score_filter). In addition to the correction that you provide above (i.e. using the set_filter member function of "clustering"), the input_score_filter also needs to be passed to the "mover_add_structures" pointer, i.e.:

mover_add_structures->set_filter(option[OptionKeys::cluster::input_score_filter ]());

The "clustering" variable takes care of the first 400 structures, while the "mover_add_structures" handles the remaining structures in the silent file. Both need to known about the input_score_filter.

However, what I really want cluster to do is *only* read in structures that pass the input_score_filter. Currently, cluster attempts to read in the entire silent file (for which I do not have sufficient memory to store). Looking through the code, this does not seem like a trivial modification. The SilentFileData::read_stream function attempts to load all structures into memory (instead of "just in time" streaming). While one could hack in a score filter variable to SilentFileData (to only store structures with score <= input_filter_score), it would be nicer to have SilentFileData read a silent file "just in time" and in relatively small chunks. Is there some reason that both the reading and storing of structures from a silent file is performed by a single class? Why not have a SilentFileStream class (for reading but not storing) and a SilentFileData class (for storing but not reading)?

Tue, 2012-07-24 08:44

I can't (well, I won't) comment on the silent file functionality.

There may be a way to get the behavior you want without writing C++:

A) strip your existing silent file into a score file (grep "^SCORE:" silent_file > score_file)

B) sort the scorefile by total score (sort -n -k2 score_file > sorted_score_file)

C) cut off the scorefile at the desired filter point with a text editor

D) convert the scorefile into a tags file (awk "{print $NF}" sorted_cut_score_file > tagsfile)

E) cycle the old silent file through score_jd2, with -out:file:silent and -in:file:tags `cat tagsfile` (backticks to print tags file into tags option

The result of step E should be a cut-down silent file only containing the structures above the score size you wanted. There may be a way to go straight to step E with a filtering argument to score_jd2. You could definitely go straight to step E with a filter using RosettaScripts but I can't do that off the top of my head.

Tue, 2012-07-24 09:24

NOTE: single quotes should be used in step D) :


<code>awk '{print $NF}' sorted_cut_score_file > tagsfile</code>

Fri, 2014-10-31 04:49