Skip to content

Commit 7dcd125

Browse files
committed
Missing SA fix
1 parent 099a11c commit 7dcd125

File tree

2 files changed

+50
-52
lines changed

2 files changed

+50
-52
lines changed

MainClass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class MainClass
2020
private static readonly ILog Log =
2121
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
2222

23-
public const string Version = "1.4.3";
23+
public const string Version = "1.4.4";
2424
public static void Main(string[] args)
2525
{
2626
// Set Invariant culture as default for all further processing

Writer/MzMlSpectrumWriter.cs

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,66 +2393,64 @@ private PrecursorListType ConstructPrecursorList(int precursorScanNumber, IScanE
23932393
//increase reaction count after successful parsing
23942394
reactionCount++;
23952395

2396-
if (scanEvent.SupplementalActivation == TriState.On)
2397-
//the property is On if *at least* one of the levels had SA (i.e. not necissirily the last one), thus we need to try (and posibly fail)
2396+
//Sometimes the property of supplemental activation is not set (Tune v4 on Tribrid),
2397+
//or is On if *at least* one of the levels had SA (i.e. not necissirily the last one), thus we need to try (and posibly fail)
2398+
try
23982399
{
2399-
try
2400-
{
2401-
reaction = scanEvent.GetReaction(reactionCount);
2400+
reaction = scanEvent.GetReaction(reactionCount);
24022401

2403-
if (reaction != null)
2402+
if (reaction != null)
2403+
{
2404+
if (reaction.CollisionEnergyValid)
24042405
{
2405-
if (reaction.CollisionEnergyValid)
2406-
{
2407-
activationCvParams.Add(
2408-
new CVParamType
2409-
{
2410-
accession = "MS:1002680",
2411-
name = "supplemental collision energy",
2412-
cvRef = "MS",
2413-
value = reaction.CollisionEnergy.ToString(CultureInfo.InvariantCulture),
2414-
unitCvRef = "UO",
2415-
unitAccession = "UO:0000266",
2416-
unitName = "electronvolt"
2417-
});
2418-
}
2406+
activationCvParams.Add(
2407+
new CVParamType
2408+
{
2409+
accession = "MS:1002680",
2410+
name = "supplemental collision energy",
2411+
cvRef = "MS",
2412+
value = reaction.CollisionEnergy.ToString(CultureInfo.InvariantCulture),
2413+
unitCvRef = "UO",
2414+
unitAccession = "UO:0000266",
2415+
unitName = "electronvolt"
2416+
});
2417+
}
24192418

2420-
// Add the supplemental CV term
2421-
switch (reaction.ActivationType)
2422-
{
2423-
case ActivationType.HigherEnergyCollisionalDissociation:
2424-
activationCvParams.Add(new CVParamType
2425-
{
2426-
accession = "MS:1002678",
2427-
name = "supplemental beam-type collision-induced dissociation",
2428-
cvRef = "MS",
2429-
value = ""
2430-
}); break;
2431-
2432-
case ActivationType.CollisionInducedDissociation:
2433-
activationCvParams.Add(new CVParamType
2434-
{
2435-
accession = "MS:1002679",
2436-
name = "supplemental collision-induced dissociation",
2437-
cvRef = "MS",
2438-
value = ""
2439-
}); break;
2419+
// Add the supplemental CV term
2420+
switch (reaction.ActivationType)
2421+
{
2422+
case ActivationType.HigherEnergyCollisionalDissociation:
2423+
activationCvParams.Add(new CVParamType
2424+
{
2425+
accession = "MS:1002678",
2426+
name = "supplemental beam-type collision-induced dissociation",
2427+
cvRef = "MS",
2428+
value = ""
2429+
}); break;
24402430

2441-
default:
2442-
Log.Warn($"Unknown supplemental activation type: {reaction.ActivationType}");
2443-
ParseInput.NewWarn();
2444-
break;
2431+
case ActivationType.CollisionInducedDissociation:
2432+
activationCvParams.Add(new CVParamType
2433+
{
2434+
accession = "MS:1002679",
2435+
name = "supplemental collision-induced dissociation",
2436+
cvRef = "MS",
2437+
value = ""
2438+
}); break;
24452439

2446-
}
2440+
default:
2441+
Log.Warn($"Unknown supplemental activation type: {reaction.ActivationType}");
2442+
ParseInput.NewWarn();
2443+
break;
24472444

2448-
//increase reaction count after successful parsing
2449-
reactionCount++;
24502445
}
2446+
2447+
//increase reaction count after successful parsing
2448+
reactionCount++;
24512449
}
2452-
catch (ArgumentOutOfRangeException)
2453-
{
2454-
// If we failed do nothing
2455-
}
2450+
}
2451+
catch (ArgumentOutOfRangeException)
2452+
{
2453+
// If we failed do nothing
24562454
}
24572455

24582456
precursor.activation =

0 commit comments

Comments
 (0)