thermofisherlsms / iapi

Instrument Application Programming Interface
MIT License
44 stars 17 forks source link

Question - Which field in the Trailer corresponds to the RunningNumber in IScanDefinition? #19

Closed chhh closed 6 years ago

chhh commented 6 years ago

Which field in the Trailer corresponds to the RunningNumber in IScanDefinition?

dbaileychess commented 6 years ago

The field would be the 'Access ID:' field in the trailer-extra portion of the rawfile. There is some historical reasons for the name change and we didn't feel like it was necessary to unify the name at this time. Perhaps in the future the property and field in the rawfile will be common.

chhh commented 6 years ago

@dbaileychess Is this field available during online acquisition with the IAPI? I couldn't find a field named "Access ID" in the Trailer of an arriving IMsScan.

Here's the code I use to dump Trailer information from IMsScan (using scan.Trailer as source argument):

public static string InfoSourceToString(IInformationSourceAccess source, bool outputEmpty)
{
    if (source == null) return "NULL";
    if (!source.Available) return "Not available";
    if (!source.Valid) return "Not valid";
    var entries = new List<string>();
    foreach (string key in source.ItemNames)
    {
        if (source.TryGetValue(key, out var val))
            entries.Add($"{key}: {val}");
        else if (outputEmpty)
            entries.Add($"{key}: N/A");
    }

    return entries.Count == 0 ? "No entries" : string.Join(", ", entries);
}