This skill performs PCA-based A/B compartments calling on Hi-C .mcool datasets using pre-defined MCP tools from the cooler-tools, cooltools-tools, and plot-hic-tools servers.
This skill provides an automated workflow for compartments calling on .mcool, .cool or .hic Hi-C data.
Main steps include:
Use this skill when:
.mcool or .cool files.${sample}_Compartments_calling/
compartments/
eigs.${resolution}.cis.vecs.tsv # PC1 compartment scores
eigs.${resolution}.bw
eigs.${resolution}.cis.lam.txt
saddle.cis.${resolution}.digitized.tsv
saddle.cis.${resolution}.saddledump.npz
plots/ # PC1 track for genome browser
saddle.cis.${resolution}.pdf # Saddle plot visualization
temp/
expected.${resolution}.cis.tsv
view_${genome}.tsv # Chromosome-arm view definition
bins.${res}.tsv
gc.${res}.tsv
When using this skill, you should restrict yourself to the following MCP tools from server cooler-tools, cooltools-tools, plot-hic-tools, project-init-tools, genome-locate-tools:
mcp__project-init-tools__project_initmcp__genome-locate-tools__genome_locate_fastamcp__HiCExplorer-tools__hic_to_mcoolmcp__cooler-tools__list_mcool_resolutionsmcp__cooler-tools__harmonize_chrom_namesmcp__cooler-tools__make_view_chromarmsmcp__cooler-tools__dump_bins_for_gcmcp__cooltools-tools__run_genome_gcmcp__cooltools-tools__run_expected_cismcp__cooltools-tools__run_eigs_cismcp__cooltools-tools__run_saddlemcp__plot-hic-tools__plot_saddle_pdfDo NOT fall back to:
cooler dump, cooltools eigs-cis, cooltools saddle, etc.)cooler, bioframe, matplotlib manually in the reply).Before calling any tool, ask the user:
Sample name (sample): used as prefix and for the output directory ${sample}_Compartments_calling.
Genome assembly (genome): e.g. hg38, mm10, danRer11.
Hi-C matrix path/URI (mcool_uri): e.g. .mcool file path or .hic file path.
path/to/sample.mcool::/resolutions/100000 (.mcool file with resolution specified).cool file path.hic file pathResolution (resolution): default 100000 (100 kb).
100000 as default.${mcool_uri}Call:
mcp__project-init-tools__project_initwith:
sample: the user-provided sample nametask: loop_callingThe tool will:
${sample}_loop_calling directory.${sample}_loop_calling directory, which will be used as ${proj_dir}..hic file, convert it to .mcool file using mcp__HiCExplorer-tools__hic_to_mcool tool:Call:
mcp__HiCExplorer-tools__hic_to_mcoolwith:
input_hic: the user-provided path (e.g. input.hic)sample: the user-provided sample nameproj_dir: directory to save the view file. In this skill, it is the full path of the ${sample}_loop_calling directory returned by mcp__project-init-tools__project_init.The tool will:
.hic file to .mcool file..mcool file.If the conversion is successful, update ${mcool_uri} to the path of the .mcool file.
Call:
mcp__genome-locate-tools__genome_locate_fastawith:
genome: the user-provided genome assemblyThe tool will:
mcool_uri:Call:
mcp__cooler-tools__list_mcool_resolutionswith:
mcool_path: the user-provided path (e.g. input.mcool) without resolution specified.The tool will:
If the user defined or default ${resolution} is not found in the list, ask the user to specify the resolution again.
Else, use ${resolution} for the following steps.
Call:
mcp__cooler-tools__harmonize_chrom_nameswith:
sample: the user-provided sample nameproj_dir: directory to save the expected-cis and eigs-cis files. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initmcool_uri: cooler URI with resolution specified, e.g. input.mcool::/resolutions/${resolution}resolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integerThe tool will:
Use bioframe to define chromosome arms based on centromeres:
Call:
mcp__cooler-tools__make_view_chromarmswith:
proj_dir: directory to save the expected-cis and eigs-cis files. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initmcool_uri: cooler URI with resolution specified, e.g. input.mcool::/resolutions/${resolution}resolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integergenome: genome assemblyThe tool will:
bioframe.${proj_dir}/temp/ directory.Call:
mcp__cooler-tools__dump_bins_for_gc
with:sample: the user-provided sample nameproj_dir: directory to save the GC track file. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initmcool_uri: cooler URI with resolution specified, e.g. input.mcool::/resolutions/${resolution}resolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integerThe tool will:
${proj_dir}/temp/ directory.Call:
mcp__cooltools-tools__run_genome_gcwith:
sample: the user-provided sample nameproj_dir: directory to save the GC track file. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initmcool_uri: cooler URI with resolution specified, e.g. input.mcool::/resolutions/${resolution}resolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integergenome: genome assemblyThe tool will:
${proj_dir}/temp/ directory.Call:
mcp__cooltools-tools__run_expected_ciswith:
sample: the user-provided sample nameproj_dir: directory to save the expected-cis and eigs-cis files. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initmcool_uri: cooler URI with resolution specified, e.g. input.mcool::/resolutions/${resolution}resolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integerview_path: the path to the view file (e.g. ${proj_dir}/temp/view_${genome}.tsv)clr_weight_name: the name of the weight column (default: weight)ignore_diags: the number of diagonals to ignore based on resolutionThe tool will:
${proj_dir}/temp/ directory.Call:
mcp__cooltools-tools__run_eigs_ciswith:
sample: the user-provided sample nameproj_dir: directory to save the expected-cis and eigs-cis files. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initmcool_uri: cooler URI with resolution specified, e.g. input.mcool::/resolutions/${resolution}resolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integerview_path: the view TSV from Step 3 (e.g. view_${genome}.tsv)gc_tsv: GC track TSV from Step 4clr_weight_name: balancing column name (default "weight", but can be set based on clr.bins().columns if the user tells you the correct name)n_eigs: the number of principal components to compute (default 1)make_bigwig: whether to make bigwig file for PC1 track (default True)This tool will:
cooltools expected-cis to compute expected contact frequencies.cooltools eigs-cis to perform PCA and extract PC1.${proj_dir}/compartments/ directory.${proj_dir}/compartments/ directory.If the user reports an error about balancing weights:
expected_and_eigs with the correct clr_weight_name.Call:
mcp__cooltools-tools__run_saddlewith:
sample: the user-provided sample nameproj_dir: directory to save the saddle file. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initmcool_uri: cooler URI with resolution specified, e.g. input.mcool::/resolutions/${resolution}resolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integerview_path: the view TSV from Step 3 (e.g. view_${genome}.tsv)eigs_vecs_tsv: the eigs-cis vecs TSV from Step 5 (e.g. compartments/eigs.${resolution}.cis.vecs.tsv)expected_cis_tsv: the expected-cis TSV from Step 5 (e.g. temp/expected_cis.${resolution}.tsv)clr_weight_name: balancing column name (default "weight", but can be set based on clr.bins().columns if the user tells you the correct name)qrange_low and qrange_high: default 0.02 and 0.98The tool will:
cooltools saddle.${proj_dir}/compartments/ directory.${proj_dir}/compartments/ directory.Call:
mcp__plot-hic-tools__plot_saddle_pdfwith:
sample: the user-provided sample nameproj_dir: directory to save the saddle file. In this skill, it is the full path of the ${sample}_Compartments_calling directory returned by mcp__project-init-tools__project_initresolution: ${resolution} must be the same as the resolution used for ${mcool_uri} and must be an integerchr_name: the user-provided chromosome name, e.g. chr1This tool will:
.saddledump.npz file.LogNorm(1e-1, 1e1) and RdBu_r colormap.${proj_dir}/plots/ directory.${proj_dir}/plots/ directory.${proj_dir}/plots/ directory.If the saddledump file is missing, inform the user to run run_saddle first.
resolution values and keep outputs in the same ${proj_dir} directory, using resolution in filenames for disambiguation.