Skip to content

Commit

Permalink
Add psm and peptide counts to search_crosslink_lookup and search_loop…
Browse files Browse the repository at this point in the history
…link_lookup tables. Move getting those counts to proxl_base. Update web app to use those counts when PSM and Peptide cutoffs are defaults.
  • Loading branch information
danjasuw committed Oct 31, 2015
1 parent 15af2c8 commit 8dad5ee
Show file tree
Hide file tree
Showing 11 changed files with 697 additions and 561 deletions.
Binary file modified WebRoot/WEB-INF/lib/proxl_base.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ public class DefaultQValueCutoffConstants {
*/
public static final double PSM_Q_VALUE_CUTOFF_DEFAULT = 0.01;

/**
* This value must be kept in sync with the various fields that end with: _at_pt_01_q_cutoff
*/
public static final double PEPTIDE_Q_VALUE_CUTOFF_DEFAULT = 0.01;


}
142 changes: 100 additions & 42 deletions src/org/yeastrc/xlink/www/objects/SearchProteinCrosslink.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package org.yeastrc.xlink.www.objects;


import java.util.List;

import org.apache.log4j.Logger;
import org.yeastrc.xlink.dto.SearchDTO;
import org.yeastrc.xlink.www.searcher.SearchCrosslinkPeptideSearcher;
import org.yeastrc.xlink.www.searcher.SearchPeptideCrosslinkSearcher;
import org.yeastrc.xlink.www.searcher.SearchPsmSearcher;
import org.yeastrc.xlink.searchers.NumPeptidesForProteinCriteriaSearcher;
import org.yeastrc.xlink.searchers.NumPsmsForProteinCriteriaSearcher;
import org.yeastrc.xlink.utils.YRC_NRSEQUtils;



public class SearchProteinCrosslink implements IProteinCrosslink {

Expand Down Expand Up @@ -46,8 +47,23 @@ public void setProtein2Position(int protein2Position) {
public int getNumPsms() throws Exception {

try {
if( this.numPsms == null )
this.numPsms = SearchPsmSearcher.getInstance().getNumPsms( this );
if( this.numPsms == null ) {

this.numPsms =
NumPsmsForProteinCriteriaSearcher.getInstance().getNumPsmsForCrosslink(
this.getSearch().getId(),
this.getPsmCutoff(),
this.getPeptideCutoff(),
this.getProtein1().getNrProtein().getNrseqId(),
this.getProtein2().getNrProtein().getNrseqId(),
this.getProtein1Position(),
this.getProtein2Position() );

// WAS

// this.numPsms = SearchPsmSearcher.getInstance().getNumPsms( this );

}

return this.numPsms;

Expand All @@ -60,24 +76,26 @@ public int getNumPsms() throws Exception {
throw e;
}
}

public int getNumUniquePsms() {
return numUniquePsms;
}
public void setNumUniquePsms(int numUniquePsms) {
this.numUniquePsms = numUniquePsms;
}
public double getPsmCutoff() {
return psmCutoff;
}
public void setPsmCutoff(double cutoff) {
this.psmCutoff = cutoff;
}

public int getNumLinkedPeptides() throws Exception {

try {
if( this.numLinkedPeptides == -1 )
this.numLinkedPeptides = SearchCrosslinkPeptideSearcher.getInstance().getNumLinkedPeptides( this );
if( this.numLinkedPeptides == -1 ) {

this.numLinkedPeptides =
NumPeptidesForProteinCriteriaSearcher.getInstance()
.getNumLinkedPeptidesForCrosslink(
this.getSearch().getId(),
this.getPsmCutoff(),
this.getPeptideCutoff(),
this.getProtein1().getNrProtein().getNrseqId(),
this.getProtein2().getNrProtein().getNrseqId(),
this.getProtein1Position(),
this.getProtein2Position() );

// WAS
// this.numLinkedPeptides = SearchCrosslinkPeptideSearcher.getInstance().getNumLinkedPeptides( this );
}

return this.numLinkedPeptides;

Expand All @@ -90,11 +108,27 @@ public int getNumLinkedPeptides() throws Exception {
throw e;
}
}


public int getNumUniqueLinkedPeptides() throws Exception {

try {
if( this.numUniqueLinkedPeptides == -1 )
this.numUniqueLinkedPeptides = SearchCrosslinkPeptideSearcher.getInstance().getNumUniqueLinkedPeptides( this );
if( this.numUniqueLinkedPeptides == -1 ) {

this.numUniqueLinkedPeptides =
NumPeptidesForProteinCriteriaSearcher.getInstance()
.getNumUniqueLinkedPeptidesForCrosslink(
this.getSearch().getId(),
this.getPsmCutoff(),
this.getPeptideCutoff(),
this.getProtein1().getNrProtein().getNrseqId(),
this.getProtein2().getNrProtein().getNrseqId(),
this.getProtein1Position(),
this.getProtein2Position(),
YRC_NRSEQUtils.getDatabaseIdFromName( this.getSearch().getFastaFilename() ) );
// WAS
// this.numUniqueLinkedPeptides = SearchCrosslinkPeptideSearcher.getInstance().getNumUniqueLinkedPeptides( this );
}

return this.numUniqueLinkedPeptides;

Expand All @@ -108,6 +142,48 @@ public int getNumUniqueLinkedPeptides() throws Exception {
}
}



/**
* Only set if the PSM and Peptide Cutoffs match
* @param numPsms
*/
public void setNumPsms(Integer numPsms) {
this.numPsms = numPsms;
}

/**
* Only set if the PSM and Peptide Cutoffs match
* @param numLinkedPeptides
*/
public void setNumLinkedPeptides(int numLinkedPeptides) {
this.numLinkedPeptides = numLinkedPeptides;
}

/**
* Only set if the PSM and Peptide Cutoffs match
* @param numUniqueLinkedPeptides
*/
public void setNumUniqueLinkedPeptides(int numUniqueLinkedPeptides) {
this.numUniqueLinkedPeptides = numUniqueLinkedPeptides;
}




public int getNumUniquePsms() {
return numUniquePsms;
}
public void setNumUniquePsms(int numUniquePsms) {
this.numUniquePsms = numUniquePsms;
}
public double getPsmCutoff() {
return psmCutoff;
}
public void setPsmCutoff(double cutoff) {
this.psmCutoff = cutoff;
}



public double getPeptideCutoff() {
Expand All @@ -123,24 +199,6 @@ public void setSearch(SearchDTO search) {
this.search = search;
}

public List<SearchPeptideCrosslink> getPeptides() throws Exception {

try {
if( this.peptides == null )
this.peptides = SearchPeptideCrosslinkSearcher.getInstance().searchOnSearchProteinCrosslink( this );

return this.peptides;

} catch ( Exception e ) {

String msg = "Exception in getPeptides()";

log.error( msg, e );

throw e;
}
}



public double getBestPSMQValue() {
Expand Down Expand Up @@ -168,9 +226,9 @@ public void setBestPeptideQValue(Double bestPeptideQValue) {
private int numUniquePsms;

private int numLinkedPeptides = -1;
List<SearchPeptideCrosslink> peptides;

private int numUniqueLinkedPeptides = -1;

private double psmCutoff;
private double peptideCutoff;
private double bestPSMQValue;
Expand Down

0 comments on commit 8dad5ee

Please sign in to comment.