Core
pd2af.transform
transform(map_or_model: Map | Model, mode: str = 'normal', layout_mode: LayoutMode | Literal['auto'] | None = 'auto', influence_pairing: InfluencePairingMode = CROSS, keep_species: bool | None = None, drop_compartments: bool | None = None, set_active: list[str] | None = None, set_inactive: list[str] | None = None, set_all_active: bool = False, set_all_inactive: bool = False, exclude_groups: tuple[str, ...] = (), exclude_rules: tuple[str, ...] = (), element_to_annotations: dict | None = None, element_to_notes: dict | None = None) -> TransformerResult
Transform a process-description map or model into an activity-flow one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
map_or_model
|
Map | Model
|
The input CellDesigner or SBGN-PD map, or a bare model of
either language. A bare model has no geometry, so |
required |
mode
|
str
|
Name of the transformation mode; see
:func: |
'normal'
|
layout_mode
|
LayoutMode | Literal['auto'] | None
|
How to lay the output out: |
'auto'
|
influence_pairing
|
InfluencePairingMode
|
How to draw an influence whose source or target maps
to several glyphs: |
CROSS
|
keep_species
|
bool | None
|
Keep each species as its own activity instead of merging
the forms of the same base entity. |
None
|
drop_compartments
|
bool | None
|
Drop the compartments, so that species differing
only by compartment become a single activity and the influences
that become equal merge in turn. Works with every mode; because
activities merge, it requires |
None
|
set_active
|
list[str] | None
|
Ids of elements to surface as activities whatever the map's structural signals say. |
None
|
set_inactive
|
list[str] | None
|
Ids of elements to suppress, overriding the automatic
activity discovery. Wins over |
None
|
set_all_active
|
bool
|
Make every top-level species / entity pool an activity, subunits excluded. |
False
|
set_all_inactive
|
bool
|
Suppress activity for every element, subunits included. |
False
|
exclude_groups
|
tuple[str, ...]
|
Identifiers of rule groups to drop from the program. |
()
|
exclude_rules
|
tuple[str, ...]
|
Identifiers of individual rules to drop. |
()
|
element_to_annotations
|
dict | None
|
The reader's |
None
|
element_to_notes
|
dict | None
|
The reader's |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
TransformerResult
|
class: |
TransformerResult
|
model input), the provenance mapping, and the carried annotation and |
|
TransformerResult
|
note side-tables. |
Source code in src/pd2af/core.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
pd2af.TransformerResult
dataclass
TransformerResult(obj: Map | Model | None = None, output_element_to_input_elements: FrozenIdentityMultiDict | None = None, element_to_annotations: dict | None = None, element_to_notes: dict | None = None)
Result of :func:transform: the built AF map plus provenance.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Map | Model | None
|
|
None
|
output_element_to_input_elements
|
FrozenIdentityMultiDict | None
|
|
None
|
element_to_annotations
|
dict | None
|
|
None
|
element_to_notes
|
dict | None
|
|
None
|