Skip to content

Commit f3a47dd

Browse files
committed
feat: chip-seq workflow with fasta input (#137)
1 parent c825c54 commit f3a47dd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

app/utils/galaxy-api.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ export async function getWorkflowLandingUrl(
5454
return `${WORKFLOW_LANDING_URL_PREFIX}${encodeURIComponent(id)}?public=true`;
5555
}
5656

57+
function buildFastaUrl(identifier: string): string {
58+
const baseUrl = "https://hgdownload.soe.ucsc.edu/hubs/";
59+
const parts = identifier.split("_");
60+
const formattedPath = `${parts[0]}/${parts[1].slice(0, 3)}/${parts[1].slice(
61+
3,
62+
6
63+
)}/${parts[1].slice(6, 9)}/${identifier}/${identifier}.fa.gz`;
64+
return `${baseUrl}${formattedPath}`;
65+
}
66+
5767
/**
5868
* Get the appropriate `request_state` object for the given workflow ID and reference genome.
5969
* @param workflowId - Workflow ID.
@@ -69,6 +79,11 @@ function getWorkflowLandingsRequestState(
6979
if (workflowId === WORKFLOW_ID.VARIANT_CALLING && geneModelUrl) {
7080
return {
7181
"Annotation GTF": { ext: "gtf.gz", src: "url", url: geneModelUrl },
82+
"Genome fasta": {
83+
ext: "fasta.gz",
84+
src: "url",
85+
url: buildFastaUrl(referenceGenome),
86+
},
7287
};
7388
}
7489
return { reference_genome: referenceGenome };

0 commit comments

Comments
 (0)