Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
f38fdedf
Commit
f38fdedf
authored
Feb 07, 2020
by
Kenzo-Hugo Hillion
♻
Browse files
add sequence to gene detail view
parent
330b8882
Pipeline
#23892
passed with stages
in 2 minutes and 44 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/apps/catalog/serializers/gene.py
View file @
f38fdedf
...
...
@@ -69,7 +69,7 @@ class GeneSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
Gene
list_serializer_class
=
GeneListSerializer
fields
=
(
'gene_id'
,
'name'
,
'length'
,
'functions'
,
'taxonomy'
)
fields
=
(
'gene_id'
,
'name'
,
'length'
,
'functions'
,
'taxonomy'
,
'sequence'
)
def
_extract_many_to_many
(
self
,
validated_data
,
info
):
many_to_many
=
{}
...
...
frontend/src/main.js
View file @
f38fdedf
...
...
@@ -16,7 +16,7 @@ Vue.use(Vuetify, {
primary
:
'
#263238
'
,
secondary
:
'
#508991
'
,
tertiary
:
'
#104f55
'
,
dropdown
:
'
#
f3e9dc
'
,
dropdown
:
'
#
d8e2e3
'
,
// Category colors
function
:
'
#db5461
'
,
kegg
:
'
#db9d47
'
,
...
...
frontend/src/views/GeneDetail.vue
View file @
f38fdedf
...
...
@@ -4,10 +4,6 @@
<v-toolbar
class=
"secondary darken-1 white--text"
dense
>
<v-icon
class=
"white--text"
>
fa-clipboard
</v-icon>
<v-toolbar-title>
Gene details:
{{
gene_id
}}
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn
dark
icon
>
<v-icon>
search
</v-icon>
</v-btn>
</v-toolbar>
<v-card>
...
...
@@ -38,6 +34,26 @@
</v-list-tile-content>
</v-list-tile>
</
template
>
<v-expansion-panel>
<v-expansion-panel-content>
<
template
v-slot:header
><div>
FASTA sequence
</div></
template
>
<div>
<v-textarea
readonly
background-color=
"dropdown"
hide-details
:value=
"sequence"
id=
"fastaseq"
></v-textarea>
<v-layout
wrap
align-center
>
<v-spacer></v-spacer>
<v-btn
@
click=
"copyFasta"
class=
"ma-2 secondary lighten-1"
>
Copy FASTA
<v-icon
right
dark
>
far fa-copy
</v-icon>
</v-btn>
</v-layout>
</div>
</v-expansion-panel-content>
</v-expansion-panel>
</v-list>
</v-card>
</v-flex>
...
...
@@ -63,6 +79,7 @@ export default {
return
{
gene_id
:
''
,
gene_detail
:
[],
sequence
:
''
,
kegg_id
:
''
,
taxonomy_id
:
''
,
};
...
...
@@ -93,6 +110,7 @@ export default {
content
:
response
.
data
.
length
,
},
];
this
.
sequence
=
'
>
'
+
response
.
data
.
gene_id
+
'
\n
'
+
response
.
data
.
sequence
;
if
(
response
.
data
.
functions
.
length
>
0
)
{
this
.
kegg_id
=
response
.
data
.
functions
[
0
].
function_id
;
}
else
{
...
...
@@ -108,6 +126,12 @@ export default {
console
.
log
(
error
);
});
},
copyFasta
(){
var
copyText
=
document
.
getElementById
(
"
fastaseq
"
);
copyText
.
select
();
document
.
execCommand
(
"
copy
"
);
}
},
};
</
script
>
<
style
src=
"./genedetails.scss"
lang=
"scss"
scoped
></
style
>
frontend/src/views/genedetails.scss
0 → 100644
View file @
f38fdedf
.v-textarea
{
font-size
:
0
.9em
;
}
.v-text-field
{
padding-top
:
0px
;
margin-top
:
0px
;
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment