circular-composition
Compose and export general pyCirclize circular layouts with Circos sectors, global primitives, links, custom polar axes, and Matplotlib figure lifecycle.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- circular-composition
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Compose and export general pyCirclize circular layouts with Circos sectors, global primitives, links, custom polar axes, and Matplotlib figure lifecycle.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md9.2 KB
- 参考文档references/troubleshooting.md6.1 KB
- 参考文档references/workflows.md6.0 KB
- 脚本scripts/circos_smoke.py4.0 KB
03 SKILL.md 正文
Circular composition
Use this route when the task is to build a general Circos layout from sector
sizes or coordinate ranges, add composition-level annotations or links, and
render/export a Matplotlib figure. This route is for pyCirclize 1.10.1 on
Python >=3.10 with the base dependencies (biopython, matplotlib,
numpy, pandas). Tooltip interaction is optional (pycirclize[tooltip],
ipympl) and is not required for static output.
Route first
- Use
plot-primitivesforSector.add_trackand every track-local drawing/data method. - Use
data-parsersfor matrix/table input,Circos.chord_diagram, andCircos.radar_chart. - Use
genomics-and-treesfor BED/GenBank/GFF initialization, cytobands, biological features, and phylogenetic trees. - Use the pyCirclize root route for installation, shared provenance, environment checks, and cross-workflow decisions.
Operating procedure
- Normalize each sector as
name -> sizeorname -> (start, end)and choose the global degree interval, inter-sector spaces, optional final space, and per-sector direction before adding any coordinates. - Construct
Circos, inspectcircos.deg_lim,circos.sectors, and each sector'sstart,end,size,deg_lim, andclockwise; useget_sector()rather than indexing by an assumed order. - Add composition-level
axis,text,line,rect,link,link_line, orcolorbarcalls. Keep x/degree coordinates in the declared sector ranges; track data belongs to the plot-primitives route. - Render with
plotfig()when a caller needs the returned Figure, a custommatplotlib.projections.polar.PolarAxes, a legend, subplots, or other post-render Matplotlib edits. Add legends throughcircos.axonly afterplotfig()returns, then save the returned Figure. - Use
savefig()for a self-contained static export when no post-render legend/subplot/annotation must be retained. Verify the output exists and has the requested format.
Contracts and checks
start/endmust satisfy-360 <= start < end <= 360, with span at most 360 degrees. A sequencespacehas one value per sector whenendspace=True, or one fewer whenendspace=False; total spaces cannot consume the plot.- Tuple sector ranges require
start < end; their widths determine angular allocation, while coordinates remain in each tuple's own range. sector2clockwisechanges coordinate conversion for named sectors; it does not change the order of sectors. Validate directed links in both directions when mixing clockwise and anti-clockwise sectors.circos.axis unavailable untilplotfig()has initialized or accepted a polar axis.plotfig(ax=...)rejects a non-polar Matplotlib axis.- Run the bundled deterministic composition smoke
with an explicit output path. It exercises invalid configuration recovery,
nonuniform spaces, tuple ranges, directed links, global primitives, the
savefig()lifecycle, customPolarAxes, legend insertion, and PNG export.
For signatures, coordinate conventions, lifecycle details, and recovery, use:
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).