MAF To Variant Classification Example¶
This notebook tests the read_maf
method from the pyMut.input
module that generates a PyMutation
object.
The read_maf
function now includes automatic caching functionality for improved performance.
In [1]:
Copied!
# Path to MAF file
maf_path = "../../../src/pyMut/data/examples/MAF/tcga_laml.maf.gz"
print(f'📂 Loading file: {maf_path}')
# Path to MAF file
maf_path = "../../../src/pyMut/data/examples/MAF/tcga_laml.maf.gz"
print(f'📂 Loading file: {maf_path}')
📂 Cargando archivo: ../../../src/pyMut/data/examples/MAF/tcga_laml.maf.gz
In [2]:
Copied!
from pyMut.input import read_maf
import time
# Read the MAF file and generate the PyMutation object
print("First read (will create cache)...")
start_time = time.time()
py_mutation = read_maf(maf_path, assembly="37")
first_read_time = time.time() - start_time
print(f"First read completed in {first_read_time:.3f} seconds")
# Show the resulting object
print(py_mutation)
from pyMut.input import read_maf
import time
# Read the MAF file and generate the PyMutation object
print("First read (will create cache)...")
start_time = time.time()
py_mutation = read_maf(maf_path, assembly="37")
first_read_time = time.time() - start_time
print(f"First read completed in {first_read_time:.3f} seconds")
# Show the resulting object
print(py_mutation)
2025-08-01 00:57:10,611 | INFO | pyMut.input | Starting MAF reading: ../../../src/pyMut/data/examples/MAF/tcga_laml.maf.gz 2025-08-01 00:57:10,611 | INFO | pyMut.input | Loading from cache: ../../../src/pyMut/data/examples/MAF/.pymut_cache/tcga_laml.maf_8bfbda65c4b23428.parquet
Primera lectura (creará cache)...
2025-08-01 00:57:10,651 | INFO | pyMut.input | Cache loaded successfully in 0.04 seconds
Primera lectura completada en 0.041 segundos <pyMut.core.PyMutation object at 0x7c46f70df280>
In [3]:
Copied!
py_mutation.configure_high_quality_plots()
py_mutation.variant_classification_plot()
py_mutation.configure_high_quality_plots()
py_mutation.variant_classification_plot()
Out[3]:
In [4]:
Copied!
# py_mutation.configure_high_quality_plots()
py_mutation.summary_plot()
# py_mutation.configure_high_quality_plots()
py_mutation.summary_plot()
Out[4]:
In [5]:
Copied!
# py_mutation.configure_high_quality_plots()
py_mutation.variant_type_plot()
# py_mutation.configure_high_quality_plots()
py_mutation.variant_type_plot()
Out[5]: