Skip to content

Commit

Permalink
Merge branch 'MsPathFindertResultReading' of https://github.com/nboll…
Browse files Browse the repository at this point in the history
…is/mzLib into MsPathFindertResultReading
  • Loading branch information
nbollis committed May 7, 2024
2 parents 38a82dc + 2e0627c commit 30a8d34
Show file tree
Hide file tree
Showing 9 changed files with 322 additions and 313 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ jobs:
run: cd mzLib && dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" /p:CoverletOutputFormat=cobertura ./Test/Test.csproj
- name: TestFlashLFQ
run: cd mzLib && dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" /p:CoverletOutputFormat=cobertura ./TestFlashLFQ/TestFlashLFQ.csproj
- name: Codecov
uses: codecov/codecov-action@v2
with:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
verbose: true
files: mzLib/Test*/TestResults/*/coverage.cobertura.xml
277 changes: 136 additions & 141 deletions mzLib/MassSpectrometry/MzSpectra/SpectralSimilarity.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions mzLib/Omics/SpectrumMatch/LibrarySpectrum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public string CalculateSpectralAngleOnTheFly(List<MatchedFragmentIon> spectrumMa
spectrumMatchFragments.Select(f => f.Intensity).ToArray(),
MatchedFragmentIons.Select(f => f.Mz).ToArray(),
MatchedFragmentIons.Select(f => f.Intensity).ToArray(),
SpectralSimilarity.SpectrumNormalizationScheme.mostAbundantPeak,
SpectralSimilarity.SpectrumNormalizationScheme.MostAbundantPeak,
toleranceInPpm: 20,
allPeaks: true);
keepAllExperimentalPeaks: true);
double? spectralContrastAngle = spectraComparison.SpectralContrastAngle();

return spectralContrastAngle == null
Expand Down
6 changes: 4 additions & 2 deletions mzLib/Proteomics/RetentionTimePrediction/SSRCalc3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,11 @@ public double UnknownScore
get { return 0; }
}

public double ScoreSequence(PeptideWithSetModifications item)
public double ScoreSequence(PeptideWithSetModifications item) => ScoreSequence(item.BaseSequence);

public double ScoreSequence(string baseSequence)
{
var seq = item.BaseSequence; //PTMs are not yet implemented
var seq = baseSequence; //PTMs are not yet implemented
double tsum3 = 0.0;
int i;

Expand Down
3 changes: 1 addition & 2 deletions mzLib/Readers/Util/Software.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace Readers
namespace Readers
{
public enum Software
{
Expand Down
2 changes: 1 addition & 1 deletion mzLib/Readers/Util/SupportedFileTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static SupportedFileType ParseFileType(this string filePath)
return SupportedFileType.Mzrt_TopFd;
throw new MzLibException("Csv file type not supported");

case ".tsv":
case ".tsv":
{
// these tsv cases have a specialized ending before the .tsv
if (filePath.EndsWith(SupportedFileType.Ms1Tsv_FlashDeconv.GetFileExtension(), StringComparison.InvariantCultureIgnoreCase))
Expand Down
3 changes: 0 additions & 3 deletions mzLib/Test/FileReadingTests/TestSupportedFileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ internal class TestSupportedFileExtensions
[TestCase(@"FileReadingTests\ExternalFileTypes\MsPathFinderT_TargetResults_IcTarget.tsv", SupportedFileType.MsPathFinderTTargets)]
[TestCase(@"FileReadingTests\ExternalFileTypes\MsPathFinderT_DecoyResults_IcDecoy.tsv", SupportedFileType.MsPathFinderTDecoys)]
[TestCase(@"FileReadingTests\ExternalFileTypes\MsPathFinderT_AllResults_IcTda.tsv", SupportedFileType.MsPathFinderTAllResults)]

public static void TestSupportedFileTypeExtensions(string filePath, SupportedFileType expectedType)
{
var supportedType = filePath.ParseFileType();
Expand Down Expand Up @@ -91,7 +90,5 @@ public static void TestGetFileExtension_Errors()
Assert.That(e?.Message,
Is.EqualTo($"File type not supported"));
}


}
}
3 changes: 3 additions & 0 deletions mzLib/Test/TestRetentionTimePrediction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ public void SSRCalc3_100A_Test()
object obj = _peptides100A[i, 1];
double expected = (double)_peptides100A[i, 1];
double actual = calc.ScoreSequence(peptide);
double actualString = calc.ScoreSequence(peptide.BaseSequence);

// Round the returned value to match the values presented
// in the supporting information of the SSRCalc 3 publication.
Expand All @@ -665,11 +666,13 @@ public void SSRCalc3_100A_Test()
// instead of 12.81. When diffed with 12.81 the result was
// 0.005000000000002558.
double actualRound = Math.Round((float)actual, 2);
double actualStringRound = Math.Round((float)actualString, 2);

// Extra conditional added to improve debugging of issues.
if (Math.Abs(expected - actual) > 0.005)
{
Assert.AreEqual(expected, actualRound, "Peptide {0}", peptide);
Assert.AreEqual(expected, actualStringRound, "Peptide {0}", peptide);
}
}
}
Expand Down
Loading

0 comments on commit 30a8d34

Please sign in to comment.