Skip to content

Fix/fdr - #2953

Merged
timosachsenberg merged 10 commits into
OpenMS:developfrom
timosachsenberg:fix/FDR
Jan 24, 2018
Merged

Fix/fdr#2953
timosachsenberg merged 10 commits into
OpenMS:developfrom
timosachsenberg:fix/FDR

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

fixes #2942

@jpfeuffer tests are currently failing because some references are filtered in the current settings. Can you give me a hint how this is done properly for both files with / without groups?

@jpfeuffer

Copy link
Copy Markdown
Contributor

The relation between peptides and proteins depends heavily on the settings like keep_unreferenced proteins etc.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

so currently I apply these functions if something has been filtered.

+    if (filter_applied)
      {
 +      IDFilter::removeUnreferencedProteins(prot_ids, pep_ids);
 +      IDFilter::updateProteinReferences(pep_ids, prot_ids, true);
 +      IDFilter::updateHitRanks(prot_ids);
 +      IDFilter::updateHitRanks(pep_ids);
 +      IDFilter::removeEmptyIdentifications(pep_ids);
 +      // we want to keep "empty" protein IDs because they contain search meta data
      }

The critical points are:
IDFilter::removeUnreferencedProteins(prot_ids, pep_ids); I
IDFilter::updateProteinReferences(pep_ids, prot_ids, true); // true or false?

which are enabled/disabled by flags in the IDFilter tool.
Ideally I would go without these flags and be compatible with normal idXML but also with those that contain groups.
Do you know what the correct combination is?

@jpfeuffer

Copy link
Copy Markdown
Contributor

Okay I see.
Filtering by a cutoff in general (if performed on the same scores as inference, i.e. PPs) should not invalidate greedy resolution of the remaining associations.

Protein filtering will invalidate saved groups (ambiguity groups need to be completely rearranged, indistinguishable ones only lose members). I think it makes sense to remove unreferenced peptides afterwards although not necessary if they lose their references to proteins correctly.

Peptide filtering will invalidate all grouping equally badly. I currently can't think of a case where peptide filtering makes sense after protein inference (except for maybe reporting, although there I would report all and filter them externally)

@timosachsenberg

timosachsenberg commented Nov 2, 2017 •

Copy link
Copy Markdown
Contributor Author

Many of the test files changed. To put this in context:

1: default param, -PSM true -protein false
2: with runs separated, -algorithm:treat_runs_separately -PSM true -protein false
3: with charge variants individual, -algorithm:split_charge_variants -PSM true -protein false
4: with charge variants and no charge 1 decoys -> q_value 0) -PSM true -protein false
5: proteins only (input is derived from "THIRDPARTY/FidoAdapter_1_output.idXML"), default param, -PSM false -protein true
6: FDR filtering, -PSM true -protein false -FDR:PSM 0.05
7: FDR filtering, -PSM false -protein true -FDR:protein 0.05

@timosachsenberg

timosachsenberg commented Nov 2, 2017 •

Copy link
Copy Markdown
Contributor Author

1,2,3: correct All unreferenced proteins are removed.
4: correct. All unreferenced proteins are removed. All peptide hits are kept as is.
5: wrong? All proteins were removed.
6: correct. After PSM filtering by FDR, all unreferenced proteins are removed.
7: wrong? All proteins were removed.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@jpfeuffer can you take a look at test 5 and 7. I uploaded the test files that make the test pass. No proteins are contained in both cases. Is this expected?

@@ -5,7586 +5,6 @@
</SearchParameters>
<IdentificationRun date="2015-06-29T15:12:34" search_engine="Fido" search_engine_version="" search_parameters_ref="SP_0" >
<ProteinIdentification score_type="q-value" higher_score_better="false" significance_threshold="0" >

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this remove all Protein ids? Is this intended?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because in the input (FDR_output_1.idXML), all proteins have a score of 0. So the FDR for all will be #decoys / #all which is probably higher than the default cutoff. I think that was the reason for Timo's comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this make sense? I mean the q-value should be the minimal FDR so these should not be removed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the FDR calculation does not care about the type of score that is in there. It uses what is in there and calculates the FDR anew.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is weird that a dataset with already annotated q-values is used for FDR calculation AT ALL. That is what we want to compute here.

@jpfeuffer

Copy link
Copy Markdown
Contributor

I'm would be more comfortable if we had a mini test. With e.g. 10 proteins. Should be enough to test correct functionality.

@jpfeuffer jpfeuffer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a meaningful test for protein FDRs.

@OpenMS OpenMS deleted a comment from jpfeuffer Jan 23, 2018
@OpenMS OpenMS deleted a comment from jpfeuffer Jan 23, 2018
@OpenMS OpenMS deleted a comment from jpfeuffer Jan 23, 2018
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

I created the test files. Number 5 is from a normal search. Number 7 is manually created to check protein FDR filtering.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Still wondering if we can get an idXML in, kind of a canonical state by applying:

       IDFilter::removeUnreferencedProteins(prot_ids, pep_ids);
       IDFilter::updateProteinReferences(pep_ids, prot_ids, true);
       IDFilter::updateHitRanks(prot_ids);
       IDFilter::updateHitRanks(pep_ids);
       IDFilter::removeEmptyIdentifications(pep_ids);

before storing the idXML file.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@jpfeuffer windows and mac fails are unrelated

@jpfeuffer

Copy link
Copy Markdown
Contributor

Seems to work correctly. It would be nice though if you could test two more points:

  • If a peptide belongs to two proteins (one filtered, one kept)
  • Increase FDR so that you get a resulting decoy protein and a protein with q-val > 0
    Up to you. Minor suggestion.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@jpfeuffer regarding the second point. I think there should now be a target protein contained that has a lower score than a decoy protein (which is not reported).
Strangely it doesn't appear in the list. Can you double check?

@jpfeuffer

Copy link
Copy Markdown
Contributor

Hm at first glance I would say so, too.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

thanks for checking... my bad. Will fix

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

ok seems to work. strangely it keeps the decoy proteins in the filtered results. This is different for PSMs. Is this intended?

@jpfeuffer

Copy link
Copy Markdown
Contributor

Cool, looks much better now.
Well I think this is debatable. I would say usually you do not need decoys anymore after FDR calculation. And I think same defaults would be nice.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

ok I opened an issue: #3192

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

latest addition fixes #3192
I think I also addressed the other request (proteins get removed (in this case because it is a decoy) and the peptide hits are updated.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

failed tests unrelated... will merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FalseDiscoveryRate filter option does not work for proteins

3 participants