Example #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;
 }
Example #2
0
        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")));
        }
Example #3
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);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="IgnoreKeyModificationLookup"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 public IgnoreKeyModificationLookup(ProFormaKey key)
 {
     _key = key;
 }
Example #5
0
 public ProFormaTagGroupChangingValue(string name, ProFormaKey key, ProFormaEvidenceType evidenceType,
                                      IList <ProFormaMembershipDescriptor> members) : base(name, key, evidenceType, string.Empty, members)
 {
 }
Example #6
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="value">The value.</param>
 /// <param name="members">The members.</param>
 public ProFormaTagGroup(string name, ProFormaKey key, string value, IList <ProFormaMembershipDescriptor> members)
     : this(name, key, ProFormaEvidenceType.None, value, members)
 {
 }
Example #7
0
 private void InvalidIdHandling(string id, IProteoformModificationLookup lookup, ProFormaKey key,
                                ProFormaEvidenceType evidenceType = ProFormaEvidenceType.None)
 {
     Assert.Throws <ProteoformModificationLookupException>(
         () => lookup.GetModification(new ProFormaDescriptor(key, evidenceType, id)));
 }
Example #8
0
 /// <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;
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProFormaDescriptor"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="value">The value.</param>
 public ProFormaDescriptor(ProFormaKey key, string value)
     : this(key, ProFormaEvidenceType.None, value)
 {
 }