@@ -1553,7 +1553,7 @@ async def get_other_frontend_files(name: str):
15531553
15541554
15551555@router .post ('/batch_cloning/ziqiang_et_al2024' , response_model = BaseCloningStrategy )
1556- async def ziqiang_et_al2024_post (protospacers : list [str ]):
1556+ async def ziqiang_et_al2024_post (protospacers : list [str ], until_bp : bool = Query ( False ) ):
15571557 try :
15581558 validate_protospacers (protospacers )
15591559 except ValueError as e :
@@ -1577,7 +1577,14 @@ async def ziqiang_et_al2024_post(protospacers: list[str]):
15771577
15781578 template_sequence = next (s for s in template .sequences if s .id == 18 )
15791579 for i , (fwd_primer_id , rvs_primer_id ) in enumerate (zip (primer_ids_for_pcrs [::2 ], primer_ids_for_pcrs [1 ::2 ])):
1580- pcr_source = PCRSource (id = next_node_id , output_name = f"pcr_protospacer_{ i + 1 } " )
1580+ if i == 0 :
1581+ name = 'start_ps1'
1582+ elif i == (len (primer_ids_for_pcrs ) // 2 ) - 1 :
1583+ name = f'end_ps{ i } '
1584+ else :
1585+ name = f'end_ps{ i } _start_ps{ i + 1 } '
1586+
1587+ pcr_source = PCRSource (id = next_node_id , output_name = name )
15811588 fwd_primer = next (p for p in template .primers if p .id == fwd_primer_id )
15821589 rvs_primer = next (p for p in template .primers if p .id == rvs_primer_id )
15831590
@@ -1629,6 +1636,13 @@ async def ziqiang_et_al2024_post(protospacers: list[str]):
16291636 template .sequences .append (gateway_product )
16301637 template .sources .append (gateway_source )
16311638
1639+ if until_bp :
1640+ # Delete sources and sequences left
1641+ ids2delete = list (range (5 , 11 ))
1642+ template .sources = [s for s in template .sources if s .id not in ids2delete ]
1643+ template .sequences = [s for s in template .sequences if s .id not in ids2delete ]
1644+ return template
1645+
16321646 # Now we want to do a Gateway with everything, so we need to find all sequences that are not input of anything
16331647 all_input_ids = sum ([s .input for s in template .sources ], [])
16341648 sequences_to_clone = [s for s in template .sequences if s .id not in all_input_ids ]
0 commit comments