Data formats
Traceratops reads and writes tabular data as Astropy ECSV files. ECSV files are plain-text tables with a YAML metadata header, followed by a whitespace-delimited data table.
A typical ECSV file has these parts:
# %ECSV 1.0: identifies the file as ECSV version 1.0.# ---: starts the YAML header.# datatype: lists every column name and data type.# meta: optional table-level metadata. Traceratops commonly stores processing comments here, such as filtering steps, coordinate units, genome assembly, or merge history.# schema: astropy-2.0: identifies the Astropy ECSV schema.The first non-comment line is the table header. Column names containing spaces or special characters are quoted, for example
"ROI #".Remaining lines are one row per spot, trace localization, or detected object.
Trace table
A trace table stores spots that have been assigned to chromatin traces. Each row is one spot in one trace.
Example header
# %ECSV 1.0
# ---
# datatype:
# - {name: Spot_ID, datatype: string}
# - {name: Trace_ID, datatype: string}
# - {name: x, datatype: float32}
# - {name: y, datatype: float32}
# - {name: z, datatype: float32}
# - {name: Chrom, datatype: string}
# - {name: Chrom_Start, datatype: int64}
# - {name: Chrom_End, datatype: int64}
# - {name: 'ROI #', datatype: int64}
# - {name: Mask_id, datatype: int64}
# - {name: 'Barcode #', datatype: int64}
# - {name: label, datatype: string}
# meta: !!omap
# - comments: [xyz_unit=micron, genome_assembly=mm10]
# schema: astropy-2.0
Spot_ID Trace_ID x y z Chrom Chrom_Start Chrom_End "ROI #" Mask_id "Barcode #" label
Columns
Column |
Type |
Meaning |
|---|---|---|
|
|
Unique identifier for the spot/localization. This usually matches the localization table |
|
|
Unique identifier for the chromatin trace. Rows with the same |
|
|
Spot x coordinate. In traceratops trace tables this is normally in micrometers when the metadata contains |
|
|
Spot y coordinate, normally in the same unit as |
|
|
Spot z coordinate, normally in the same unit as |
|
|
Chromosome or contig associated with the barcode, for example |
|
|
Genomic start coordinate for the barcode interval. |
|
|
Genomic end coordinate for the barcode interval. |
|
|
Region-of-interest identifier from the acquisition or processing workflow. |
|
|
Segmentation mask identifier associated with the trace or spot. Depending on the dataset, this often represents the cell or nuclear mask used during trace construction. |
|
|
Barcode identifier for the genomic locus or probe round. This value is used to order spots along the assayed genomic region and to match BED barcode definitions. |
|
|
Optional label assigned to the trace or spot, for example after mask assignment or label splitting. It may be empty when no label has been assigned. |
Metadata comments
The meta.comments list records table-level processing information. Common entries include:
xyz_unit=micron: coordinate units forx,y, andz.genome_assembly=...: genome assembly used for genomic coordinates, for examplemm10.filt:...: filtering operations applied to the table.Genomic coordinates imputed from BED file. ... rows matched.: genomic coordinate annotation history.appended_trace_files=...: number of trace files merged into the table.
Localization table
A localization table stores detected spots before or alongside trace assignment. Each row is one detected localization and its quality-control measurements.
Example header
# %ECSV 1.0
# ---
# datatype:
# - {name: Buid, datatype: string}
# - {name: 'ROI #', datatype: int64}
# - {name: 'CellID #', datatype: int64}
# - {name: 'Barcode #', datatype: int64}
# - {name: id, datatype: int64}
# - {name: zcentroid, datatype: float32}
# - {name: xcentroid, datatype: float32}
# - {name: ycentroid, datatype: float32}
# - {name: snr, datatype: float32}
# - {name: spot_pixel_percentage, datatype: float32}
# - {name: skew, datatype: float32}
# - {name: patch_size, datatype: int64}
# - {name: object_class, datatype: int64}
# - {name: mean_intensity, datatype: float32}
# - {name: flux, datatype: float32}
# - {name: roundness, datatype: float32}
# meta: !!omap
# - comments: [filtered, filtered]
# schema: astropy-2.0
Buid "ROI #" "CellID #" "Barcode #" id zcentroid xcentroid ycentroid snr spot_pixel_percentage skew patch_size object_class mean_intensity flux roundness
Columns
Column |
Type |
Meaning |
|---|---|---|
|
|
Unique barcode localization identifier. This is the localization-table identifier matched to |
|
|
Region-of-interest identifier from the acquisition or processing workflow. |
|
|
Cell identifier assigned during segmentation or localization processing. |
|
|
Barcode identifier for the genomic locus or probe round. |
|
|
Row-local object identifier for the detected localization within the source table or barcode image. |
|
|
Detected spot centroid in z, typically in image-coordinate units from the localization pipeline. |
|
|
Detected spot centroid in x, typically in image-coordinate units from the localization pipeline. |
|
|
Detected spot centroid in y, typically in image-coordinate units from the localization pipeline. |
|
|
Signal-to-noise ratio for the detected spot. Higher values indicate stronger signal relative to noise. |
|
|
Percentage of pixels in the detection patch assigned to the spot. This can be used to remove overly broad or poorly segmented detections. |
|
|
Intensity-distribution skewness measurement for the detected spot. |
|
|
Size of the image patch, in pixels, used to measure or classify the object. |
|
|
Classification label for the detected object. In traceratops filtering, |
|
|
Mean intensity measured for the detected localization. |
|
|
Integrated or fitted spot signal reported by the localization workflow. In some outputs this can match the SNR-like score used by upstream detection. |
|
|
Shape descriptor for the detected spot. Values are used by quality filters to remove objects with undesired shape. |
Metadata comments
The meta.comments list records table-level processing information. For localization tables, entries such as filtered indicate that one or more filtering steps were applied before writing the file.
Relationship between trace and localization tables
Trace tables and localization tables can be used together for quality filtering and provenance:
trace.Spot_IDcorresponds tolocalization.Buid.ROI #andBarcode #appear in both formats and help match spots to acquisition regions and barcode rounds.Trace coordinates are stored as
x,y, andz, while localization centroids are stored asxcentroid,ycentroid, andzcentroid.Localization quality columns such as
snr,mean_intensity,spot_pixel_percentage,skew,patch_size,object_class, androundnesscan be used to filter spots, which in turn filters the corresponding trace-table rows.