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)); }
public void TestNoredundant() { string header = "\t\"File, Scan(s)\"\tSequence\tMH+\tDiff(MH+)\tCharge\tRank\tScore\tDeltaScore\tExpectValue\tQuery\tIons\tReference\tDIFF_MODIFIED_CANDIDATE\tPI\tMissCleavage\tModification"; IPropertyConverter <IIdentifiedSpectrum> converter = IdentifiedSpectrumPropertyConverterFactory.GetInstance().GetConverters(header, '\t'); Assert.AreEqual(header, converter.Name); IIdentifiedSpectrum mphit = new IdentifiedSpectrum(); mphit.Query.FileScan.ShortFileName = "AAA,1-2"; IdentifiedPeptide mp1 = new IdentifiedPeptide(mphit); mp1.Sequence = "AAAAA"; mp1.AddProtein("PROTEIN1"); mp1.AddProtein("PROTEIN2"); IdentifiedPeptide mp2 = new IdentifiedPeptide(mphit); mp2.Sequence = "BBBBB"; mp2.AddProtein("PROTEIN3"); mphit.TheoreticalMH = 1000.00102; mphit.ExperimentalMH = 1000.0; mphit.Query.Charge = 2; mphit.Rank = 1; mphit.Score = 100.2; mphit.DeltaScore = 0.5; mphit.ExpectValue = 1.1e-2; mphit.Query.QueryId = 10; mphit.NumMissedCleavages = 1; mphit.Modifications = "O18(1)"; string expect = " AAA,1 - 2 AAAAA ! BBBBB 1000.00102 0.00102 2 1 100.2 0.5 1.10E-002 10 0|0 PROTEIN1/PROTEIN2 ! PROTEIN3 0.00 1 O18(1)"; Assert.AreEqual(expect, converter.GetProperty(mphit)); string expectNew = " BBB,2 - 3 BBBBB 1002.00783 -0.00200 3 2 200.2 0.6 1.20E-003 20 0|0 PROTEIN2/PROTEIN4 0.00 2 O18(2)"; converter.SetProperty(mphit, expectNew); Assert.AreEqual(expectNew, converter.GetProperty(mphit)); }
public override void SetProperty(T t, string value) { baseConverter.SetProperty(t, value); }