Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4ba034e1 authored by BOULLE Olivier's avatar BOULLE Olivier
Browse files

fix buf removing some assemblies

parent 382e55bc
Branches
No related tags found
No related merge requests found
...@@ -80,6 +80,10 @@ def assemble_blocks_simulation(eBlocks_list: list, nbr_mol: int) -> dict: ...@@ -80,6 +80,10 @@ def assemble_blocks_simulation(eBlocks_list: list, nbr_mol: int) -> dict:
for block in eBlocks_list[1:]: for block in eBlocks_list[1:]:
last_overhang = current_assembly[-overhang_size:] last_overhang = current_assembly[-overhang_size:]
if block[:overhang_size] != last_overhang:
print("error assembly simulation, overhangs not compatibles", last_overhang, block[-overhang_size:])
exit(1)
overhang_link_proba = float(overhang_assembly_stats_dict[last_overhang]) overhang_link_proba = float(overhang_assembly_stats_dict[last_overhang])
if random.random() <= overhang_link_proba: # chance to succeed overhang linking if random.random() <= overhang_link_proba: # chance to succeed overhang linking
...@@ -91,6 +95,7 @@ def assemble_blocks_simulation(eBlocks_list: list, nbr_mol: int) -> dict: ...@@ -91,6 +95,7 @@ def assemble_blocks_simulation(eBlocks_list: list, nbr_mol: int) -> dict:
# add the assembly to the dict # add the assembly to the dict
assembly_dict["molecule_"+str(mol_index)] = current_assembly assembly_dict["molecule_"+str(mol_index)] = current_assembly
mol_index += 1
return assembly_dict return assembly_dict
...@@ -146,7 +151,8 @@ def eBlocks_assembly(input_path: str, output_path: str, nbr_mol: int) -> None: ...@@ -146,7 +151,8 @@ def eBlocks_assembly(input_path: str, output_path: str, nbr_mol: int) -> None:
# simulate bsaI digestion # simulate bsaI digestion
blocks_list = digest_bsaI(blocks_list) blocks_list = digest_bsaI(blocks_list)
# simulation assembly by overhangs, fatal error if overhangs are not compatibles for successive blocks # simulation assembly by overhangs, fatal error if overhangs are not compatibles for successive blocks
assembly_dict = assemble_blocks(blocks_list) #assembly_dict = assemble_blocks(blocks_list)
assembly_dict = assemble_blocks_simulation(blocks_list, nbr_mol)
# save the assemblies into file # save the assemblies into file
dfr.save_dict_to_fasta(assembly_dict, output_path) dfr.save_dict_to_fasta(assembly_dict, output_path)
...@@ -156,7 +162,7 @@ def container_assembly(input_dir_path, output_dir_path, nbr_mol): ...@@ -156,7 +162,7 @@ def container_assembly(input_dir_path, output_dir_path, nbr_mol):
for filename in os.listdir(input_dir_path): for filename in os.listdir(input_dir_path):
file_path = os.path.join(input_dir_path, filename) file_path = os.path.join(input_dir_path, filename)
if os.path.isdir(file_path): if os.path.isdir(file_path):
input_file = file_path+"/5_blocks_buffer.fasta" input_file = file_path+"/5_blocks_buffer.fasta"
output_file = os.path.join(output_dir_path, filename+".fasta") output_file = os.path.join(output_dir_path, filename+".fasta")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment