Skip to content

Commit

Permalink
Parallel Identification Reading and Relaxed file naming in input psms…
Browse files Browse the repository at this point in the history
… list (#115)

* parallelIdentificationReading

* allow extensions and paths in the filename of the identification file

* no need to save scan header info

* better variable name

* limit gathering scan header info

* make psm lists to facilitate parallel processing

* no longer paralel

* fix merge conflic

Co-authored-by: MICHAEL SHORTREED <[email protected]>
  • Loading branch information
trishorts and MICHAEL SHORTREED authored Aug 11, 2022
1 parent 30001cb commit 5feda8f
Show file tree
Hide file tree
Showing 13 changed files with 8,271 additions and 249 deletions.
10 changes: 5 additions & 5 deletions CMD/FlashLFQExecutable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ private static void Run(FlashLfqSettings settings)
.Where(f => acceptedSpectrumFileFormats.Contains(Path.GetExtension(f).ToLowerInvariant())).ToList();

// check for duplicate file names (agnostic of file extension)
foreach (var fileName in filePaths.GroupBy(p => Path.GetFileNameWithoutExtension(p)))
foreach (var fileNameWithoutExtension in filePaths.GroupBy(p => Path.GetFileNameWithoutExtension(p)))
{
if (fileName.Count() > 1)
if (fileNameWithoutExtension.Count() > 1)
{
var types = fileName.Select(p => Path.GetFileNameWithoutExtension(p)).Distinct();
var types = fileNameWithoutExtension.Select(p => Path.GetFileNameWithoutExtension(p)).Distinct();

if (!settings.Silent)
{
Expand Down Expand Up @@ -142,9 +142,9 @@ private static void Run(FlashLfqSettings settings)

foreach (var file in filePaths)
{
string filename = Path.GetFileNameWithoutExtension(file);
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file);

var expDesignForThisFile = experimentalDesign[filename];
var expDesignForThisFile = experimentalDesign[fileNameWithoutExtension];
var split = expDesignForThisFile.Split('\t');

string condition = split[1];
Expand Down
3,832 changes: 3,832 additions & 0 deletions Test/SampleFiles/Parallel/20100614_Velos1_TaGe_SA_Jurkat_3.mzML

Large diffs are not rendered by default.

3,470 changes: 3,470 additions & 0 deletions Test/SampleFiles/Parallel/20100614_Velos1_TaGe_SA_Jurkat_4.mzML

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions Test/SampleFiles/Parallel/AllPSMs.psmtsv

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Test/SampleFiles/Parallel/ExperimentalDesign.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FileName Condition Biorep Fraction Techrep
20100614_Velos1_TaGe_SA_Jurkat_3 Default 1 1 1
20100614_Velos1_TaGe_SA_Jurkat_4 Default 1 1 2

Large diffs are not rendered by default.

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions Test/SampleFiles/Parallel/withExtensions_AllPSMs.psmtsv

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions Test/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,162 @@ public static void TestGenericOutput()
File.Delete(proteinsPath);
}

[Test]
public static void TestParallelProcessingMetaMorpheusOutput()
{
string search = "Parallel";
string psmFilename = "AllPSMs.psmtsv";

var myDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "SampleFiles", search);
var pathOfIdentificationFile = Path.Combine(myDirectory, psmFilename);
var pathOfMzml1 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_3.mzML");
var pathOfMzml2 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_4.mzML");
Assert.That(File.Exists(pathOfIdentificationFile));
Assert.That(File.Exists(pathOfMzml1));
Assert.That(File.Exists(pathOfMzml2));

string[] myargs = new string[]
{
"--rep",
myDirectory,
"--idt",
pathOfIdentificationFile,
"--ppm",
"5"
};

CMD.FlashLfqExecutable.Main(myargs);

string peaksPath = Path.Combine(myDirectory, "QuantifiedPeaks.tsv");
Assert.That(File.Exists(peaksPath));
File.Delete(peaksPath);

string peptidesPath = Path.Combine(myDirectory, "QuantifiedPeptides.tsv");
Assert.That(File.Exists(peptidesPath));
File.Delete(peptidesPath);

string proteinsPath = Path.Combine(myDirectory, "QuantifiedProteins.tsv");
Assert.That(File.Exists(proteinsPath));
File.Delete(proteinsPath);
}

[Test]
public static void TestParallelProcessingMetaMorpheusOutputWithExtensions()
{
string search = "Parallel";
string psmFilename = "withExtensions_AllPSMs.psmtsv";

var myDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "SampleFiles", search);
var pathOfIdentificationFile = Path.Combine(myDirectory, psmFilename);
var pathOfMzml1 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_3.mzML");
var pathOfMzml2 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_4.mzML");
Assert.That(File.Exists(pathOfIdentificationFile));
Assert.That(File.Exists(pathOfMzml1));
Assert.That(File.Exists(pathOfMzml2));

string[] myargs = new string[]
{
"--rep",
myDirectory,
"--idt",
pathOfIdentificationFile,
"--ppm",
"5"
};

CMD.FlashLfqExecutable.Main(myargs);

string peaksPath = Path.Combine(myDirectory, "QuantifiedPeaks.tsv");
Assert.That(File.Exists(peaksPath));
File.Delete(peaksPath);

string peptidesPath = Path.Combine(myDirectory, "QuantifiedPeptides.tsv");
Assert.That(File.Exists(peptidesPath));
File.Delete(peptidesPath);

string proteinsPath = Path.Combine(myDirectory, "QuantifiedProteins.tsv");
Assert.That(File.Exists(proteinsPath));
File.Delete(proteinsPath);
}

[Test]
public static void TestParallelProcessingMetaMorpheusOutputWithExtensionsAndWindowsPath()
{
string search = "Parallel";
string psmFilename = "withExtensionsAndWindowsPath_AllPSMs.psmtsv";

var myDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "SampleFiles", search);
var pathOfIdentificationFile = Path.Combine(myDirectory, psmFilename);
var pathOfMzml1 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_3.mzML");
var pathOfMzml2 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_4.mzML");
Assert.That(File.Exists(pathOfIdentificationFile));
Assert.That(File.Exists(pathOfMzml1));
Assert.That(File.Exists(pathOfMzml2));

string[] myargs = new string[]
{
"--rep",
myDirectory,
"--idt",
pathOfIdentificationFile,
"--ppm",
"5"
};

CMD.FlashLfqExecutable.Main(myargs);

string peaksPath = Path.Combine(myDirectory, "QuantifiedPeaks.tsv");
Assert.That(File.Exists(peaksPath));
File.Delete(peaksPath);

string peptidesPath = Path.Combine(myDirectory, "QuantifiedPeptides.tsv");
Assert.That(File.Exists(peptidesPath));
File.Delete(peptidesPath);

string proteinsPath = Path.Combine(myDirectory, "QuantifiedProteins.tsv");
Assert.That(File.Exists(proteinsPath));
File.Delete(proteinsPath);
}

[Test]
public static void TestParallelProcessingMetaMorpheusOutputWithExtensionsAndLinuxPath()
{
string search = "Parallel";
string psmFilename = "withExtensionsAndLinuxPath_AllPSMs.psmtsv";

var myDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "SampleFiles", search);
var pathOfIdentificationFile = Path.Combine(myDirectory, psmFilename);
var pathOfMzml1 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_3.mzML");
var pathOfMzml2 = Path.Combine(myDirectory, "20100614_Velos1_TaGe_SA_Jurkat_4.mzML");
Assert.That(File.Exists(pathOfIdentificationFile));
Assert.That(File.Exists(pathOfMzml1));
Assert.That(File.Exists(pathOfMzml2));

string[] myargs = new string[]
{
"--rep",
myDirectory,
"--idt",
pathOfIdentificationFile,
"--ppm",
"5"
};

CMD.FlashLfqExecutable.Main(myargs);

string peaksPath = Path.Combine(myDirectory, "QuantifiedPeaks.tsv");
Assert.That(File.Exists(peaksPath));
File.Delete(peaksPath);

string peptidesPath = Path.Combine(myDirectory, "QuantifiedPeptides.tsv");
Assert.That(File.Exists(peptidesPath));
File.Delete(peptidesPath);

string proteinsPath = Path.Combine(myDirectory, "QuantifiedProteins.tsv");
Assert.That(File.Exists(proteinsPath));
File.Delete(proteinsPath);
}

[Test]
public static void TestFlashLfqExecutableWithNormalization()
{
Expand Down
21 changes: 21 additions & 0 deletions Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
</ItemGroup>

<ItemGroup>
<None Update="SampleFiles\Parallel\20100614_Velos1_TaGe_SA_Jurkat_3.mzML">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\Parallel\20100614_Velos1_TaGe_SA_Jurkat_4.mzML">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\ExperimentalDesign.tsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand All @@ -42,6 +48,21 @@
<None Update="SampleFiles\Morpheus\SmallCalibratible_Yeast.PSMs.tsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\Parallel\AllPSMs.psmtsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\Parallel\ExperimentalDesign.tsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\Parallel\withExtensionsAndLinuxPath_AllPSMs.psmtsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\Parallel\withExtensionsAndWindowsPath_AllPSMs.psmtsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\Parallel\withExtensions_AllPSMs.psmtsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleFiles\PeptideShaker\Default PSM Report.tabular">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Loading

0 comments on commit 5feda8f

Please sign in to comment.