Skip to content
Snippets Groups Projects
Commit 09f0001c authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

add coli example

parent 5a942551
No related branches found
No related tags found
1 merge request!21Copy paste sequence
Pipeline #128203 passed
......@@ -97,6 +97,37 @@ def add(
return analysis
@router.post("add-example", response={200: AnalysisOutSchema, 503: Error})
def add_example(
request,
):
request.session.set_expiry(session_expiry)
if request.session.session_key:
session_key = request.session.session_key
else:
request.session.create()
request.session.set_expiry(session_expiry)
session_key = request.session.session_key
session = Session.objects.get(session_key=session_key)
aw = AnalysisWorkflow.objects.get(galaxy_id=settings.GALAXY_WORKFLOW_ID)
# check if Galaxy online
is_galaxy_online = aw.analysis_owner.galaxy_instance.is_online()
if not is_galaxy_online:
return 503, {"message": "The Galaxy instance is offline"}
print(settings.BASE_DIR)
input_files = [
f"{settings.BASE_DIR}/analysis/data/GCF_000005845.faa",
]
params = {}
analysis = aw.invoke(session, input_files, params, "GCF_000005845.faa")
return analysis
@router.get("/", response={200: list[AnalysisOutSchema], 503: Error})
def list(request):
session_key = request.session.session_key
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -36,6 +36,24 @@ if (data.value !== null && !data.value.is_online) {
throw createError("The galaxy instance is offline")
}
const loading = ref(false)
async function addExample() {
loading.value = true
try {
await $fetch('/dfapi/analysis/add-example', {
method: 'POST',
headers: { "X-CSRFToken": csrfToken.value }
})
await navigateTo("/analyses/")
} catch (error) {
throw createError("Cannot upload the pasted sequence")
} finally {
loading.value = false
}
}
async function submit(event) {
loading.value = true
......@@ -70,6 +88,7 @@ async function submit(event) {
<v-tabs v-model="tab" align-tabs="start">
<v-tab value="local" :rounded="false">Local fasta files</v-tab>
<v-tab value="paste" :rounded="false">Paste fasta sequences</v-tab>
<v-tab value="example" :rounded="false">Example</v-tab>
</v-tabs>
<v-card-text>
......@@ -84,6 +103,22 @@ async function submit(event) {
<v-btn type="submit" :loading="loading">Submit</v-btn>
</v-form>
</v-window-item>
<v-window-item value="example">
<v-card flat color="transparent">
<v-form>
<v-card-text>
You can try an example with Escherichia coli str. K-12 substr. MG1655 proteins downloaded from <a
target="_blank"
href="https://www.ncbi.nlm.nih.gov/datasets/genome/GCF_000005845.2">GCF_000005845.2</a>
</v-card-text>
<v-card-actions>
<v-btn variant="elevated" density="default" size="default" :slim="false" rounded="xl"
color="primary" :loading="loading" @click="addExample()">Submit</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-window-item>
</v-window>
</v-card-text>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment