Skip to content

Commit

Permalink
adder intralink support
Browse files Browse the repository at this point in the history
  • Loading branch information
nbollis committed Oct 23, 2024
1 parent f24ddef commit 351e9f0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions mzLib/Readers/Readers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<ItemGroup>
<ProjectReference Include="..\MassSpectrometry\MassSpectrometry.csproj" />
<ProjectReference Include="..\MzLibUtil\MzLibUtil.csproj" />
<ProjectReference Include="..\Transcriptomics\Transcriptomics.csproj" />
<ProjectReference Include="..\UsefulProteomicsDatabases\UsefulProteomicsDatabases.csproj" />
</ItemGroup>

Expand Down
6 changes: 4 additions & 2 deletions mzLib/Readers/SearchResults/SpectrumMatchTsvReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ public static List<SpectrumMatchFromTsv> ReadTsv(string filePath, out List<strin
switch (filePath.ParseFileType())
{
case SupportedFileType.psmtsv:
case SupportedFileType.IntralinkResults:
psms.Add(new PsmFromTsv(line, Split, parsedHeader));
break;

// TODO: Create an osmtsv case when transcriptomics is merged
//case SupportedFileType.osmtsv:
// psms.Add(new OsmFromTsv(line, Split, parsedHeader));
// break;

default:
throw new ArgumentOutOfRangeException();
Expand Down
6 changes: 5 additions & 1 deletion mzLib/Readers/Util/SupportedFileTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public enum SupportedFileType
Mgf,
BrukerD,
psmtsv,
//osmtsv
IntralinkResults,
//osmtsv,
ToppicPrsm,
ToppicPrsmSingle,
ToppicProteoform,
Expand Down Expand Up @@ -51,6 +52,7 @@ public static string GetFileExtension(this SupportedFileType type)
SupportedFileType.Mgf => ".mgf",
SupportedFileType.BrukerD => ".d",
SupportedFileType.psmtsv => ".psmtsv",
SupportedFileType.IntralinkResults => "Intralinks.tsv",
//SupportedFileType.osmtsv => ".osmtsv",
SupportedFileType.ToppicPrsm => "_prsm.tsv",
SupportedFileType.ToppicPrsmSingle => "_prsm_single.tsv",
Expand Down Expand Up @@ -116,6 +118,8 @@ public static SupportedFileType ParseFileType(this string filePath)
return SupportedFileType.MsPathFinderTDecoys;
if (filePath.EndsWith(SupportedFileType.MsPathFinderTAllResults.GetFileExtension(), StringComparison.InvariantCultureIgnoreCase))
return SupportedFileType.MsPathFinderTAllResults;
if (filePath.EndsWith(SupportedFileType.IntralinkResults.GetFileExtension(), StringComparison.InvariantCultureIgnoreCase))
return SupportedFileType.IntralinkResults;

// these tsv cases are just .tsv and need an extra step to determine the type
// currently need to distinguish between FlashDeconvTsv and MsFraggerPsm
Expand Down
7 changes: 7 additions & 0 deletions mzLib/Test/FileReadingTests/SearchResults/XL_Intralinks.tsv

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions mzLib/Test/FileReadingTests/TestPsmFromTsv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public static class TestPsmFromTsv
[TestCase("oglycoSinglePsms.psmtsv", 2)] // oglyco
[TestCase("nglyco_f5.psmtsv", 5)] // nglyco
[TestCase("VariantCrossTest.psmtsv", 15)] // variant crossing
[TestCase("XL_Intralinks.tsv", 6)] // variant crossing
[TestCase("XLink.psmtsv", 19)] // variant crossing
public static void TestPsmReaderWithMultipleEntryPoints(string path, int expected)
{
string psmFilePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"FileReadingTests\SearchResults",
Expand Down
2 changes: 2 additions & 0 deletions mzLib/Test/FileReadingTests/TestSupportedFileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ internal class TestSupportedFileExtensions
[TestCase(@"FileReadingTests\ExternalFileTypes\MsPathFinderT_DecoyResults_IcDecoy.tsv", SupportedFileType.MsPathFinderTDecoys)]
[TestCase(@"FileReadingTests\ExternalFileTypes\MsPathFinderT_AllResults_IcTda.tsv", SupportedFileType.MsPathFinderTAllResults)]
[TestCase(@"FileReadingTests\ExternalFileTypes\crux.txt", SupportedFileType.CruxResult)]
[TestCase(@"FileReadingTests\ExternalFileTypes\XL_Intralinks.tsv", SupportedFileType.IntralinkResults)]
[TestCase(@"FileReadingTests\ExternalFileTypes\XLink.psmtsv", SupportedFileType.psmtsv)]
public static void TestSupportedFileTypeExtensions(string filePath, SupportedFileType expectedType)
{
var supportedType = filePath.ParseFileType();
Expand Down
3 changes: 3 additions & 0 deletions mzLib/Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@
<None Update="FileReadingTests\SearchResults\XLink.psmtsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="FileReadingTests\SearchResults\XL_Intralinks.tsv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="ModificationTests\CommonArtifacts.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down

0 comments on commit 351e9f0

Please sign in to comment.