コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProFormaTagGroup" /> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="key">The key.</param>
 /// <param name="evidenceType">Type of the evidence.</param>
 /// <param name="value">The value.</param>
 /// <param name="members">The members.</param>
 public ProFormaTagGroup(string name, ProFormaKey key, ProFormaEvidenceType evidenceType, string value,
                         IList <ProFormaMembershipDescriptor> members)
 {
     this.Name         = name;
     this.Key          = key;
     this.EvidenceType = evidenceType;
     this.Value        = value;
     this.Members      = members;
 }
コード例 #2
0
        public void ModificationAccessionNumbers_4_2_2(string proFormaString, ProFormaEvidenceType modType)
        {
            var term = _parser.ParseString(proFormaString);

            Assert.AreEqual("EMEVEESPEK", term.Sequence);
            Assert.AreEqual(2, term.Tags.Count);

            var desc1 = term.Tags[0].Descriptors.Single();
            var desc2 = term.Tags[1].Descriptors.Single();

            Assert.AreEqual(modType, desc1.EvidenceType);
            Assert.AreEqual(modType, desc2.EvidenceType);
        }
コード例 #3
0
ファイル: ModificationLookupTests.cs プロジェクト: zrolfs/sdk
        private void FindById(IProteoformModificationLookup lookup, ProFormaKey key, ProFormaEvidenceType evidenceType,
                              int correctId, string extraPrefix)
        {
            Assert.IsNotNull(lookup.GetModification(new ProFormaDescriptor(key, evidenceType, $"{extraPrefix}{correctId}")));
            Assert.IsNotNull(lookup.GetModification(new ProFormaDescriptor(key, evidenceType, $"{correctId}")));

            Assert.Throws <ProteoformModificationLookupException>(
                () => lookup.GetModification(new ProFormaDescriptor(key, evidenceType, "-1")));
            Assert.Throws <ProteoformModificationLookupException>(
                () => lookup.GetModification(new ProFormaDescriptor(key, evidenceType, $"{extraPrefix}0")));
            Assert.Throws <ProteoformModificationLookupException>(
                () => lookup.GetModification(new ProFormaDescriptor(key, evidenceType, $"{extraPrefix}2200")));
        }
コード例 #4
0
ファイル: ModificationLookupTests.cs プロジェクト: zrolfs/sdk
        private void FindByName(IProteoformModificationLookup lookup, ProFormaEvidenceType evidenceType,
                                bool isDefault, string correctName)
        {
            if (isDefault)
            {
                Assert.IsNotNull(lookup.GetModification(new ProFormaDescriptor(ProFormaKey.Name, ProFormaEvidenceType.None, correctName)));
            }

            Assert.IsNotNull(lookup.GetModification(new ProFormaDescriptor(ProFormaKey.Name, evidenceType, correctName)));

            Assert.Throws <ProteoformModificationLookupException>(
                () => lookup.GetModification(new ProFormaDescriptor(ProFormaKey.Name, ProFormaEvidenceType.None, "Something")));
            Assert.Throws <ProteoformModificationLookupException>(
                () => lookup.GetModification(new ProFormaDescriptor(ProFormaKey.Name, evidenceType, "Something")));
        }
コード例 #5
0
ファイル: ModificationLookupTests.cs プロジェクト: zrolfs/sdk
        private void DescriptorHandling(IProteoformModificationLookup lookup, ProFormaEvidenceType key, bool isDefault)
        {
            // If the key is a specific mod type, always handle
            Assert.IsTrue(lookup.CanHandleDescriptor(new ProFormaDescriptor(ProFormaKey.Name, key, "Anything")));
            Assert.IsTrue(lookup.CanHandleDescriptor(new ProFormaDescriptor(ProFormaKey.Name, key, "")));
            Assert.IsTrue(lookup.CanHandleDescriptor(new ProFormaDescriptor(ProFormaKey.Name, key, null)));

            // If using modification name, must have no ending or end in proper ending
            Assert.IsTrue(lookup.CanHandleDescriptor(new ProFormaDescriptor(ProFormaKey.Name, key, "Something")));
            Assert.IsFalse(lookup.CanHandleDescriptor(new ProFormaDescriptor(ProFormaKey.Name, "Something")));
            Assert.IsFalse(lookup.CanHandleDescriptor(new ProFormaDescriptor(ProFormaKey.Name, ProFormaEvidenceType.Brno, "Something")));

            // This is malformed and must be interpreted as a mod "name" ... will fail when looking up modification
            //Assert.AreEqual(lookup.CanHandleDescriptor(new ProFormaDescriptor(ProFormaKey.Name, $"Something [{key}]")), isDefault);
        }
コード例 #6
0
        public void Crosslinks_4_2_3_Disulfides(string proFormaString, ProFormaKey proFormaKey, ProFormaEvidenceType evidenceType, string value)
        {
            var term = _parser.ParseString(proFormaString);

            Assert.IsNull(term.Tags);
            Assert.AreEqual(1, term.TagGroups?.Count);

            var tagGroup = term.TagGroups.Single();

            Assert.AreEqual("XL1", tagGroup.Name);
            Assert.AreEqual(proFormaKey, tagGroup.Key);
            Assert.AreEqual(evidenceType, tagGroup.EvidenceType);
            Assert.AreEqual(value, tagGroup.Value);
            Assert.AreEqual(2, tagGroup.Members.Count);
            Assert.AreEqual(6, tagGroup.Members[0].ZeroBasedStartIndex);
            Assert.AreEqual(11, tagGroup.Members[1].ZeroBasedStartIndex);
        }
コード例 #7
0
ファイル: ProFormaParser.cs プロジェクト: zrolfs/sdk
 public ProFormaTagGroupChangingValue(string name, ProFormaKey key, ProFormaEvidenceType evidenceType,
                                      IList <ProFormaMembershipDescriptor> members) : base(name, key, evidenceType, string.Empty, members)
 {
 }
コード例 #8
0
ファイル: ModificationLookupTests.cs プロジェクト: zrolfs/sdk
 private void InvalidIdHandling(string id, IProteoformModificationLookup lookup, ProFormaKey key,
                                ProFormaEvidenceType evidenceType = ProFormaEvidenceType.None)
 {
     Assert.Throws <ProteoformModificationLookupException>(
         () => lookup.GetModification(new ProFormaDescriptor(key, evidenceType, id)));
 }
コード例 #9
0
ファイル: ProFormaDescriptor.cs プロジェクト: zrolfs/sdk
 /// <summary>
 /// Initializes a new instance of the <see cref="ProFormaDescriptor" /> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="evidenceType">Type of the evidence.</param>
 /// <param name="value">The value.</param>
 public ProFormaDescriptor(ProFormaKey key, ProFormaEvidenceType evidenceType, string value)
 {
     this.Key          = key;
     this.EvidenceType = evidenceType;
     this.Value        = value;
 }