SystemsGenetics / KINC

Knowledge Independent Network Construction
MIT License
11 stars 4 forks source link

Fix filtering #125

Closed spficklin closed 4 years ago

spficklin commented 4 years ago

I think it's time to submit this is a pull request. It has fixed several issues with the conditional-specific filtering. I'm not 100% sure all is fixed, but I don't see a reason to hold off on these fixes.

Here are a list of fixes that have been applied:

  1. The r-squared and p-value filtering, if both provided, were not both applied. So long as one met the threshold the entire edge/cluster was accepted for inclusion in the output. This has been fixed, now if a p-value and an r-squared value are provided both must be met to pass the edge through.
  2. If missing values were present in the annotation matrix, they were not handled properly.
  3. There was a bug in detecting the type of data in the columns of the annotation matrix. Previously it only looked at the first few lines to determine the type, but now it looks through the entire file.
  4. There was a bug in the way the hypergeometric test was performed. Fixed...
  5. There was inconsistency in the output of the full text, minimal and graphML outputs of KINC. For example, the filtering would be applied but would only occur for the full text output. If someone selected minimial or graphML it would not filter. This has been fixed by adding a new net_writer class and new child classes for each type of output: text, minimal and graphml. That net_writer class is responsible for determining which edges should be included. The child classes are just responsible for writing the output in the correct format for whatever they are given.
  6. I added a new tidy output class that reorganizes the edges into a more "tidy" format. Here the edge can occur in the file for as many conditions that pass the p-value or r-squared tests. This makes it a whole lot easier to work with in R, and despite that we might have duplicate edges, allows us to color edges by condition in Cytoscape.
bentsherman commented 4 years ago

I have cleaned everything up to my liking. Looks good!

spficklin commented 4 years ago

Thanks Ben! That was quick :-)