API
Import MERQuaCo as:
import merquaco as mqc
Experiment
|
Reads and returns transcripts table dataframe |
|
Filters transcripts DataFrame to remove 'Blank' codewords |
|
Reads codebook for use with data loss module |
|
Scales transcripts (x,y) locations based on min (x,y) values |
|
Group transcripts by FOV and stores per-FOV information, including coordinates and transcript counts |
|
Find neighbors for each FOV using grid coordinates |
|
Creates FOVs DataFrame including coordinates, transcript counts, z-ratio, neighbors |
Calculates transcript density per on-tissue micron |
|
Runs entire dropout pipeline, including false positive correction |
|
Runs entire pixel classification workflow: |
|
|
Runs all standard QC functions and prints results |
Data Loss
|
Use ilastik transcripts mask to detemine on- and off-tissue FOVs FOV is considered on-tissue if at least 50% of its area is on-tissue |
|
Compares cardinal neighbors for each FOV to detect dropout |
|
Compares genes in FOVs and codebook dataframes and removes mismatched genes from consideration. |
|
Detects false positive FOV dropouts by evaluating codebook rounds in which the genes dropped for a target FOV |
|
Save FOVs dataframe as .txt.gz file |
Get total number of dropped FOVs |
|
|
Get a list of dropped genes. |
|
Gets number of dropped genes. |
|
Get a list of dropped FOV names. |
|
Gets number of unique dropped FOVs. |
|
Gets a list of all genes with at least 1 FOV considered for dropout. |
Gets number of genes with at least 1 FOV considered for dropout. |
|
Gets a list of all on-tissue FOVs |
|
Gets number of on-tissue FOVs |
|
Get list of all FOVs not considered dropped due to false positive correction. |
|
Get number of FOVs not considered dropped due to false positive correction. |
|
|
Prints a summary of FOV dropout for the experiment |
Draws heatmap of number of genes dropped per FOV |
Periodicity
|
Performs periodicity analysis across z-planes |
|
Calculates histogram and periodicity chunk values for transcripts DataFrame |
|
Helper method to calculate dimensions for image based on max (x,y) values |
|
Performs periodicity analysis in all z-planes collapsed |
Z-Axis Nonuniformity
|
Iterates through z-planes and returns array of transcript counts per plane |
|
Returns ratio of transcript counts between highest and lowest planes |
Perfusion
|
Extract and analyze flow rate information from log file |
Figures
|
Plots transcripts overview, subsampling 0.1% by default. |
|
Plot transcripts overview with histogram of counts along each axis. |
|
Plots transcripts overview for each z plane in a row |
|
Plot transcript counts for each z plane |
|
Plot (and save) figure of extracted fluidics log file data |
|
Plots proportion of 'ideal tissue area' for each classified category |
|
Plots pixel classification of an experiment |
|
Plots full pixel classification figure with pixel classification, pixel percentages, and all binary masks. |
|
Processes and plots binary msk |
|
Pixel Classification
|
Runs pixel and object classification workflows to create and save binary mask |
|
Creates transcripts image from transcripts via 2D histogram |
|
Return transcripts mask, either from image path (if exists), or by generating from transcripts table |
|
Creates a lower-resolution DAPI image by binning, normalizing, and removing off-tissue pixels. |
|
Generate binary DAPI mask from compressde DAPI image or high-res DAPI output image |
Generate and save gel detachment mask by subtracting transcript mask from DAPI mask |
|
|
Creates and saves image of ventricle genes superimposed on DAPI image |
|
Creates and saves binary ventricle marker genes mask from transcripts dataframe and ventricle gene list |
|
Generate and save binary tissue damage mask |
|
Combine all masks and classify each pixel as either damage, tissue, detachment, ventricle, or off-tissue |
|
Calculates class areas in microns |
|
Computes and uses "ideal" tissue area as denominator for pixel percentage calculations |