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
40 changes: 19 additions & 21 deletions app/utils/galaxy-api/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,25 @@ export interface WorkflowUrlParameter {
interface WorkflowPairedCollectionParameter {
class: "Collection";
collection_type: "list:paired";
elements: [
{
class: "Collection";
elements: [
{
class: "File";
filetype: string;
identifier: "forward";
location: string;
},
{
class: "File";
filetype: string;
identifier: "reverse";
location: string;
},
];
identifier: string;
type: "paired";
},
];
elements: Array<{
class: "Collection";
elements: [
{
class: "File";
filetype: string;
identifier: "forward";
location: string;
},
{
class: "File";
filetype: string;
identifier: "reverse";
location: string;
},
];
identifier: string;
type: "paired";
}>;
}

export interface WorkflowLanding {
Expand Down
18 changes: 9 additions & 9 deletions app/utils/galaxy-api/galaxy-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function buildFastaUrl(identifier: string): string {
function paramVariableToRequestValue(
variable: WORKFLOW_PARAMETER_VARIABLE,
geneModelUrl: string | null,
readRuns: string | null,
readRuns: string[] | null,
referenceGenome: string
): WorkflowParameterValue | null {
// Because this `switch` has no default case, and the function doesn't allow `undefined` as a return type,
Expand All @@ -85,15 +85,15 @@ function paramVariableToRequestValue(
}
: null;
case WORKFLOW_PARAMETER_VARIABLE.SANGER_READ_RUN: {
if (!readRuns) return null;
// TODO get this info earlier? In particular, it might be better to explicitly get the run accession from ENA rather than getting it from the filenames.
const { forwardUrl, reverseUrl, runAccession } =
getPairedRunUrlsInfo(readRuns);
if (!readRuns?.length) return null;
return {
class: "Collection",
collection_type: "list:paired",
elements: [
{
elements: readRuns.map((readRunsPair) => {
// TODO get this info earlier? In particular, it might be better to explicitly get the run accession from ENA rather than getting it from the filenames.
const { forwardUrl, reverseUrl, runAccession } =
getPairedRunUrlsInfo(readRunsPair);
return {
class: "Collection",
elements: [
{
Expand All @@ -111,8 +111,8 @@ function paramVariableToRequestValue(
],
identifier: runAccession,
type: "paired",
},
],
};
}),
};
}
}
Expand Down
Loading