CopickPicks
copick.models.CopickPicks
Encapsulates all data pertaining to a specific set of picked points. This includes the locations, orientations, and other metadata for the set of points.
Attributes:
-
run(CopickRun) –Reference to the run this pick belongs to.
-
meta(CopickPicksFile) –Metadata for this pick.
-
points(List[CopickPoint]) –Points for this pick. Either populated from storage or lazily loaded when
CopickPicks.pointsis accessed for the first time. -
from_tool(bool) –Flag to indicate if this pick was generated by a tool.
-
pickable_object_name(str) –Pickable object name from
CopickConfig.pickable_objects[...].name -
user_id(str) –Unique identifier for the user or tool name.
-
session_id(str) –Unique identifier for the pick session
-
trust_orientation(bool) –Flag to indicate if the angles are known for this pick or should be ignored.
-
color(Union[Tuple[int, int, int, int], None]) –Color of the pickable object this pick belongs to.
__init__
Parameters:
-
run(CopickRun) –Reference to the run this pick belongs to.
-
file(CopickPicksFile) –Metadata for this set of points.
load
numpy
Return the points as a [N, 3] numpy array (N, [x, y, z]) and the transforms as a [N, 4, 4] numpy array. Format of the transforms is:
Returns:
-
Tuple[ndarray, ndarray]–Tuple[np.ndarray, np.ndarray]: The picks and transforms as numpy arrays.
instance_ids
Return the instance IDs of the points as a [N] integer array.
For filament objects the instance ID is the filament ID (starting at 1; 0 means unassigned).
scores
Return the scores of the points as a [N] float array (1.0 where a point has no score).
full_positions
Return the particle centres as a [N, 3] array in Angstrom: each point's location plus the translation of its transform, which holds shifts such as those refined during subtomogram averaging.
Use this, not the locations returned by numpy(), wherever a particle is placed, drawn or extracted.
from_numpy
from_numpy(positions: ndarray, transforms: Optional[ndarray] = None, instance_ids: Optional[ndarray] = None, scores: Optional[ndarray] = None) -> None
Set the points and transforms from numpy arrays, and store them.
Parameters:
-
positions(ndarray) –[N, 3] numpy array of positions (N, [x, y, z]).
-
transforms(Optional[ndarray], default:None) – -
instance_ids(Optional[ndarray], default:None) –[N] integer array of instance IDs (>= 0). For filament objects, the filament ID of each point (starting at 1). If None, every point gets 0.
-
scores(Optional[ndarray], default:None) –[N] array of finite scores. If None, every point gets 1.0.
Raises:
-
ValueError–If the array lengths differ, an instance ID is negative or not an integer, or a score is not finite.
df
Returns the points as a pandas DataFrame with columns based on the format.
For format="relion", keyword arguments go to copick.util.relion.picks_to_df_relion
(voxel_spacing, tilt_series_pixel_size, tomogram_center).