Skip to content

Conversation

bspratt
Copy link
Member

@bspratt bspratt commented Sep 24, 2024

… (mass serialized as "344.300548579909" vs "344.300548580")

…s in iRT library and document (mass serialized as "344.300548579909" vs "344.300548580"), this was causing ambiguity in TargetResolver
@bspratt bspratt requested a review from nickshulman September 24, 2024 19:58
@nickshulman
Copy link
Contributor

nickshulman commented Sep 24, 2024

In the TargetResolver constructor, there's one code path that does this:

                _targetsByName = targets.Select(t => t.ToSerializableString())
                    .Distinct()
                    .Select(Target.FromSerializableString).ToLookup(GetTargetDisplayName);

This part of it:

Select(t => t.ToSerializableString())
                    .Distinct()
                    .Select(Target.FromSerializableString)

round-trips the target to a string, and I think it is important for removing duplicates.

The other code path does not do that:
_targetsByName = accessions.ToLookup(a => a.Item1, a => a.Item2);

I'm thinking a better fix might be to change:
foreach (var target in targets)
to:
foreach (var target in targets.Select(t=>t.ToSerializableString()).Distinct().Select(Target.FromSerializableString))
on line 68 in TargetResolver.cs

@bspratt
Copy link
Member Author

bspratt commented Sep 24, 2024

I'll have a look, thanks!

@bspratt
Copy link
Member Author

bspratt commented Sep 24, 2024

@nickshulman OK, a slightly different take on your idea, normalizes everything at the start of the ctor.

@bspratt bspratt merged commit d8f4d23 into master Sep 25, 2024
10 checks passed
@bspratt bspratt deleted the Skyline/work/20240924_target_resolver_tiny_mass_differences branch September 25, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants