Skip to content

Commit 34a8185

Browse files
author
stefanks
authored
Merge pull request #188 from smith-chem-wisc/StefanBranch
so many
2 parents 528c2ac + f19a1b0 commit 34a8185

File tree

151 files changed

+1161
-1347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+1161
-1347
lines changed

.travis.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ install:
55
- nuget install NUnit.Console -OutputDirectory testrunner
66
script:
77
- echo $TRAVIS_TAG
8-
- cat MetaMorpheusCommandLine/Properties/AssemblyInfo.cs
9-
- if [ -n "${TRAVIS_TAG}" ]; then sed -i -- 's/1.0.0.0/'$TRAVIS_TAG'/g' MetaMorpheusCommandLine/Properties/AssemblyInfo.cs ; fi
10-
- if [ -n "${TRAVIS_TAG}" ]; then sed -i -- 's/1.0.0.0/'$TRAVIS_TAG'/g' InternalLogic/Properties/AssemblyInfo.cs ; fi
11-
- cat MetaMorpheusCommandLine/Properties/AssemblyInfo.cs
8+
- cat CMD/Properties/AssemblyInfo.cs
9+
- if [ -n "${TRAVIS_TAG}" ]; then sed -i -- 's/1.0.0.0/'$TRAVIS_TAG'/g' CMD/Properties/AssemblyInfo.cs ; fi
10+
- if [ -n "${TRAVIS_TAG}" ]; then sed -i -- 's/1.0.0.0/'$TRAVIS_TAG'/g' EngineLayer/Properties/AssemblyInfo.cs ; fi
11+
- cat CMD/Properties/AssemblyInfo.cs
1212
- xbuild /p:Configuration=TestAndReleaseTravis MetaMorpheus.sln
1313
- mono ./testrunner/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./Test/bin/Release/Test.dll
14-
- tar -zcvf MonoCommandLine.tar.gz -C MetaMorpheusCommandLine/bin/Release .
14+
- tar -zcvf MonoCommandLine.tar.gz -C CMD/bin/Release .
1515
deploy:
1616
provider: releases
1717
api_key:
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
5-
</startup>
6-
<runtime>
7-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8-
<dependentAssembly>
9-
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
10-
<bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" />
11-
</dependentAssembly>
12-
</assemblyBinding>
13-
</runtime>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
5+
</startup>
6+
<runtime>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" />
11+
</dependentAssembly>
12+
</assemblyBinding>
13+
</runtime>
1414
</configuration>

MetaMorpheusCommandLine/MetaMorpheusCommandLine.csproj CMD/CMD.csproj

+4-8
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,13 @@
100100
<None Include="packages.config" />
101101
</ItemGroup>
102102
<ItemGroup>
103-
<ProjectReference Include="..\InternalLogicWithFileIO\InternalLogicTaskLayer.csproj">
103+
<ProjectReference Include="..\TaskLayer\TaskLayer.csproj">
104104
<Project>{04B0EE7D-5FD3-47A5-ABAA-658D177E4229}</Project>
105-
<Name>InternalLogicTaskLayer</Name>
105+
<Name>TaskLayer</Name>
106106
</ProjectReference>
107-
<ProjectReference Include="..\InternalLogic\InternalLogicEngineLayer.csproj">
107+
<ProjectReference Include="..\EngineLayer\EngineLayer.csproj">
108108
<Project>{A9A105AF-E6C4-40E8-AA7D-5E6FAB72542A}</Project>
109-
<Name>InternalLogicEngineLayer</Name>
110-
</ProjectReference>
111-
<ProjectReference Include="..\OldInternalLogic\OldInternalLogic.csproj">
112-
<Project>{d2178d2e-7cbd-48a3-835d-8b13872202ff}</Project>
113-
<Name>OldInternalLogic</Name>
109+
<Name>EngineLayer</Name>
114110
</ProjectReference>
115111
</ItemGroup>
116112
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

MetaMorpheusCommandLine/Program.cs CMD/Program.cs

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
using InternalLogicEngineLayer;
2-
using InternalLogicTaskLayer;
3-
using IO.MzML;
4-
using MassSpectrometry;
5-
using Spectra;
1+
using EngineLayer;
62
using System;
7-
using System.Collections.Generic;
8-
using System.IO;
9-
using System.Linq;
3+
using TaskLayer;
104

115
namespace MetaMorpheusCommandLine
126
{
@@ -47,9 +41,8 @@ private static void Main(string[] args)
4741
MyTaskEngine.FinishedSingleTaskHandler += MyTaskEngine_finishedSingleTaskHandler;
4842
MyTaskEngine.FinishedWritingFileHandler += MyTaskEngine_finishedWritingFileHandler;
4943
MyTaskEngine.StartingSingleTaskHander += MyTaskEngine_startingSingleTaskHander;
50-
5144
}
52-
45+
5346
private static void MyTaskEngine_startingSingleTaskHander(object sender, SingleTaskEventArgs e)
5447
{
5548
if (inProgress)
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
using System.Reflection;
2-
using System.Runtime.InteropServices;
3-
4-
// General Information about an assembly is controlled through the following
5-
// set of attributes. Change these attribute values to modify the information
6-
// associated with an assembly.
7-
[assembly: AssemblyTitle("MetaMorpheusCommandLine")]
8-
[assembly: AssemblyDescription("")]
9-
[assembly: AssemblyConfiguration("")]
10-
[assembly: AssemblyCompany("")]
11-
[assembly: AssemblyProduct("MetaMorpheusCommandLine")]
12-
[assembly: AssemblyCopyright("Copyright © 2016")]
13-
[assembly: AssemblyTrademark("")]
14-
[assembly: AssemblyCulture("")]
15-
16-
// Setting ComVisible to false makes the types in this assembly not visible
17-
// to COM components. If you need to access a type in this assembly from
18-
// COM, set the ComVisible attribute to true on that type.
19-
[assembly: ComVisible(false)]
20-
21-
// The following GUID is for the ID of the typelib if this project is exposed to COM
22-
[assembly: Guid("dd89ef8c-a47a-4c6b-97bf-01b81d48847c")]
23-
24-
// Version information for an assembly consists of the following four values:
25-
//
26-
// Major Version
27-
// Minor Version
28-
// Build Number
29-
// Revision
30-
//
31-
// You can specify all the values or you can default the Build and Revision Numbers
32-
// by using the '*' as shown below:
33-
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.0.0.0")]
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
// General Information about an assembly is controlled through the following
5+
// set of attributes. Change these attribute values to modify the information
6+
// associated with an assembly.
7+
[assembly: AssemblyTitle("MetaMorpheusCommandLine")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("MetaMorpheusCommandLine")]
12+
[assembly: AssemblyCopyright("Copyright © 2016")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// Setting ComVisible to false makes the types in this assembly not visible
17+
// to COM components. If you need to access a type in this assembly from
18+
// COM, set the ComVisible attribute to true on that type.
19+
[assembly: ComVisible(false)]
20+
21+
// The following GUID is for the ID of the typelib if this project is exposed to COM
22+
[assembly: Guid("dd89ef8c-a47a-4c6b-97bf-01b81d48847c")]
23+
24+
// Version information for an assembly consists of the following four values:
25+
//
26+
// Major Version
27+
// Minor Version
28+
// Build Number
29+
// Revision
30+
//
31+
// You can specify all the values or you can default the Build and Revision Numbers
32+
// by using the '*' as shown below:
33+
// [assembly: AssemblyVersion("1.0.*")]
34+
[assembly: AssemblyVersion("1.0.0.0")]
3535
[assembly: AssemblyFileVersion("1.0.0.0")]
File renamed without changes.

InternalLogic/AnalysisEngine.cs EngineLayer/Analysis/AnalysisEngine.cs

+36-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using MassSpectrometry;
2-
using OldInternalLogic;
32
using Proteomics;
43
using Spectra;
54
using System;
@@ -9,7 +8,7 @@
98
using System.Linq;
109
using System.Threading.Tasks;
1110

12-
namespace InternalLogicEngineLayer
11+
namespace EngineLayer.Analysis
1312
{
1413
public class AnalysisEngine : MyEngine
1514
{
@@ -20,11 +19,11 @@ public class AnalysisEngine : MyEngine
2019
private readonly double binTol;
2120
private readonly int maximumMissedCleavages;
2221
private readonly int maxModIsoforms;
23-
private readonly ParentSpectrumMatch[][] newPsms;
22+
private readonly PsmParent[][] newPsms;
2423
private readonly List<Protein> proteinList;
25-
private readonly List<MorpheusModification> variableModifications;
26-
private readonly List<MorpheusModification> fixedModifications;
27-
private readonly List<MorpheusModification> localizeableModifications;
24+
private readonly List<MetaMorpheusModification> variableModifications;
25+
private readonly List<MetaMorpheusModification> fixedModifications;
26+
private readonly List<MetaMorpheusModification> localizeableModifications;
2827
private readonly Protease protease;
2928
private readonly List<SearchMode> searchModes;
3029
private readonly IMsDataFile<IMzSpectrum<MzPeak>> myMsDataFile;
@@ -41,7 +40,7 @@ public class AnalysisEngine : MyEngine
4140

4241
#region Public Constructors
4342

44-
public AnalysisEngine(ParentSpectrumMatch[][] newPsms, Dictionary<CompactPeptide, HashSet<PeptideWithSetModifications>> compactPeptideToProteinPeptideMatching, List<Protein> proteinList, List<MorpheusModification> variableModifications, List<MorpheusModification> fixedModifications, List<MorpheusModification> localizeableModifications, Protease protease, List<SearchMode> searchModes, IMsDataFile<IMzSpectrum<MzPeak>> myMSDataFile, Tolerance fragmentTolerance, Action<BinTreeStructure, string> action1, Action<List<NewPsmWithFdr>, string> action2, Action<List<ProteinGroup>, string> action3, bool doParsimony, int maximumMissedCleavages, int maxModIsoforms, bool doHistogramAnalysis, List<ProductType> lp, double binTol) : base(2)
43+
public AnalysisEngine(PsmParent[][] newPsms, Dictionary<CompactPeptide, HashSet<PeptideWithSetModifications>> compactPeptideToProteinPeptideMatching, List<Protein> proteinList, List<MetaMorpheusModification> variableModifications, List<MetaMorpheusModification> fixedModifications, List<MetaMorpheusModification> localizeableModifications, Protease protease, List<SearchMode> searchModes, IMsDataFile<IMzSpectrum<MzPeak>> myMSDataFile, Tolerance fragmentTolerance, Action<BinTreeStructure, string> action1, Action<List<NewPsmWithFdr>, string> action2, Action<List<ProteinGroup>, string> action3, bool doParsimony, int maximumMissedCleavages, int maxModIsoforms, bool doHistogramAnalysis, List<ProductType> lp, double binTol) : base(2)
4544
{
4645
this.doParsimony = doParsimony;
4746
this.doHistogramAnalysis = doHistogramAnalysis;
@@ -605,12 +604,12 @@ protected override MyResults RunSpecific()
605604
{
606605
if (newPsms[j] != null)
607606
{
608-
PSMwithProteinHashSet[] psmsWithProteinHashSet = new PSMwithProteinHashSet[newPsms[0].Length];
607+
PsmWithMultiplePossiblePeptides[] psmsWithProteinHashSet = new PsmWithMultiplePossiblePeptides[newPsms[0].Length];
609608
for (int i = 0; i < newPsms[0].Length; i++)
610609
{
611610
var huh = newPsms[j][i];
612611
if (huh != null && huh.score >= 1)
613-
psmsWithProteinHashSet[i] = new PSMwithProteinHashSet(huh, compactPeptideToProteinPeptideMatching[huh.GetCompactPeptide(variableModifications, localizeableModifications, fixedModifications)], fragmentTolerance, myMsDataFile, lp);
612+
psmsWithProteinHashSet[i] = new PsmWithMultiplePossiblePeptides(huh, compactPeptideToProteinPeptideMatching[huh.GetCompactPeptide(variableModifications, localizeableModifications, fixedModifications)], fragmentTolerance, myMsDataFile, lp);
614613
}
615614

616615
var orderedPsmsWithPeptides = psmsWithProteinHashSet.Where(b => b != null).OrderByDescending(b => b.Score);
@@ -682,7 +681,7 @@ private static void IdentifyFracWithSingle(BinTreeStructure myTreeStructure)
682681
{
683682
foreach (Bin bin in myTreeStructure.FinalBins)
684683
{
685-
bin.FracWithSingle = (double)bin.uniquePSMs.Values.Where(b => !b.Item3.IsDecoy && b.Item3.thisPSM.peptidesWithSetModifications.Count == 1).Count() / bin.uniquePSMs.Values.Where(b => !b.Item3.IsDecoy).Count();
684+
bin.FracWithSingle = (double)bin.uniquePSMs.Values.Count(b => !b.Item3.IsDecoy && b.Item3.thisPSM.peptidesWithSetModifications.Count == 1) / bin.uniquePSMs.Values.Count(b => !b.Item3.IsDecoy);
686685
}
687686
}
688687

@@ -931,16 +930,18 @@ private static BinTreeStructure MyAnalysis(List<NewPsmWithFdr> limitedpsms_with_
931930

932931
OverlappingIonSequences(myTreeStructure);
933932

933+
IdentifyFracWithSingle(myTreeStructure);
934+
934935
return myTreeStructure;
935936
}
936937

937-
private static List<NewPsmWithFdr> DoFalseDiscoveryRateAnalysis(IEnumerable<PSMwithProteinHashSet> items)
938+
private static List<NewPsmWithFdr> DoFalseDiscoveryRateAnalysis(IEnumerable<PsmWithMultiplePossiblePeptides> items)
938939
{
939940
var ids = new List<NewPsmWithFdr>();
940941

941942
int cumulative_target = 0;
942943
int cumulative_decoy = 0;
943-
foreach (PSMwithProteinHashSet item in items)
944+
foreach (PsmWithMultiplePossiblePeptides item in items)
944945
{
945946
var isDecoy = item.IsDecoy;
946947
if (isDecoy)
@@ -1038,5 +1039,28 @@ private void AddObservedPeptidesToDictionary()
10381039

10391040
#endregion Private Methods
10401041

1042+
#region Private Classes
1043+
1044+
private class SequenceComparer : IEqualityComparer<PsmWithMultiplePossiblePeptides>
1045+
{
1046+
1047+
#region Public Methods
1048+
1049+
public bool Equals(PsmWithMultiplePossiblePeptides x, PsmWithMultiplePossiblePeptides y)
1050+
{
1051+
return x.FullSequence.Equals(y.FullSequence);
1052+
}
1053+
1054+
public int GetHashCode(PsmWithMultiplePossiblePeptides obj)
1055+
{
1056+
return obj.FullSequence.GetHashCode();
1057+
}
1058+
1059+
#endregion Public Methods
1060+
1061+
}
1062+
1063+
#endregion Private Classes
1064+
10411065
}
10421066
}

InternalLogic/AnalysisResults.cs EngineLayer/Analysis/AnalysisResults.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Linq;
33
using System.Text;
44

5-
namespace InternalLogicEngineLayer
5+
namespace EngineLayer.Analysis
66
{
77
public class AnalysisResults : MyResults
88
{
@@ -34,7 +34,7 @@ protected override string StringForOutput
3434
sb.Append("\t\tAll PSMS within 1% FDR: " + string.Join(", ", AllResultingIdentifications.Select(b => b.Count(c => c.qValue <= 0.01))));
3535

3636
if (ProteinGroups != null)
37-
sb.Append("\n\t\tAll proteins within 1% FDR: " + string.Join(", ", ProteinGroups.Count(c => ((c.QValue <= 0.01) && (c.isDecoy == false)))));
37+
sb.Append("\n\t\tAll proteins within 1% FDR: " + string.Join(", ", ProteinGroups.Count(c => ((c.QValue <= 0.01) && (c.isDecoy == false)))));
3838

3939
return sb.ToString();
4040
}
@@ -43,4 +43,4 @@ protected override string StringForOutput
4343
#endregion Protected Properties
4444

4545
}
46-
}
46+
}

InternalLogic/Bin.cs EngineLayer/Analysis/Bin.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44

5-
namespace InternalLogicEngineLayer
5+
namespace EngineLayer.Analysis
66
{
77
public class Bin
88
{

InternalLogic/BinTreeStructure.cs EngineLayer/Analysis/BinTreeStructure.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44

5-
namespace InternalLogicEngineLayer
5+
namespace EngineLayer.Analysis
66
{
77
public class BinTreeStructure
88
{
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
1-
namespace InternalLogicEngineLayer
1+
namespace EngineLayer.Analysis
22
{
33
internal class MyInfo
44
{
5+
6+
#region Internal Fields
7+
58
internal string infostring;
69

10+
#endregion Internal Fields
11+
12+
#region Public Constructors
13+
714
public MyInfo(double MassShift, string infostring)
815
{
916
this.MassShift = MassShift;
1017
this.infostring = infostring;
1118
}
1219

20+
#endregion Public Constructors
21+
22+
#region Public Properties
23+
1324
public double MassShift { get; internal set; }
25+
26+
#endregion Public Properties
27+
1428
}
1529
}

InternalLogic/OkBin.cs EngineLayer/Analysis/OkBin.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace InternalLogicEngineLayer
1+
namespace EngineLayer.Analysis
22
{
33
internal class OkBin
44
{

0 commit comments

Comments
 (0)