File Writers¶
Network export functionality for various formats.
Overview¶
Export networks in multiple formats:
- NEXUS: Compatible with PopART
- GML: Graph Modeling Language
- GraphML: XML-based graph format
- JSON: JavaScript Object Notation
Modules¶
pypopart.io.network_export ¶
Network export module for PyPopART.
Provides exporters for various network file formats.
GraphMLExporter ¶
Export haplotype networks to GraphML format.
Source code in src/pypopart/io/network_export.py
__init__ ¶
Initialize GraphML exporter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Union[str, Path]
|
Output file path. |
required |
export ¶
Export network to GraphML format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
HaplotypeNetwork
|
HaplotypeNetwork object. |
required |
Source code in src/pypopart/io/network_export.py
GMLExporter ¶
Export haplotype networks to GML format.
Source code in src/pypopart/io/network_export.py
__init__ ¶
Initialize GML exporter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Union[str, Path]
|
Output file path. |
required |
export ¶
Export network to GML format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
HaplotypeNetwork
|
HaplotypeNetwork object. |
required |
Source code in src/pypopart/io/network_export.py
CytoscapeExporter ¶
Export haplotype networks to Cytoscape JSON format.
Source code in src/pypopart/io/network_export.py
__init__ ¶
Initialize Cytoscape exporter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Union[str, Path]
|
Output file path. |
required |
export ¶
Export network to Cytoscape JSON format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
HaplotypeNetwork
|
HaplotypeNetwork object. |
required |
Source code in src/pypopart/io/network_export.py
JSONExporter ¶
Export haplotype networks to JSON format.
Source code in src/pypopart/io/network_export.py
__init__ ¶
Initialize JSON exporter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Union[str, Path]
|
Output file path. |
required |
export ¶
Export network to JSON format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
HaplotypeNetwork
|
HaplotypeNetwork object. |
required |
include_layout
|
bool
|
Whether to include node layout positions. |
True
|
Source code in src/pypopart/io/network_export.py
CSVExporter ¶
Export haplotype network statistics to CSV format.
Source code in src/pypopart/io/network_export.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 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 | |
__init__ ¶
Initialize CSV exporter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Union[str, Path]
|
Output file path. |
required |
export_nodes ¶
Export node attributes to CSV.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
HaplotypeNetwork
|
HaplotypeNetwork object. |
required |
Source code in src/pypopart/io/network_export.py
export_edges ¶
Export edge attributes to CSV.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
HaplotypeNetwork
|
HaplotypeNetwork object. |
required |
Source code in src/pypopart/io/network_export.py
export_statistics ¶
Export network statistics to CSV.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
HaplotypeNetwork
|
HaplotypeNetwork object. |
required |
statistics
|
Dict[str, Any]
|
Dictionary of statistics to export. |
required |