Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Website
Commits
09f0001c
Commit
09f0001c
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
add coli example
parent
5a942551
No related branches found
No related tags found
1 merge request
!21
Copy paste sequence
Pipeline
#128203
passed
1 year ago
Stage: delete-release
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/analysis/api.py
+31
-0
31 additions, 0 deletions
backend/analysis/api.py
backend/analysis/data/GCF_000005845.faa
+23032
-0
23032 additions, 0 deletions
backend/analysis/data/GCF_000005845.faa
frontend/components/SubmitAnalysis.vue
+35
-0
35 additions, 0 deletions
frontend/components/SubmitAnalysis.vue
with
23098 additions
and
0 deletions
backend/analysis/api.py
+
31
−
0
View file @
09f0001c
...
@@ -97,6 +97,37 @@ def add(
...
@@ -97,6 +97,37 @@ def add(
return
analysis
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
})
@router.get
(
"
/
"
,
response
=
{
200
:
list
[
AnalysisOutSchema
],
503
:
Error
})
def
list
(
request
):
def
list
(
request
):
session_key
=
request
.
session
.
session_key
session_key
=
request
.
session
.
session_key
...
...
This diff is collapsed.
Click to expand it.
backend/analysis/data/GCF_000005845.faa
0 → 100644
+
23032
−
0
View file @
09f0001c
This diff is collapsed.
Click to expand it.
frontend/components/SubmitAnalysis.vue
+
35
−
0
View file @
09f0001c
...
@@ -36,6 +36,24 @@ if (data.value !== null && !data.value.is_online) {
...
@@ -36,6 +36,24 @@ if (data.value !== null && !data.value.is_online) {
throw
createError
(
"
The galaxy instance is offline
"
)
throw
createError
(
"
The galaxy instance is offline
"
)
}
}
const
loading
=
ref
(
false
)
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
)
{
async
function
submit
(
event
)
{
loading
.
value
=
true
loading
.
value
=
true
...
@@ -70,6 +88,7 @@ async function submit(event) {
...
@@ -70,6 +88,7 @@ async function submit(event) {
<v-tabs
v-model=
"tab"
align-tabs=
"start"
>
<v-tabs
v-model=
"tab"
align-tabs=
"start"
>
<v-tab
value=
"local"
:rounded=
"false"
>
Local fasta files
</v-tab>
<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=
"paste"
:rounded=
"false"
>
Paste fasta sequences
</v-tab>
<v-tab
value=
"example"
:rounded=
"false"
>
Example
</v-tab>
</v-tabs>
</v-tabs>
<v-card-text>
<v-card-text>
...
@@ -84,6 +103,22 @@ async function submit(event) {
...
@@ -84,6 +103,22 @@ async function submit(event) {
<v-btn
type=
"submit"
:loading=
"loading"
>
Submit
</v-btn>
<v-btn
type=
"submit"
:loading=
"loading"
>
Submit
</v-btn>
</v-form>
</v-form>
</v-window-item>
</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-window>
</v-card-text>
</v-card-text>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment