Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/apis/catalog/brc-analytics-catalog/common/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import {
WORKFLOW_PLOIDY,
} from "./schema-entities";

export interface WorkflowUrlParameter {
ext: string;
src: string;
url: string;
}

export type BRCCatalog = BRCDataCatalogGenome;

export interface BRCDataCatalogGenome {
Expand Down Expand Up @@ -87,5 +93,6 @@ export interface Workflow {

export interface WorkflowParameter {
key: string;
variable: WORKFLOW_PARAMETER_VARIABLE;
url_spec?: WorkflowUrlParameter;
variable?: WORKFLOW_PARAMETER_VARIABLE;
}
29 changes: 18 additions & 11 deletions app/utils/galaxy-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { WORKFLOW_PARAMETER_VARIABLE } from "../apis/catalog/brc-analytics-catalog/common/schema-entities";
import { WorkflowParameter } from "../apis/catalog/brc-analytics-catalog/common/entities";
import {
WorkflowParameter,
WorkflowUrlParameter,
} from "../apis/catalog/brc-analytics-catalog/common/entities";
import ky from "ky";
import { GALAXY_ENVIRONMENT } from "site-config/common/galaxy";

Expand All @@ -11,7 +14,7 @@ interface WorkflowLandingsBody {
}

type WorkflowLandingsBodyRequestState = {
[key: string]: { [key: string]: string } | string;
[key: string]: string | WorkflowUrlParameter;
};

interface WorkflowLanding {
Expand Down Expand Up @@ -106,15 +109,19 @@ function getWorkflowLandingsRequestState(
parameters: WorkflowParameter[]
): WorkflowLandingsBodyRequestState {
const result: WorkflowLandingsBodyRequestState = {};
parameters.forEach(({ key, variable }) => {
const maybeParam = paramVariableToRequestValue(
variable,
geneModelUrl,
referenceGenome
);
if (maybeParam !== undefined) {
result[key] = maybeParam;
for (const { key, url_spec, variable } of parameters) {
if (url_spec) {
// If url_spec is provided, use it directly
result[key] = url_spec;
} else if (variable) {
// Otherwise, use the variable to determine the value
const value = paramVariableToRequestValue(
variable,
geneModelUrl,
referenceGenome
);
if (value !== undefined) result[key] = value;
}
});
}
return result;
}
14 changes: 14 additions & 0 deletions catalog/build/py/generated_schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class WorkflowCategoryId(str, Enum):
ASSEMBLY = "ASSEMBLY"
GENOME_COMPARISONS = "GENOME_COMPARISONS"
PROTEIN_FOLDING = "PROTEIN_FOLDING"
CONSENSUS_SEQUENCES = "CONSENSUS_SEQUENCES"
OTHER = "OTHER"


Expand Down Expand Up @@ -211,9 +212,21 @@ class WorkflowParameter(ConfiguredBaseModel):

key: str = Field(default=..., description="""The key in which the parameter will be set.""", json_schema_extra = { "linkml_meta": {'alias': 'key', 'domain_of': ['WorkflowParameter']} })
variable: Optional[WorkflowParameterVariable] = Field(default=None, description="""A variable to substitute in as the value of the parameter.""", json_schema_extra = { "linkml_meta": {'alias': 'variable', 'domain_of': ['WorkflowParameter']} })
url_spec: Optional[WorkflowUrlSpec] = Field(default=None, description="""A direct URL specification for the parameter.""", json_schema_extra = { "linkml_meta": {'alias': 'url_spec', 'domain_of': ['WorkflowParameter']} })
type_guide: Optional[Any] = Field(default=None, description="""Arbitrary data describing the type of the parameter, intended only as convenient reference for maintainers.""", json_schema_extra = { "linkml_meta": {'alias': 'type_guide', 'domain_of': ['WorkflowParameter']} })


class WorkflowUrlSpec(ConfiguredBaseModel):
"""
A URL specification for a workflow parameter.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'https://github.com/galaxyproject/brc-analytics/blob/main/catalog/schema/workflows.yaml#'})

ext: str = Field(default=..., description="""The file extension of the URL.""", json_schema_extra = { "linkml_meta": {'alias': 'ext', 'domain_of': ['WorkflowUrlSpec']} })
src: str = Field(default=..., description="""The source type, typically 'url'.""", json_schema_extra = { "linkml_meta": {'alias': 'src', 'domain_of': ['WorkflowUrlSpec']} })
url: str = Field(default=..., description="""The URL to the resource.""", json_schema_extra = { "linkml_meta": {'alias': 'url', 'domain_of': ['WorkflowUrlSpec']} })


# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Assemblies.model_rebuild()
Expand All @@ -225,4 +238,5 @@ class WorkflowParameter(ConfiguredBaseModel):
Workflows.model_rebuild()
Workflow.model_rebuild()
WorkflowParameter.model_rebuild()
WorkflowUrlSpec.model_rebuild()

1 change: 1 addition & 0 deletions catalog/build/py/iwc_manifest_to_workflows_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"Transcriptomics": WorkflowCategoryId.TRANSCRIPTOMICS,
"Epigenetics": WorkflowCategoryId.REGULATION,
"Genome assembly": WorkflowCategoryId.ASSEMBLY,
"Virology": WorkflowCategoryId.CONSENSUS_SEQUENCES
}
MANIFEST_SOURCE_OF_TRUTH = ("trs_id", "workflow_name", "categories", "workflow_description")

Expand Down
4 changes: 3 additions & 1 deletion catalog/build/ts/build-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ function buildWorkflow(
}: SourceWorkflow
): void {
const parameters = [];
for (const { key, variable } of sourceParameters) {
for (const { key, url_spec, variable } of sourceParameters) {
// Add parameter if either variable or url_spec is defined
if (variable) parameters.push({ key, variable });
else if (url_spec) parameters.push({ key, url_spec });
}
const workflow: Workflow = {
parameters,
Expand Down
75 changes: 75 additions & 0 deletions catalog/output/workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,61 @@
"trsId": "#workflow/github.com/iwc-workflows/haploid-variant-calling-wgs-pe/main/versions/v0.1",
"workflowDescription": "Workflow for variant analysis against a reference genome in GenBank format",
"workflowName": "Paired end variant calling in haploid system"
},
{
"parameters": [
{
"key": "NC_045512.2 FASTA sequence of SARS-CoV-2",
"variable": "ASSEMBLY_FASTA_URL"
},
{
"key": "ARTIC primer BED",
"url_spec": {
"ext": "bed",
"src": "url",
"url": "https://zenodo.org/record/4555735/files/ARTIC_nCoV-2019_v3.bed"
}
},
{
"key": "ARTIC primers to amplicon assignments",
"url_spec": {
"ext": "tabular",
"src": "url",
"url": "https://zenodo.org/record/4555735/files/ARTIC_amplicon_info_v3.tsv"
}
}
],
"ploidy": "HAPLOID",
"taxonomyId": "694009",
"trsId": "#workflow/github.com/iwc-workflows/sars-cov-2-pe-illumina-artic-variant-calling/COVID-19-PE-ARTIC-ILLUMINA/versions/v0.5.4",
"workflowDescription": "The workflow for Illumina-sequenced ARTIC data builds on the RNASeq workflow for paired-end data using the same steps for mapping and variant calling, but adds extra logic for trimming ARTIC primer sequences off reads with the ivar package. In addition, this workflow uses ivar also to identify amplicons affected by ARTIC primer-binding site mutations and tries to exclude reads derived from such tainted amplicons when calculating allele-frequencies of other variants.",
"workflowName": "COVID-19: variation analysis on ARTIC PE data"
},
{
"parameters": [
{
"key": "NC_045512.2 FASTA sequence of SARS-CoV-2",
"variable": "ASSEMBLY_FASTA_URL"
}
],
"ploidy": "HAPLOID",
"taxonomyId": "694009",
"trsId": "#workflow/github.com/iwc-workflows/sars-cov-2-pe-illumina-wgs-variant-calling/COVID-19-PE-WGS-ILLUMINA/versions/v0.2.4",
"workflowDescription": "This workflows performs paired end read mapping with bwa-mem followed by sensitive variant calling across a wide range of AFs with lofreq",
"workflowName": "COVID-19: variation analysis on WGS PE data"
},
{
"parameters": [
{
"key": "NC_045512.2 FASTA sequence of SARS-CoV-2",
"variable": "ASSEMBLY_FASTA_URL"
}
],
"ploidy": "HAPLOID",
"taxonomyId": "694009",
"trsId": "#workflow/github.com/iwc-workflows/sars-cov-2-se-illumina-wgs-variant-calling/COVID-19-SE-WGS-ILLUMINA/versions/v0.1.6",
"workflowDescription": "This workflows performs single end read mapping with bowtie2 followed by sensitive variant calling across a wide range of AFs with lofreq",
"workflowName": "COVID-19: variation analysis on WGS SE data"
}
]
},
Expand Down Expand Up @@ -165,6 +220,26 @@
}
]
},
{
"category": "CONSENSUS_SEQUENCES",
"description": "Build consensus sequences for related isolates.",
"name": "Consensus sequences",
"workflows": [
{
"parameters": [
{
"key": "Reference FASTA",
"variable": "ASSEMBLY_FASTA_URL"
}
],
"ploidy": "HAPLOID",
"taxonomyId": "10244",
"trsId": "#workflow/github.com/iwc-workflows/pox-virus-amplicon/main/versions/v0.3",
"workflowDescription": "A workflow for the analysis of pox virus genomes sequenced as half-genomes (for ITR resolution) in a tiled-amplicon approach",
"workflowName": "Pox Virus Illumina Amplicon Workflow from half-genomes"
}
]
},
{
"category": "ASSEMBLY",
"description": "Assemble prokaryotic and eukaryotic genomes sequenced with a variety of technologies.",
Expand Down
1 change: 1 addition & 0 deletions catalog/schema/enums/workflow_category_id.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ enums:
ASSEMBLY:
GENOME_COMPARISONS:
PROTEIN_FOLDING:
CONSENSUS_SEQUENCES:
OTHER:
16 changes: 16 additions & 0 deletions catalog/schema/generated/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum WorkflowCategoryId {
ASSEMBLY = "ASSEMBLY",
GENOME_COMPARISONS = "GENOME_COMPARISONS",
PROTEIN_FOLDING = "PROTEIN_FOLDING",
CONSENSUS_SEQUENCES = "CONSENSUS_SEQUENCES",
OTHER = "OTHER",
};
/**
Expand Down Expand Up @@ -148,9 +149,24 @@ export interface WorkflowParameter {
key: string,
/** A variable to substitute in as the value of the parameter. */
variable?: WorkflowParameterVariable | null,
/** A direct URL specification for the parameter. */
url_spec?: WorkflowUrlSpec | null,
/** Arbitrary data describing the type of the parameter, intended only as convenient reference for maintainers. */
type_guide?: Any | null,
}


/**
* A URL specification for a workflow parameter.
*/
export interface WorkflowUrlSpec {
/** The file extension of the URL. */
ext: string,
/** The source type, typically 'url'. */
src: string,
/** The URL to the resource. */
url: string,
}



1 change: 1 addition & 0 deletions catalog/schema/generated/workflow_categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"ASSEMBLY",
"GENOME_COMPARISONS",
"PROTEIN_FOLDING",
"CONSENSUS_SEQUENCES",
"OTHER"
],
"title": "WorkflowCategoryId",
Expand Down
37 changes: 37 additions & 0 deletions catalog/schema/generated/workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"ASSEMBLY",
"GENOME_COMPARISONS",
"PROTEIN_FOLDING",
"CONSENSUS_SEQUENCES",
"OTHER"
],
"title": "WorkflowCategoryId",
Expand All @@ -103,6 +104,17 @@
],
"description": "Arbitrary data describing the type of the parameter, intended only as convenient reference for maintainers."
},
"url_spec": {
"anyOf": [
{
"$ref": "#/$defs/WorkflowUrlSpec"
},
{
"type": "null"
}
],
"description": "A direct URL specification for the parameter."
},
"variable": {
"$ref": "#/$defs/WorkflowParameterVariable",
"description": "A variable to substitute in as the value of the parameter."
Expand Down Expand Up @@ -135,6 +147,31 @@
"title": "WorkflowPloidy",
"type": "string"
},
"WorkflowUrlSpec": {
"additionalProperties": false,
"description": "A URL specification for a workflow parameter.",
"properties": {
"ext": {
"description": "The file extension of the URL.",
"type": "string"
},
"src": {
"description": "The source type, typically 'url'.",
"type": "string"
},
"url": {
"description": "The URL to the resource.",
"type": "string"
}
},
"required": [
"ext",
"src",
"url"
],
"title": "WorkflowUrlSpec",
"type": "object"
},
"Workflows": {
"additionalProperties": false,
"description": "Object containing list of workflows.",
Expand Down
20 changes: 20 additions & 0 deletions catalog/schema/workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,27 @@ classes:
description: A variable to substitute in as the value of the parameter.
required: false
range: WorkflowParameterVariable
url_spec:
description: A direct URL specification for the parameter.
required: false
range: WorkflowUrlSpec
type_guide:
description: Arbitrary data describing the type of the parameter, intended only as convenient reference for maintainers.
required: false
range: Any

WorkflowUrlSpec:
description: A URL specification for a workflow parameter.
attributes:
ext:
description: The file extension of the URL.
required: true
range: string
src:
description: The source type, typically 'url'.
required: true
range: string
url:
description: The URL to the resource.
required: true
range: string
4 changes: 4 additions & 0 deletions catalog/source/workflow_categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ workflow_categories:
name: "Regulation"
description: "Workflows for the analysis of ChIP-seq, ATAC-Seq, and beyond."

- category: "CONSENSUS_SEQUENCES"
name: "Consensus sequences"
description: "Build consensus sequences for related isolates."

- category: "ASSEMBLY"
name: "Assembly"
description: "Assemble prokaryotic and eukaryotic genomes sequenced with a variety of technologies."
Expand Down
Loading