Member Site › Forums › Rosetta 3 › Rosetta 3 – General › input_score_filter not taken by program cluster ?
- This topic has 9 replies, 4 voices, and was last updated 10 years, 4 months ago by
Anonymous.
-
AuthorPosts
-
-
June 11, 2012 at 4:14 pm #1302
Anonymous
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/cluster.cc 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/cluster.cc seems never invoked anywhere.
-
June 24, 2012 at 9:12 pm #7300
Anonymous
You are correct, the flag is not used. I’m going to remove it since it doesn’t work anyway.
-
June 25, 2012 at 12:00 pm #7304
attesor
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. -
June 26, 2012 at 9:37 pm #7336
Anonymous
Where do you see functional code for input_score_filter in cluster.cc? 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)
-
June 27, 2012 at 8:47 am #7338
attesor
in src/protocols/cluster/cluster.cc
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.
-
June 27, 2012 at 9:06 pm #7343
Anonymous
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.
-
June 28, 2012 at 10:10 am #7347
attesor
no, there is not such a variable (mover_add_structures) in the file. Thus I went ahead and add one line in
src/apps/public/cluster.cc
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.
-
July 24, 2012 at 3:44 pm #7447
Anonymous
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)?
-
July 24, 2012 at 4:24 pm #7448
Anonymous
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)
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.
-
October 31, 2014 at 11:49 am #10508
Anonymous
NOTE: single quotes should be used in step D) :
<code>awk '{print $NF}' sorted_cut_score_file > tagsfile</code>
-
-
AuthorPosts
- You must be logged in to reply to this topic.