Example #1
0
	private void WriteProteinList( TextWriter w, Tag tr, Protein.EvidenceType evidence ) {
		Tag a = new Tag( evidence == Protein.EvidenceType.Filtered ? null : "a", "href" );
		Tag td = new Tag( "td" );
		Tag tdr = new Tag( "td", "rowspan" );
		Tag tdc = new Tag( "td", "colspan" );
		
		foreach( Protein p in Proteins ) {
			if( p.Evidence != evidence )
				continue;
			if( p.Subset.Count == 0 ) {
				w.Write( tr.Render(
					td.Render(a.Render("#"+p.Accession,p.EntryEx))+
					td.Render(p.Evidence.ToString())+
					tdc.Render("2",Peptides2Html(p))+
					td.Render(p.Desc) ));
				continue;
			}
			w.WriteLine( tr.Render(
				tdr.Render(p.Subset.Count.ToString(),p.Entry)+
				tdr.Render(p.Subset.Count.ToString(),p.Evidence.ToString())+
				td.Render(a.Render("#"+p.Subset[0].Accession,p.Subset[0].EntryEx)+": ")+
				td.Render(Peptides2Html(p.Subset[0]))+
				td.Render(p.Subset[0].Desc) ));
			tr.Hold = true;
			for( int i = 1; i < p.Subset.Count; i++ )
				w.WriteLine( tr.Render(
					td.Render(a.Render("#"+p.Subset[i].Accession,p.Subset[i].EntryEx)+": ")+
					td.Render(Peptides2Html(p.Subset[i]))+
					td.Render(p.Subset[i].Desc) ));
			tr.Hold = false;
		}
	}
Example #2
0
	private void WriteProteinDetails( TextWriter w, Protein.EvidenceType evidence ) {
		foreach( Protein p in Proteins ) {
			if( p.Evidence != evidence )
				continue;
			if( p.Subset.Count == 0 ) {
				WriteProteinDetails( w, p );
				continue;
			}
			foreach( Protein p2 in p.Subset )
				WriteProteinDetails( w, p2 );
		}
	}
Example #3
0
        private void UpdatePdhCvs(ProteinDetectionHypothesisType pdh, Protein.EvidenceType evidence)
        {
            List <AbstractParamType> list = new List <AbstractParamType>();

            foreach (AbstractParamType item in pdh.Items)
            {
                if (!item.name.Contains("PAnalyzer") && !item.name.Contains("leading"))
                {
                    list.Add(item);
                }
            }
            CVParamType ev = new CVParamType(), ld = new CVParamType();

            ev.cvRef = "PSI-MS";
            ld.cvRef = "PSI-MS";
            switch (evidence)
            {
            case Protein.EvidenceType.Conclusive:
                ev.accession = "MS:1002213";
                ev.name      = "PAnalyzer:conclusive protein";
                ld.accession = "MS:1002401";
                ld.name      = "leading protein";
                break;

            case Protein.EvidenceType.Indistinguishable:
                ev.accession = "MS:1002214";
                ev.name      = "PAnalyzer:indistinguishable protein";
                ld.accession = "MS:1002401";
                ld.name      = "leading protein";
                break;

            case Protein.EvidenceType.Group:
                ev.accession = "MS:1002216";
                ev.name      = "PAnalyzer:ambiguous group member";
                ld.accession = "MS:1002401";
                ld.name      = "leading protein";
                break;

            case Protein.EvidenceType.NonConclusive:
                ev.accession = "MS:1002215";
                ev.name      = "PAnalyzer:non-conclusive protein";
                ld.accession = "MS:1002402";
                ld.name      = "non-leading protein";
                break;

            default:                    // filtered
                return;
            }
            list.Add(ld);
            list.Add(ev);
            pdh.Items = list.ToArray();
        }
Example #4
0
	/// <summary>
	/// Parses the confidence enum to a string.
	/// </summary>
	public string ParseConfidence( Protein.EvidenceType e ) {
		switch( e ) {
			case Protein.EvidenceType.Conclusive:
				return "conclusive";
			case Protein.EvidenceType.Group:
				return "ambiguous group";
			case Protein.EvidenceType.Indistinguishable:
				return "indistinguishable";
			case Protein.EvidenceType.NonConclusive:
				return "non conclusive";
		}
		return e.ToString();
	}
Example #5
0
	/// <summary>
	/// Builds a PDH for the current protein
	/// </summary>
	private PSIPIanalysisprocessProteinDetectionHypothesisType BuildHypothesis( Protein p, Protein.EvidenceType ev ) {
		PSIPIanalysisprocessProteinDetectionHypothesisType h = new PSIPIanalysisprocessProteinDetectionHypothesisType();
		h.id = "PDH_" + p.Accession;
		h.DBSequence_ref = p.DBRef;
		if( p.Evidence == Protein.EvidenceType.NonConclusive || p.Evidence == Protein.EvidenceType.Filtered )
			h.passThreshold = false;
		else
			h.passThreshold = true;
		List<PeptideHypothesisType> listPeptides = new List<PeptideHypothesisType>();
		foreach( Peptide f in p.Peptides ) {
			PeptideHypothesisType peptide = new PeptideHypothesisType();
			peptide.PeptideEvidence_Ref = f.Names[p.DBRef];
			listPeptides.Add( peptide );
		}
		if( listPeptides.Count > 0 )
			h.PeptideHypothesis = listPeptides.ToArray();
		h.cvParam = new FuGECommonOntologycvParamType[1];
        h.cvParam[0] = new FuGECommonOntologycvParamType(
        		"Protein Inference Confidence Category",
        		"MS:1001600", "PSI-MS" );
        h.cvParam[0].value = ParseConfidence( ev );
		return h;
	}