trace_splitter
Reliability status: stable
This script will calculate the radii of gyration of all traces in a tracefile, estimate the median and standard deviation of the distribution to identify outliers which may arise from the merging of two traces. It will then target these outliers and perform a K-means clustering to break the trace. Each time a trace is split, it will be replaced in the tracefile and new identifiers will be provided.
Traces with R_g higher than the median + std_threshold will be treated as outliers. std_threshold is therefore an input argument.
Clusterization will be performed assuming 2 traces by default. This number can be modified using num_clusters as input argument.
usage: trace_splitter [-h] [--input INPUT] [--output OUTPUT]
[--std_threshold STD_THRESHOLD]
[--num_clusters NUM_CLUSTERS] [--pipe]
Named Arguments
- --input
Path to the input trace file.
- --output
Path to save the modified trace file. Default: appends ‘_split’.
- --std_threshold
Std deviation threshold for large traces (default: 1.0).
Default:
1.0- --num_clusters
Number of clusters for K-means (default: 2).
Default:
2- --pipe
inputs Trace file list from stdin (pipe)
Default:
False
Output Files
For each trace file analyzed, the script generates:
[tracefile]_split.ecsv: Trace table containing the original un-split traces plus the split traces, with updatedTrace_IDvalues. When--outputis provided for a single input, that exact path is used instead.
Examples
trace_splitter --input original_traces.ecsv --std_threshold 1.5 --num_clusters 3
Given a chromatin trace table, this script:
Computes radius of gyration (Rg) for all traces.
Identifies traces with Rg larger than
mean + N * std_dev.Uses K-means to split these traces into
num_clusters.Saves the modified trace table with updated Trace_IDs.
Notes
See the command-line reference above for the complete option list.