public void TestDtaselect() { string header = "Locus Sequence Count Spectrum Count Sequence Coverage Length MolWt pI Validation Status Descriptive Name"; IPropertyConverter <IIdentifiedProtein> converter = IdentifiedProteinPropertyConverterFactory.GetInstance().GetConverters(header, '\t'); Assert.AreEqual(header, converter.Name); string line = "YDR050C 495 495 81.10% 249 26795.41 5.74 U YDR050C TPI1 SGDID:S000002457, Chr IV from 556470-555724, reverse complement, Verified ORF, \"Triose phosphate isomerase, abundant glycolytic enzyme; mRNA half-life is regulated by iron availability; transcription is controlled by activators Reb1p, Gcr1p, and Rap1p through binding sites in the 5' non-coding region\""; IIdentifiedProtein protein = new IdentifiedProtein(); converter.SetProperty(protein, line); Assert.AreEqual("YDR050C", protein.Name); Assert.AreEqual("TPI1 SGDID:S000002457, Chr IV from 556470-555724, reverse complement, Verified ORF, \"Triose phosphate isomerase, abundant glycolytic enzyme; mRNA half-life is regulated by iron availability; transcription is controlled by activators Reb1p, Gcr1p, and Rap1p through binding sites in the 5' non-coding region\"", protein.Description); Assert.AreEqual(495, protein.UniquePeptideCount); Assert.AreEqual(81.1, protein.Coverage); Assert.AreEqual(26795.41, protein.MolecularWeight); Assert.AreEqual(5.74, protein.IsoelectricPoint); for (int i = 0; i < 495; i++) { protein.Peptides.Add(new IdentifiedPeptide(new IdentifiedSpectrum())); } Assert.AreEqual(line, converter.GetProperty(protein)); }
public void TestNoredundant() { string header = " Reference PepCount UniquePepCount CoverPercent MW PI IdentifiedName"; IPropertyConverter <IIdentifiedProtein> converter = IdentifiedProteinPropertyConverterFactory.GetInstance().GetConverters(header, '\t'); Assert.AreEqual(header, converter.Name); string line = "\tIPI:IPI00784154.1|SWISS-PROT:P10809|TREMBL:B2R5M6;Q53QD5;Q53SE2;Q96RI4;Q9UCR6|ENSEMBL:ENSP00000340019;ENSP00000373620|REFSEQ:NP_002147;NP_955472|H-INV:HIT000031088 Tax_Id=9606 Gene_Symbol=HSPD1 60 kDa heat shock protein, mitochondrial 84 19 43.46% 61054.43 5.70 IPI:IPI00784154.1|SWISS-PROT:P10809|TREMBL:B2R5M6;Q53QD5;Q53SE2;Q96RI4;Q9UCR6|ENSEMBL:ENSP00000340019;ENSP00000373620|REFSEQ:NP_002147;NP_955472|H-INV:HIT000031088 Tax_Id=9606 Gene_Symbol=HSPD1 60 kDa heat shock protein, mitochondrial"; IIdentifiedProtein protein = new IdentifiedProtein(); converter.SetProperty(protein, line); Assert.AreEqual("IPI:IPI00784154.1|SWISS-PROT:P10809|TREMBL:B2R5M6;Q53QD5;Q53SE2;Q96RI4;Q9UCR6|ENSEMBL:ENSP00000340019;ENSP00000373620|REFSEQ:NP_002147;NP_955472|H-INV:HIT000031088", protein.Name); Assert.AreEqual("Tax_Id=9606 Gene_Symbol=HSPD1 60 kDa heat shock protein, mitochondrial", protein.Description); Assert.AreEqual(19, protein.UniquePeptideCount); Assert.AreEqual(43.46, protein.Coverage); Assert.AreEqual(61054.43, protein.MolecularWeight); Assert.AreEqual(5.7, protein.IsoelectricPoint); for (int i = 0; i < 84; i++) { protein.Peptides.Add(new IdentifiedPeptide(new IdentifiedSpectrum())); } Assert.AreEqual(line, converter.GetProperty(protein)); }
private void InitializeProteinFormat(IIdentifiedResult identifiedResult, string oldProteinHeader) { var proteins = identifiedResult.GetProteins(); List <string> proAnnotations = AnnotationUtils.GetAnnotationKeys(proteins); string newProteinHeader = StringUtils.GetMergedHeader(oldProteinHeader, proAnnotations, '\t'); ProteinFormat = new LineFormat <IIdentifiedProtein>(IdentifiedProteinPropertyConverterFactory.GetInstance(), newProteinHeader, GetEngineName(), proteins); }
public IdentifiedProteinTextWriter(string proteinHeader, IEnumerable <IIdentifiedProtein> proteins) { this._proteins = proteins; this._annotationKeys = AnnotationUtils.GetAnnotationKeys(this._proteins); var sb = new StringBuilder(); sb.Append(proteinHeader); foreach (string key in this._annotationKeys) { sb.Append("\t" + key); } this.converter = IdentifiedProteinPropertyConverterFactory.GetInstance().GetConverters(sb.ToString(), '\t'); }
public void Reset() { br.DiscardBufferedData(); br.BaseStream.Seek(0, SeekOrigin.Begin); lastLine = br.ReadLine(); proteinFormat = new LineFormat <IIdentifiedProtein>(IdentifiedProteinPropertyConverterFactory.GetInstance(), lastLine); lastLine = br.ReadLine(); peptideFormat = new LineFormat <IIdentifiedSpectrum>(IdentifiedSpectrumPropertyConverterFactory.GetInstance(), lastLine); while ((lastLine = br.ReadLine()) != null) { if (lastLine.StartsWith("$")) { break; } } }
public ProteinLineFormat(string headers, string engine) : base(IdentifiedProteinPropertyConverterFactory.GetInstance(), headers, engine) { }
public IdentifiedProteinTextWriter(string proteinHeader) { this.converter = IdentifiedProteinPropertyConverterFactory.GetInstance().GetConverters(proteinHeader, '\t'); }
public static IdentifiedProteinPropertyConverterFactory GetInstance() { IdentifiedProteinPropertyConverterFactory result = new IdentifiedProteinPropertyConverterFactory(); IPropertyConverter <IIdentifiedProtein> nameConverter = new IdentifiedProteinNameConverter <IIdentifiedProtein>(); result.RegisterConverter(nameConverter); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(nameConverter, "Locus")); IPropertyConverter <IIdentifiedProtein> despConverter = new IdentifiedProteinDescriptionConverter <IIdentifiedProtein>(); result.RegisterConverter(despConverter); IPropertyConverter <IIdentifiedProtein> refConverter = new IdentifiedProteinReferenceConverter <IIdentifiedProtein>(); result.RegisterConverter(refConverter); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(refConverter, "Descriptive Name")); IPropertyConverter <IIdentifiedProtein> massConverter = new IdentifiedProteinMassConverter <IIdentifiedProtein>(); result.RegisterConverter(massConverter); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(massConverter, "MW")); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(massConverter, "MolWt")); result.RegisterConverter(new MascotProteinTotalScoreConverter <IIdentifiedProtein>()); IPropertyConverter <IIdentifiedProtein> uniqueConverter = new IdentifiedProteinUniquePeptideCountConverter <IIdentifiedProtein>(); result.RegisterConverter(uniqueConverter); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(uniqueConverter, "UniquePepCount")); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(uniqueConverter, "Sequence Count")); IPropertyConverter <IIdentifiedProtein> spectrumConverter = new IdentifiedProteinSpectrumCountConverter <IIdentifiedProtein>(); result.RegisterConverter(spectrumConverter); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(spectrumConverter, "Spectrum Count")); result.RegisterConverter(new AnnotationLinearRegressionRatioResult_RatioConverter <IIdentifiedProtein>("LR_Ratio")); result.RegisterConverter(new AnnotationLinearRegressionRatioResult_RSquareConverter <IIdentifiedProtein>("LR_Ratio", "LR_RSquare")); result.RegisterConverter(new AnnotationLinearRegressionRatioResult_FCalcConverter <IIdentifiedProtein>("LR_Ratio", "LR_FCalc")); result.RegisterConverter(new AnnotationLinearRegressionRatioResult_FProbabilityConverter <IIdentifiedProtein>("LR_Ratio", "LR_FProb")); IPropertyConverter <IIdentifiedProtein> coverageConverter = new IdentifiedProteinCoverageConverter <IIdentifiedProtein>(); result.RegisterConverter(coverageConverter); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(coverageConverter, "Sequence Coverage")); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(coverageConverter, "CoverPercent")); IPropertyConverter <IIdentifiedProtein> piConverter = new IdentifiedProteinIsoelectricPointConverterter <IIdentifiedProtein>(); result.RegisterConverter(piConverter); result.RegisterConverter(new PropertyAliasConverter <IIdentifiedProtein>(piConverter, "pI")); result.RegisterConverter(new AnnotationConverter <IIdentifiedProtein>("Length", "1")); result.RegisterConverter(new AnnotationConverter <IIdentifiedProtein>("Validation Status", "U")); result.RegisterConverter(new QuantificationItemRatioConverter <IIdentifiedProtein>()); result._ignoreKey.Add("S_FILE"); result._ignoreKey.Add("S_SCANS"); result.RegisterConverter(new SilacProteinQuantificationResultConverter2 <IIdentifiedProtein>()); result.RegisterConverter(new ITraqQuantificationResultConverter <IIdentifiedProtein>()); result.RegisterConverter(new IdentifiedProteinDecoyConverter <IIdentifiedProtein>()); return(result); }