In order to remove a specific position from a sequence, the default HSLSeqLib library can be used. The function for removing a position is called ‘SeqRemoveAt’ which takes a sequence and index and removes the position at that index:
The trickier part is determining the index of the position of interest. There are two ways to go about this. The first technique uses a loop to move through the entire sequence, while retrieving the Labware and Position IDs at the Current Position, and comparing them to the intended position to remove:
The second technique uses the ‘SeqLookupPosition’ function, which uses a sequence, Labware ID, Position ID, starting index, and direction to search the given sequence and return the index of the first instance of that sequence position. Refer to the Help file for information regarding the ‘start’ and ‘forward’ parameters:
Thank you so much for the help as I greatly appreciate the in-depth explanation! I was aware of the SeqRemoveAt function but I was unsure on how to utilize it for my needs. That being said, I was able to modify your example so that I can remove positions from an original sequence based on other (consumed) sequences, which I will share if anyone is interested.
Basically, the main loop is looping over the consumed sequence to obtain the labware ID and position ID I want to remove in the original sequence (aliquot_destination). After I define the labware and position ID I want to remove, the original sequence is then looped over until the searched labware and position ID matches the IDs I want to remove. Once it’s removed, then the second loop breaks and it rinses and repeats for the remaining sequence. What is nice about this is that both sequences does not need to have the same sorting pattern to work : )