Skip to content
4 changes: 2 additions & 2 deletions manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ If a parameter is `None`, it will not be swept and will use default values.
- peptide_motif
- probe_distance_to_epitope
- probe_steric_hindrance
- probe_conjugation_efficiency
- probe_DoL
- probe_wobble_theta
- labelling_efficiency
- defect
Expand Down Expand Up @@ -449,7 +449,7 @@ If a parameter is `None`, it will not be swept and will use default values.
| **probe_fluorophore** | Fluorophore name for emitters (e.g., "AF647") |
| **probe_paratope** | If probe_model is defined, the paratope defines the anchor point of the probe |
| **probe_conjugation_target_info** | If probe_model is defined, this dictionary specifies the sites to use as probe emitters |
| **probe_conjugation_efficiency** | Efficiency of conjugation of emitters (float) |
| **probe_DoL** | Efficiency of conjugation of emitters (float) |
| **probe_seconday_epitope** | If probe is secondary, this amino acid sequence defines the epitope on the primary antibody model |
| **probe_wobble_theta** | Enable probe wobbling (float or None) |
| **probe_steric_hindrance** | Steric hindrance value or configuration (distance between epitopes) |
Expand Down
4 changes: 2 additions & 2 deletions src/vlab4mic/analysis/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def probe_parameters_sweep(
probe_fluorophore: str = None,
probe_paratope: str = None,
probe_conjugation_target_info=None,
probe_conjugation_efficiency: list[float] = None,
probe_DoL: list[float] = None,
probe_seconday_epitope=None,
probe_wobbling=None,
labelling_efficiency: list[float] = None,
Expand All @@ -885,7 +885,7 @@ def probe_parameters_sweep(
probe_fluorophore : str, optional
probe_paratope : str, optional
probe_conjugation_target_info : any, optional
probe_conjugation_efficiency : list of float, optional
probe_DoL : list of float, optional
probe_seconday_epitope : any, optional
probe_wobbling : any, optional
labelling_efficiency : list of float, optional
Expand Down
2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/Antibody.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conjugation_sites:
- CA
residues:
- LYS
efficiency: 1
DoL:
epitope: # for secondary
target:
type: Sequence
Expand Down
2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/CCP_heavy_chain_Cterminal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ conjugation_sites:
target:
type:
value:
efficiency:
DoL:

2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/GFP.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conjugation_sites:
- C1
residues:
- CRO
efficiency: 1
DoL:
epitope: # for secondary
target:
type:
Expand Down
2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/GFP_w_nanobody.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ conjugation_sites:
- LYS
chains:
- B
efficiency: 1
DoL:
epitope: # for secondary
target:
type:
Expand Down
2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/HIV_capsid_p24_direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ conjugation_sites:
target:
type:
value:
efficiency:
DoL:

2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/Linker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ conjugation_sites:
target:
type:
value:
efficiency:
DoL:

2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/NHS_ester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ conjugation_sites:
target:
type:
value:
efficiency:
DoL:

Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ conjugation_sites:
target:
type:
value:
efficiency:
DoL:

2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/Nanobody.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conjugation_sites:
- CA
residues:
- LYS
efficiency: 1
DoL:
epitope: # for secondary
target:
type:
Expand Down
2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/SNAP-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conjugation_sites:
- CAA
residues:
- OGQ
efficiency: 1
DoL:
epitope: # for secondary
target:
type:
Expand Down
2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/_template_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ conjugation_sites:
target:
type:
value:
efficiency:
DoL:
fluorophore:
epitope:
target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ conjugation_sites:
- CA
residues:
- LYS
efficiency: 0.2
DoL:

2 changes: 1 addition & 1 deletion src/vlab4mic/configs/probes/mMaple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conjugation_sites:
- C1
residues:
- PIA
efficiency: 1
DoL:
epitope: # for secondary
target:
type:
Expand Down
66 changes: 36 additions & 30 deletions src/vlab4mic/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ def add_probe(
probe_steric_hindrance=None,
probe_paratope: str = None,
probe_conjugation_target_info=None,
probe_conjugation_efficiency: float = None,
probe_DoL: float = None,
probe_seconday_epitope=None,
probe_wobble_theta: float = None,
labelling_efficiency: float = 1.0,
Expand Down Expand Up @@ -972,7 +972,7 @@ def add_probe(
Paratope identifier or information.
:param probe_conjugation_target_info : Any, optional
Information about the conjugation target.
:param probe_conjugation_efficiency : float, optional
:param probe_DoL : float, optional
Efficiency of the probe conjugation.
:param probe_seconday_epitope : Any, optional
Information about a secondary epitope target.
Expand Down Expand Up @@ -1063,10 +1063,13 @@ def add_probe(
probe_configuration["conjugation_sites"]["target"]["value"] = (
probe_conjugation_target_info["value"]
)
if probe_conjugation_efficiency is not None:
probe_configuration["conjugation_efficiency"] = (
probe_conjugation_efficiency
if probe_DoL is not None:
print(f"Setting probe DoL to: {probe_DoL}")
probe_configuration["conjugation_sites"]["DoL"] = (
probe_DoL
)
else:
print("Add_probe: Using default probe DoL from template")
if probe_seconday_epitope is not None:
probe_configuration["epitope_target_info"] = probe_seconday_epitope
if probe_wobble_theta is not None:
Expand Down Expand Up @@ -1328,7 +1331,7 @@ def generate_virtual_sample(
probe_fluorophore: str = "AF647",
probe_paratope: str = None,
probe_conjugation_target_info=None,
probe_conjugation_efficiency: float = None,
probe_DoL: float = None,
probe_seconday_epitope=None,
probe_wobble_theta=None,
labelling_efficiency: float = 1.0,
Expand Down Expand Up @@ -1381,7 +1384,7 @@ def generate_virtual_sample(
Sequence of the paratope site for when probe includes a model.
:param probe_conjugation_target_info : Any, optional
Information about the probe conjugation target.
:param probe_conjugation_efficiency : float, optional
:param probe_DoL : float, optional
Efficiency of conjugation of emitters.
:param probe_seconday_epitope : str, optional
Sequence within probe model to be used as epitope for a secondary.
Expand Down Expand Up @@ -1421,6 +1424,21 @@ def generate_virtual_sample(
myexperiment = ExperimentParametrisation()
if clear_experiment:
myexperiment.clear_experiment()
# select structure
if structure_is_path:
print(f"Selecting structure from path: {structure}")
myexperiment.select_structure(
structure_id=structure.split(".")[0],
structure_path=structure,
build=True
)
else:
print("Selecting structure from ID:", structure)
myexperiment.select_structure(
structure_id=structure,
structure_path=None,
build=True
)
# load default configuration for probe
if (primary_probe is not None) and (secondary_probe is not None):
print("Adding primary and secondary probes")
Expand Down Expand Up @@ -1462,9 +1480,9 @@ def generate_virtual_sample(
probe_configuration["conjugation_target_info"] = (
probe_conjugation_target_info
)
if probe_conjugation_efficiency is not None:
probe_configuration["conjugation_efficiency"] = (
probe_conjugation_efficiency
if probe_DoL is not None:
probe_configuration["probe_DoL"] = (
probe_DoL
)
if probe_seconday_epitope is not None:
probe_configuration["epitope_target_info"] = probe_seconday_epitope
Expand All @@ -1478,22 +1496,7 @@ def generate_virtual_sample(
virtual_sample_template + ".yaml",
)
vsample_configuration = load_yaml(virtual_sample_template)
myexperiment.configuration_path
if structure_is_path:
print(f"Selecting structure from path: {structure}")
myexperiment.select_structure(
structure_id=structure.split(".")[0],
structure_path=structure,
build=False
)
else:
print("Selecting structure from ID:", structure)
myexperiment.select_structure(
structure_id=structure,
structure_path=None,
build=False
)

#myexperiment.configuration_path
if defect and defect_large_cluster and defect_small_cluster:
myexperiment.defect_eps["eps1"] = defect_small_cluster
myexperiment.defect_eps["eps2"] = defect_large_cluster
Expand All @@ -1518,7 +1521,10 @@ def generate_virtual_sample(
vsample_configuration["yz_orientations"] = yz_orientations
vsample_configuration["axial_offset"] = axial_offset
myexperiment.virtualsample_params = vsample_configuration
myexperiment.build(use_locals=True)
myexperiment.build(modules=[
"particle",
"coordinate_field",
"imager"], use_locals=True)
if expansion_factor > 1:
myexperiment.expand_virtual_sample(factor=expansion_factor)
# myexperiment.coordinate_field_id = virtual_sample
Expand Down Expand Up @@ -1579,7 +1585,7 @@ def image_vsample(
probe_fluorophore: str = "AF647",
probe_paratope: str = None,
probe_conjugation_target_info = None,
probe_conjugation_efficiency: float = None,
probe_DoL: float = None,
probe_seconday_epitope = None,
probe_wobble_theta = None,
labelling_efficiency: float = 1.0,
Expand Down Expand Up @@ -1649,7 +1655,7 @@ def image_vsample(
Sequence of the paratope site for when probe includes a model.
:param probe_conjugation_target_info : any, optional
Information about the probe conjugation target.
:param probe_conjugation_efficiency : float, optional
:param probe_DoL : float, optional
Efficiency of conjugation of emitters.
:param probe_seconday_epitope : str, optional
Sequence within probe model to be used as epitope for a secondary.
Expand Down Expand Up @@ -1710,7 +1716,7 @@ def image_vsample(
probe_fluorophore=probe_fluorophore,
probe_paratope=probe_paratope,
probe_conjugation_target_info=probe_conjugation_target_info,
probe_conjugation_efficiency=probe_conjugation_efficiency,
probe_DoL=probe_DoL,
probe_seconday_epitope=probe_seconday_epitope,
probe_wobble_theta=probe_wobble_theta,
labelling_efficiency=labelling_efficiency,
Expand Down
14 changes: 8 additions & 6 deletions src/vlab4mic/generate/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def _set_model_params(self, ID=None, format=None, database=None, **kwargs):
for key, value in kwargs.items():
self.model[key] = value

def _set_conjugation_params(self, target: dict, efficiency, **kwargs):
def _set_conjugation_params(self, target: dict, DoL=None, **kwargs):
self.conjugation["target"] = target
self.conjugation["efficiency"] = efficiency
self.conjugation["DoL"] = DoL
for key, value in kwargs.items():
self.conjugation[key] = value

Expand Down Expand Up @@ -265,10 +265,12 @@ def construct_label(
label_params["conjugation_sites"]["target"] = kwargs[
"conjugation_target_info"
]
if "conjugation_efficiency" in kwargs.keys():
label_params["conjugation_sites"]["efficiency"] = kwargs[
"conjugation_efficiency"
]
#if "probe_DoL" in label_params.keys():
# label_params["conjugation_sites"]["DoL"] = kwargs[
# "probe_DoL"
# ]
#else:
# print("No DoL provided, using default value. ########################")
if "epitope_target_info" in kwargs.keys():
label_params["epitope"]["target"] = kwargs["epitope_target_info"]
if "wobble_theta" in label_params.keys():
Expand Down
12 changes: 6 additions & 6 deletions src/vlab4mic/sweep_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def set_sweep_parameters(
peptide_motif: dict = None,
probe_distance_to_epitope= None,
probe_steric_hindrance= None,
probe_conjugation_efficiency = None,
probe_DoL = None,
probe_wobble_theta = None,
labelling_efficiency = None,
# defects
Expand Down Expand Up @@ -568,9 +568,9 @@ def set_sweep_parameters(
self.set_parameter_values(
"probe", "probe_steric_hindrance", values=probe_steric_hindrance
)
if probe_conjugation_efficiency is not None:
if probe_DoL is not None:
self.set_parameter_values(
"probe", "probe_conjugation_efficiency", values=probe_conjugation_efficiency
"probe", "probe_DoL", values=probe_DoL
)
if probe_wobble_theta is not None:
self.set_parameter_values(
Expand Down Expand Up @@ -1345,7 +1345,7 @@ def run_parameter_sweep(
peptide_motif: dict = None,
probe_distance_to_epitope = None,
probe_steric_hindrance = None,
probe_conjugation_efficiency = None,
probe_DoL = None,
probe_wobble_theta = None,
labelling_efficiency = None,
defect = None,
Expand Down Expand Up @@ -1424,7 +1424,7 @@ def run_parameter_sweep(
- peptide_motif
- probe_distance_to_epitope
- probe_steric_hindrance
- probe_conjugation_efficiency
- probe_DoL
- probe_wobble_theta
- labelling_efficiency
- defect
Expand Down Expand Up @@ -1484,7 +1484,7 @@ def run_parameter_sweep(
peptide_motif=peptide_motif,
probe_distance_to_epitope=probe_distance_to_epitope,
probe_steric_hindrance=probe_steric_hindrance,
probe_conjugation_efficiency=probe_conjugation_efficiency,
probe_DoL=probe_DoL,
probe_wobble_theta=probe_wobble_theta,
labelling_efficiency=labelling_efficiency,
defect=defect,
Expand Down
10 changes: 8 additions & 2 deletions src/vlab4mic/utils/transform/cif_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ def indirect_labelling(coords_nomrals, label_data, **kwargs):
# select randomly, and according to labelling_efficiency
# the places that will be labelled
#efficiency = label_data["labelling_efficiency"]

if label_data["conjugation_sites"]["DoL"] is not None:
if label_data["conjugation_sites"]["DoL"] > 0:
dol=label_data["conjugation_sites"]["DoL"]
else:
dol = None
else:
dol = None
epitopes, normals = binomial_epitope_sampling(
epitopes=coords_nomrals["coordinates"],
p=label_data["labelling_efficiency"],
Expand All @@ -178,7 +184,7 @@ def indirect_labelling(coords_nomrals, label_data, **kwargs):
else:
normals_ft_epitopes = [normals, epitopes]
indirect_realisation, list_reoriented_points_normals = decorate_epitopes_normals(
normals_ft_epitopes, label_data["emitters"]
normals_ft_epitopes, label_data["emitters"], dol=dol
)
else:
print("No emitters defined in label. Using direct labelling")
Expand Down
Loading