Skip to content

Commit

Permalink
Changed behavior of masked members in Digestionparams (#756)
Browse files Browse the repository at this point in the history
* Changed behavior of masked members in Digestionparams

* Added unit test

* Added unit test
  • Loading branch information
nbollis authored Jan 11, 2024
1 parent 40c4c4b commit 1dc99fc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
21 changes: 18 additions & 3 deletions mzLib/Proteomics/ProteolyticDigestion/DigestionParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,24 @@ public DigestionParams(string protease = "trypsin", int maxMissedCleavages = 2,
#region Properties overridden by more generic interface

public Protease Protease { get; private set; }
public int MinPeptideLength => MinLength;
public int MaxPeptideLength => MaxLength;
public int MaxModsForPeptide => MaxMods;

public int MinPeptideLength
{
get => MinLength;
set => MinLength = value;
}

public int MaxPeptideLength
{
get => MaxLength;
set => MaxLength = value;
}

public int MaxModsForPeptide
{
get => MaxMods;
set => MaxMods = value;
}

#endregion

Expand Down
15 changes: 15 additions & 0 deletions mzLib/Test/TestDigestionMotif.cs
Original file line number Diff line number Diff line change
Expand Up @@ -578,5 +578,20 @@ public static void TestProteolyticDigestion()
Assert.IsFalse(pwsmsN.Any(x => x.Length < speedySemiN.MinLength));
Assert.IsFalse(pwsmsC.Any(x => x.Length < speedySemiC.MinLength));
}

[Test]
public void TestDigestionParamsMaskedProperties()
{
var digestionParams = new DigestionParams();
digestionParams.MinPeptideLength = 1;
Assert.That(digestionParams.MinLength, Is.EqualTo(digestionParams.MinPeptideLength));

digestionParams.MaxPeptideLength = 2;
Assert.That(digestionParams.MaxLength, Is.EqualTo(digestionParams.MaxPeptideLength));


digestionParams.MaxModsForPeptide = 3;
Assert.That(digestionParams.MaxMods, Is.EqualTo(digestionParams.MaxModsForPeptide));
}
}
}

0 comments on commit 1dc99fc

Please sign in to comment.