|
| 1 | +name: consensus_vote |
| 2 | +namespace: annotate |
| 3 | +scope: "public" |
| 4 | +description: | |
| 5 | + Combines cell type predictions from multiple annotation methods into a single consensus prediction using a weighted majority vote. |
| 6 | + For each cell, each method votes for its predicted cell type, optionally weighted by the probability score and/or a per-method weight. |
| 7 | + The consensus prediction is the cell type with the highest total weighted vote. |
| 8 | + Note that this method does not leverage pre-existing ontology or perform any reconciliation of cell type labels across methods, so the same cell type may be represented by different labels in different methods and will be treated as distinct cell types in the vote. |
| 9 | +authors: |
| 10 | + - __merge__: /src/authors/dorien_roosen.yaml |
| 11 | + roles: [ author ] |
| 12 | + |
| 13 | +argument_groups: |
| 14 | + - name: Inputs |
| 15 | + description: Input dataset arguments. |
| 16 | + arguments: |
| 17 | + - name: "--input" |
| 18 | + type: file |
| 19 | + description: Input h5mu file containing cell type predictions in .obs. |
| 20 | + direction: input |
| 21 | + required: true |
| 22 | + example: input.h5mu |
| 23 | + - name: "--modality" |
| 24 | + description: Which modality to process. |
| 25 | + type: string |
| 26 | + default: "rna" |
| 27 | + required: false |
| 28 | + - name: "--input_obs_predictions" |
| 29 | + type: string |
| 30 | + description: | |
| 31 | + One or more .obs column names containing cell type predictions (labels) from |
| 32 | + different annotation methods. |
| 33 | + required: true |
| 34 | + multiple: true |
| 35 | + example: ["scanvi_pred", "celltypist_pred"] |
| 36 | + - name: "--input_obs_probabilities" |
| 37 | + type: string |
| 38 | + description: | |
| 39 | + One or more .obs column names containing prediction probability scores, |
| 40 | + one per method in --input_obs_predictions. When provided, each method's |
| 41 | + vote is scaled by the probability score for that cell (in addition to |
| 42 | + any per-method --weights). Must be the same length as --input_obs_predictions. |
| 43 | + required: false |
| 44 | + multiple: true |
| 45 | + example: ["scanvi_prob", "celltypist_prob", "singler_prob"] |
| 46 | + - name: "--tie_label" |
| 47 | + type: string |
| 48 | + description: | |
| 49 | + Label to assign when two or more cell types receive equal votes. |
| 50 | + If not provided, tied cells are assigned None (missing value). |
| 51 | + required: false |
| 52 | + example: "Unknown" |
| 53 | + - name: "--weights" |
| 54 | + type: double |
| 55 | + description: | |
| 56 | + Per-method weights for the consensus vote. Must be the same length as |
| 57 | + --input_obs_predictions when provided. Weights are normalized to sum to 1 |
| 58 | + before use. If not provided, all methods are weighted equally. |
| 59 | + required: false |
| 60 | + multiple: true |
| 61 | + example: [1.0, 2.0] |
| 62 | + |
| 63 | + - name: Outputs |
| 64 | + description: Output arguments. |
| 65 | + arguments: |
| 66 | + - name: "--output" |
| 67 | + alternatives: [-o] |
| 68 | + type: file |
| 69 | + description: Output h5mu file. |
| 70 | + direction: output |
| 71 | + example: output.h5mu |
| 72 | + - name: "--output_obs_predictions" |
| 73 | + type: string |
| 74 | + default: consensus_pred |
| 75 | + required: false |
| 76 | + description: | |
| 77 | + In which `.obs` slot to store the consensus predicted cell type. |
| 78 | + - name: "--output_obs_score" |
| 79 | + type: string |
| 80 | + default: consensus_score |
| 81 | + required: false |
| 82 | + description: | |
| 83 | + In which `.obs` slot to store the consensus score, defined as the fraction |
| 84 | + of total weight assigned to the winning cell type. |
| 85 | + __merge__: [., /src/base/h5_compression_argument.yaml] |
| 86 | + |
| 87 | +resources: |
| 88 | + - type: python_script |
| 89 | + path: script.py |
| 90 | + - path: /src/utils/setup_logger.py |
| 91 | + - path: /src/utils/compress_h5mu.py |
| 92 | + |
| 93 | +test_resources: |
| 94 | + - type: python_script |
| 95 | + path: test.py |
| 96 | + |
| 97 | +engines: |
| 98 | + - type: docker |
| 99 | + image: python:3.13-slim |
| 100 | + setup: |
| 101 | + - type: apt |
| 102 | + packages: |
| 103 | + - procps |
| 104 | + - type: python |
| 105 | + __merge__: [ /src/base/requirements/anndata_mudata.yaml, .] |
| 106 | + __merge__: [ /src/base/requirements/python_test_setup.yaml, .] |
| 107 | +runners: |
| 108 | + - type: executable |
| 109 | + - type: nextflow |
| 110 | + directives: |
| 111 | + label: [lowcpu, lowmem, lowdisk] |
0 commit comments