Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
trishorts committed May 3, 2024
2 parents 692ad85 + 5b51d2e commit 5ddeab3
Show file tree
Hide file tree
Showing 26 changed files with 1,510 additions and 322 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ jobs:
- name: Build (TestFlashLFQ)
run: cd mzLib && dotnet build --no-restore ./TestFlashLFQ/TestFlashLFQ.csproj
- name: Add coverlet collector (Test)
run: cd mzLib && dotnet add Test/Test.csproj package coverlet.collector
run: cd mzLib && dotnet add Test/Test.csproj package coverlet.collector -v 6.0.0
- name: Add coverlet collector (TestFlashLFQ)
run: cd mzLib && dotnet add TestFlashLFQ/TestFlashLFQ.csproj package coverlet.collector
run: cd mzLib && dotnet add TestFlashLFQ/TestFlashLFQ.csproj package coverlet.collector -v 6.0.0
- name: Test
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.

7 changes: 5 additions & 2 deletions mzLib/Omics/Digestion/DigestionProduct.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -28,9 +29,11 @@ protected DigestionProduct(IBioPolymer parent, int oneBasedStartResidue, int one
public int OneBasedStartResidue { get; }// the residue number at which the peptide begins (the first residue in a protein is 1)
public int OneBasedEndResidue { get; }// the residue number at which the peptide ends
public int MissedCleavages { get; } // the number of missed cleavages this peptide has with respect to the digesting protease
public virtual char PreviousResidue => OneBasedStartResidue > 1 ? Parent[OneBasedStartResidue - 2] : '-';

public virtual char NextResidue => OneBasedEndResidue < Parent.Length ? Parent[OneBasedEndResidue] : '-';
public virtual char PreviousResidue => Parent is null ? '-' : OneBasedStartResidue > 1 ? Parent[OneBasedStartResidue - 2] : '-';

public virtual char NextResidue => Parent is null ? '-' : OneBasedEndResidue < Parent.Length ? Parent[OneBasedEndResidue] : '-';

public string BaseSequence =>
_baseSequence ??= Parent.BaseSequence.Substring(OneBasedStartResidue - 1,
OneBasedEndResidue - OneBasedStartResidue + 1);
Expand Down
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using CsvHelper.Configuration.Attributes;
using CsvHelper.Configuration;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Easy.Common.Extensions;

namespace Readers
{
public class MsFraggerPeptide
{
public static CsvConfiguration CsvConfiguration = new CsvConfiguration(CultureInfo.InvariantCulture)
{
Delimiter = "\t",
HasHeaderRecord = true,
IgnoreBlankLines = true,
TrimOptions = TrimOptions.Trim,
BadDataFound = null,
MissingFieldFound = null,
HeaderValidated = null,
};

[Name("Peptide", "Sequence")] public string BaseSequence { get; set; }

[Name("Prev AA")] [Optional] public char PreviousAminoAcid { get; set; }

[Name("Next AA")] [Optional] public char NextAminoAcid { get; set; }

[Ignore] private int _peptideLength;

[Name("Peptide Length")]
[Optional]
public int PeptideLength
{
get => _peptideLength.IsDefault() ? BaseSequence.Length : _peptideLength;
set => _peptideLength = value;
}

[Name("Protein Start")] [Optional] public int OneBasedStartResidueInProtein { get; set; }

[Name("Protein End")] [Optional] public int OneBasedEndResidueInProtein { get; set; }

[Name("Charges", "Charge States")]
[TypeConverter(typeof(CommaDelimitedToIntegerArrayTypeConverter))]
public int[] Charge { get; set; }

[Name("Probability")] public double Probability { get; set; }

[Name("Spectral Count")] [Optional] public int SpectralCount { get; set; }

[Name("Intensity")] [Optional] public double Intensity { get; set; }

[Name("Assigned Modifications")]
[TypeConverter(typeof(CommaDelimitedToStringArrayTypeConverter))]
public string[] AssignedModifications { get; set; }

[Name("Observed Modifications")]
[Optional]
[TypeConverter(typeof(CommaDelimitedToStringArrayTypeConverter))]
public string[] ObservedModifications { get; set; }

[Name("Protein")] public string Protein { get; set; }

[Name("Protein ID")] [Optional] public string ProteinAccession { get; set; }

[Ignore] private string _proteinName;

[Name("Entry Name")]
[Optional]
public string ProteinName
{
get => _proteinName.IsDefault() ? Protein.Split('|').Last().Trim() : _proteinName;
set => _proteinName = value;
}

[Name("Gene")]
public string Gene { get; set; }

[Name("Protein Description")]
public string ProteinDescription { get; set; }

[Name("Mapped Genes")]
[Optional]
[TypeConverter(typeof(CommaDelimitedToStringArrayTypeConverter))]
public string[] MappedGenes { get; set; }

[Name("Mapped Proteins")]
[Optional]
[TypeConverter(typeof(CommaDelimitedToStringArrayTypeConverter))]
public string[] MappedProteins { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using CsvHelper.Configuration.Attributes;
using CsvHelper.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Readers
{
public class MsFraggerProtein
{
public static CsvConfiguration CsvConfiguration => new CsvConfiguration(System.Globalization.CultureInfo.InvariantCulture)
{
Delimiter = "\t",
HasHeaderRecord = true,
IgnoreBlankLines = true,
TrimOptions = TrimOptions.Trim,
BadDataFound = null,
MissingFieldFound = null,
};

[Name("Protein")]
public string Protein { get; set; }

[Name("Protein ID")]
public string Accession { get; set; }

[Name("Entry Name")]
public string AccessionOrganism { get; set; }

[Name("Gene")]
public string Gene { get; set; }

[Name("Length", "Protein Length")]
public int Length { get; set; }

[Name("Organism")]
public string Organism { get; set; }

[Name("Protein Description", "Description")]
public string Description { get; set; }

[Name("Protein Existence")]
public string ProteinExistence { get; set; }

[Name("Coverage")]
[Optional]
public double Coverage { get; set; }

[Name("Protein Probability")]
public double ProteinProbability { get; set; }

[Name("Top Peptide Probability")]
public double TopPeptideProbability { get; set; }

[Name("Total Peptides", "Combined Total Peptides")]
public int TotalPeptides { get; set; }

[Name("Unique Peptides")]
[Optional]
public int UniquePeptides { get; set; }

[Name("Razor Peptides")]
[Optional]
public int RazorPeptides { get; set; }

[Name("Total Spectral Count", "Combined Total Spectral Count")]
public int TotalSpectralCount { get; set; }

[Name("Unique Spectral Count", "Combined Unique Spectral Count")]
public int UniqueSpectralCount { get; set; }

[Name("Razor Spectral Count")]
[Optional]
public int RazorSpectralCount { get; set; }

[Name("Total Intensity")]
[Optional]
public double TotalIntensity { get; set; }

[Name("Unique Intensity")]
[Optional]
public double UniqueIntensity { get; set; }

[Name("Razor Intensity")]
[Optional]
public double RazorIntensity { get; set; }

[Name("Razor Assigned Modifications")]
[TypeConverter(typeof(CommaDelimitedToStringArrayTypeConverter))]
[Optional]
public string[] RazorAssignedModifications { get; set; }

[Name("Razor Observed Modifications")]
[Optional]
[TypeConverter(typeof(CommaDelimitedToStringArrayTypeConverter))]
public string[] RazorObservedModifications { get; set; }

[Name("Indistinguishable Proteins")]
[TypeConverter(typeof(CommaDelimitedToStringArrayTypeConverter))]
public string[] IndistinguishableProteins { get; set; }

public MsFraggerProtein()
{
RazorAssignedModifications = new string[0];
RazorObservedModifications = new string[0];
IndistinguishableProteins = new string[0];
}
}
}
Loading

0 comments on commit 5ddeab3

Please sign in to comment.