You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to gauge your appetite for being able to lookup samples by Sample_ID.
get_sample(id: str) -> Optional[Sample]
In the simple case where no lane is defined, it will return None if not found and the Sample if found. There is more than one sample with the same Sample_ID, then an exception is raised. This could be caused by the samples having different Library_IDs or having different Lane values. So that leads to a second function:
This one is more complicated, as it depends on if Library_ID and lane are specified in the function call and samples. But fundamentally, it will return None if there is no sample(s) with exactly the values given, otherwise all the samples with the exactly the values given.
My biggest concern is how to implement this. If we store a samples map (e.g. self._samples: Dict[Tuple[str, Optional[str], Optional[str]]] for Sample_ID, Library_ID, and Lane), then how does this get updated if Sample is changed? Alternatively, we can just use the iterator and filter, which isn't so bad as there's typically not too many samples, and if folks want something fast they can create this map themselves.
I am sure folks will want to have a map on different key (e.g. folks sometimes use Sample_Name as a unique key, but that's not strictly valid), but that's out of scope.
Thoughts?
The text was updated successfully, but these errors were encountered:
I wanted to gauge your appetite for being able to lookup samples by
Sample_ID
.get_sample(id: str) -> Optional[Sample]
In the simple case where no lane is defined, it will return None if not found and the
Sample
if found. There is more than one sample with the sameSample_ID
, then an exception is raised. This could be caused by the samples having differentLibrary_ID
s or having differentLane
values. So that leads to a second function:get_samples(id: str, library_id: Optional[str] = None, lane: Optional[str] = None) -> Optional[List[Sample]]
This one is more complicated, as it depends on if
Library_ID
andlane
are specified in the function call and samples. But fundamentally, it will returnNone
if there is no sample(s) with exactly the values given, otherwise all the samples with the exactly the values given.My biggest concern is how to implement this. If we store a samples map (e.g.
self._samples: Dict[Tuple[str, Optional[str], Optional[str]]]
for Sample_ID, Library_ID, and Lane), then how does this get updated ifSample
is changed? Alternatively, we can just use the iterator and filter, which isn't so bad as there's typically not too many samples, and if folks want something fast they can create this map themselves.I am sure folks will want to have a map on different key (e.g. folks sometimes use
Sample_Name
as a unique key, but that's not strictly valid), but that's out of scope.Thoughts?
The text was updated successfully, but these errors were encountered: