name: "process_singlesample"
namespace: "workflows/multiomics"
scope: "public"
description: "A pipeline to analyse a single multiomics sample."
info:
  test_dependencies:
    - name: workflow_test
      namespace: test_workflows/multiomics/process_singlesample
    - name: workflow2_test
      namespace: test_workflows/multiomics/process_singlesample
    - name: workflow3_test
      namespace: test_workflows/multiomics/process_singlesample
    - name: workflow4_test
      namespace: test_workflows/multiomics/process_singlesample
    - name: workflow5_test
      namespace: test_workflows/multiomics/process_singlesample
authors:
  - __merge__: /src/authors/dorien_roosen.yaml
    roles: [ author ]
__merge__: process_singlesample.yaml

argument_groups:
  - name: "Cross-modality filtering"
    arguments:
      - name: "--intersect_obs"
        type: boolean_true
        description: |
          After per-modality filtering, remove observations that are not present
          in all processed modalities so that each modality shares the same set of cells.

  - name: "QC metrics calculation options"
    description: |
      Options for calculating basic quality control metrics on the processed
      RNA and protein modalities. These metrics are added to the .obs and .var
      of the output. Mitochondrial and ribosomal genes used for the metrics are
      detected during single-sample processing (see the options above).
    arguments:
      - name: "--skip_qc_metrics"
        type: boolean_true
        description: |
          Skip the calculation of QC metrics. By default, QC metrics are
          calculated for the RNA and protein modalities.
      - name: "--var_qc_metrics"
        description: |
          Keys to select a boolean (containing only True or False) column from .var.
          For each cell, calculate the proportion of total values for genes which are labeled 'True',
          compared to the total sum of the values for all genes. Defaults to the columns specified by
          --var_name_mitochondrial_genes and --var_name_ribosomal_genes (RNA modality only).
        type: string
        multiple: True
        multiple_sep: ','
        required: false
        example: "ercc,highly_variable"
      - name: "--top_n_vars"
        type: integer
        description: |
          Number of top vars to be used to calculate cumulative proportions.
          If not specified, proportions are not calculated. `--top_n_vars 20,50` finds
          cumulative proportion to the 20th and 50th most expressed vars.
        multiple: true
        multiple_sep: ','
        required: false
        default: [50, 100, 200, 500]
      - name: "--log1p_transform"
        description: |
          Compute log1p-transformed versions of the calculated QC metrics. For each emitted
          metric column `<col>`, an additional column `log1p_<col>` is added containing
          `log1p(<col>)`. Mirrors scanpy's `log1p` flag.
        type: boolean
        default: true
        required: false
      - name: "--output_obs_num_nonzero_vars"
        description: |
          Name of column in .obs describing, for each observation, the number of stored values
          (including explicit zeroes). In other words, the name of the column that counts
          for each row the number of columns that contain data.
        type: string
        required: false
        default: "num_nonzero_vars"
      - name: "--output_obs_total_counts_vars"
        description: |
          Name of the column for .obs describing, for each observation (row),
          the sum of the stored values in the columns.
        type: string
        required: false
        default: total_counts
      - name: "--output_var_num_nonzero_obs"
        description: |
          Name of column describing, for each feature, the number of stored values
          (including explicit zeroes). In other words, the name of the column that counts
          for each column the number of rows that contain data.
        type: string
        required: false
        default: "num_nonzero_obs"
      - name: "--output_var_total_counts_obs"
        description: |
          Name of the column in .var describing, for each feature (column),
          the sum of the stored values in the rows.
        type: string
        required: false
        default: total_counts
      - name: "--output_var_obs_mean"
        type: string
        description: |
          Name of the column in .obs providing the mean of the values in each row.
        default: "obs_mean"
        required: false
      - name: "--output_var_pct_dropout"
        type: string
        default: "pct_dropout"
        description: |
          Name of the column in .obs providing for each feature the percentage of
          observations the feature does not appear on (i.e. is missing). Same as `--output_var_num_nonzero_obs`
          but percentage based.

dependencies:
  - name: dataflow/merge
  - name: filter/intersect_obs
  - name: workflows/multiomics/process_singlesample_base
  - name: qc/calculate_qc_metrics

resources:
  - type: nextflow_script
    path: main.nf
    entrypoint: run_wf
  - type: file
    path: /src/workflows/utils/

test_resources:
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf2
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf3
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf4
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf5
  - path: /resources_test/concat_test_data
  - path: /resources_test/pbmc_1k_protein_v3
runners:
  - type: nextflow
