Also on Adrien’s prompt…
The database could include both lab and puzzle results. Perhaps puzzles would wait until there were at least N solvers or until you had solved that puzzle (or both) before you could see other people’s solutions.
For lab results, it could sometimes be important to see which bases matched and which ones mismatched. Sometimes one might want also to specify only 100% matches (successful) as part of the query, or only mismatches, or both, or a count of how many times a pattern was successful versus unsuccessful?
In searching for patterns in the database, it might sometimes be useful to search on structure, or on bases, or on success/failure, or some combination.
I’d like to be able to search for say successful(?) 2-2 loop designs with at least 2-stacks, perhaps using a pattern something like this:
findBasesByStructure(pattern,success) and countBasesByStructure(pattern,success) where success is:
-2: cases where the pattern failed in a lab but succeeded in a puzzle
-1: cases where the pattern failed in a lab
0: any cases that whether successful or unsuccessful or used in a puzzle
1: cases where the pattern succeeded in a lab
2: cases where the pattern succeeded in a puzzle
3: cases where the pattern succeeded in a lab or puzzle
findBasesByStructure("((…((#))…))",1) finds successful cases of bases that match the structure pattern and folded successfully in the labs.
Here the “#” in the pattern would stand for any bracket balanced/matched string, so the pattern matches a 2-2 loop with at least a 2-stach on either end.
Or a quad multi-loop with at least 3-stacks:
findBasesWithStructure("((((((#)))(((#)))(((#))))))",0) looks for all examples of a quad multiloop with 3-stacks.
Or for a triloop on a quad-stack tested in the lab:
countWithStructure("((((…))))",0) returns the count of successful, unsuccessful, an puzzle usages that match that pattern for each unique base string.
Constraining for specific bases might be easiest to specify by interleaving the base constraints after the structure (with N for *any* being the default; ). For example:
findBasesByStructureConstrained(pattern,success) and
countBasesByStructureConstrained(pattern,success) where success can be:
-2: cases where the pattern failed in a lab but succeeded in a puzzle
-1: cases where the pattern failed in a lab
0: any cases that whether successful or unsuccessful or used in a puzzle
1: cases where the pattern succeeded in a lab
2: cases where the pattern succeeded in a puzzle
3: cases where the pattern succeeded in a lab or puzzle
countBasesByStructureConstrained("((((G…)C)))",3) counts examples from labs or puzzles with a tri-loop closed by GC on a quad-stack. The results may include a count of how many successes, failures (zero) and puzzles there were for each unique pattern.
findBasesByStructureConstrained("((((G…)C)))",3) instead finds specific examples of the pattern used successfully in a lab or puzzle with some indication or the lab/puzzle id, the bases that matched the pattern, the success/match string (in this case all “+++++++++++” since we only looked for successes, and the starting offsets of the pattern(s) (in this case one pattern) within the whole structure.
findBasesByStructureConstrained("((G…(A(#)U)…)U)",0) looks for examples of a 2-2 loop with one-end closed by GU and the other end closed by AU, which may or may not have worked. The results may include both cases that worked and cases that didn’t, and and an indication of success(1)/failure(-1)/puzzle(2) for each instance.
findBasesByStructureConstrained("(((.G…))))",-1) finds examples of a quad-loop with a G boost point that failed.
countBasesByStructureConstrained("(((.G…))))",-1) returns a collection of unique matching sequences that failed, with a count of the failures for each sequence.
findBasesByStructureConstrained("(((.A…))))",0) finds examples of a quad loop with an A in the first CCW open base; the results may include both cases that worked and cases that didn’t, and a count of how many successes and failures and puzzles there were for each unique pattern.
Alternatively, one could search primarily on bases:
countByBases(pattern,success) where success can be as above.
countByBases(“UGU”,0) counts any labs or puzzles that use that sequence, with counts of success, failure and puzzles.
findByBases(“UGU”,-1) finds examples from labs that contain the sequence where at least one of the bases is mismatched.
findByBases(“UGU”,0) finds labs or puzzles that use that sequence, successfully or not. (Hmm, -3 for labs only, no puzzles?)
Note that for puzzles, there are no “unsuccessful” cases, so;
findByBases(“UGU”,2) finds any examples from puzzles that contains the sequence.