TobiasRubel / Pathway-Reconstruction-Tools

2 stars 0 forks source link

ResponseNet not producing edges #12

Closed TobiasRubel closed 4 years ago

TobiasRubel commented 4 years ago

ResponseNet is outputting files of the form

\Problem name: 

Minimize
OBJROW: 0.50705 f_Q8TBF5_Q9UKB1 + 0.50705 f_Q9UKB1_Q8TBF5 + 0.50705 f_Q9UKB1_Q13112 + 0.50705 f_Q9UKB1_Q96N67 + 0.50705 f_Q9UKB1_P40227 + 0.12494 f_Q9UKB1_P32314 + 0.50705 f_Q9UKB1_Q8TB45 + 0.50705 f_Q9UKB1_Q86WA8 + 0.50705 f_Q9UKB1_Q9Y4>
 + 0.50705 f_Q9UKB1_Q96JJ3 + 0.50705 f_Q9UKB1_Q5VU97 + 0.50705 f_Q9UKB1_P52756 + 0.50705 f_Q9UKB1_Q9H0L4 + 0.50705 f_Q9UKB1_P50539 + 0.50705 f_Q9UKB1_Q13405 + 0.50705 f_Q9UKB1_O95429 + 0.50705 f_Q9UKB1_Q00535 + 0.50705 f_Q9UKB1_P26232 + >
 + 0.12494 f_Q9UKB1_Q13200 + 0.50705 f_Q9UKB1_Q9P2F8 + 0.50705 f_Q9UKB1_Q5T8D3 + 0.50705 f_Q9UKB1_Q8IW50 + 0.12494 f_Q9UKB1_P30291 + 0.50705 f_Q9UKB1_Q9Y679 + 0.50705 f_Q9UKB1_Q14145 + 0.50705 f_Q9UKB1_P82930 + 0.50705 f_Q9UKB1_P82933 + >

And telling report() to save them as the ranked-edges.csv file for a run. In particular, it is telling report() to look for a file with the substring 'response_net_gamma_%.2f' % (gamma) where gamma=20 for the time being.

From looking at the ResponseNet code, the relevant lines are:

    218     outprefix = 'response_net_gamma_%.2f' % (gamma)
    219     print('making prediction...')
    220     G = run(interactome, sources, sinks, gamma, '%s.lp' % (outprefix), verbose=verbose)
    221 
    222     print('saving prediction...')
    223     write_output(G, '%s.csv' % (outprefix),verbose=verbose)

So, as far as I can tell ResponseNet means to be writing these files, but I strongly suspect these are the intermediate files discussed in issue #9.

TobiasRubel commented 4 years ago

The problem has been solved. The issue wasn't in ResponseNet per se, but rather in the expectations report() has. report() assumes a unique file will have the prediction substring, but ResponseNet produces two files which are identical except for their suffixes. I solved the problem by deleting the intermediate filing before calling report().

At some point (maybe soon) we should rewrite the report code to be more robust, but for now things are working well enough.