Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
iPPIDB
ippidb-web
Commits
28daf769
Commit
28daf769
authored
7 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
add code to retrieve proteins information from PDB
Former-commit-id: 9a7b9355ed06b75a23904ec12e070237b5f477f1
parent
53ea44f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ippisite/ippidb/views.py
+16
-0
16 additions, 0 deletions
ippisite/ippidb/views.py
with
16 additions
and
0 deletions
ippisite/ippidb/views.py
+
16
−
0
View file @
28daf769
...
...
@@ -2,7 +2,10 @@ import ippidb
from
django.shortcuts
import
render
from
django.http
import
HttpResponseRedirect
from
formtools.wizard.views
import
SessionWizardView
,
NamedUrlSessionWizardView
from
.forms
import
IdForm
,
BibliographyForm
,
PDBForm
,
ProteinForm
,
ProteinDomainComplexTypeForm
,
ProteinDomainComplexForm
,
PpiForm
from
.models
import
Protein
from
.ws
import
get_pdb_uniprot_mapping
def
index
(
request
):
return
render
(
request
,
'
index.html
'
)
...
...
@@ -48,6 +51,19 @@ class IppiWizard(SessionWizardView):
if
self
.
steps
.
current
==
'
IdForm
'
:
form
.
instance
.
autofill
()
self
.
instance_dict
[
'
BibliographyForm
'
]
=
form
.
instance
elif
self
.
steps
.
current
==
'
PDBForm
'
:
uniprot_ids
=
get_pdb_uniprot_mapping
(
form
.
cleaned_data
[
'
pdb_id
'
])
proteins
=
[]
for
uniprot_id
in
uniprot_ids
:
try
:
p
=
Protein
.
objects
.
get
(
uniprot_id
=
uniprot_id
)
except
Protein
.
DoesNotExist
:
p
=
Protein
()
p
.
uniprot_id
=
uniprot_ids
[
0
]
p
.
autofill
()
proteins
.
append
(
p
)
#TODO replace p with proteins as the instance_dict
self
.
instance_dict
[
'
ProteinForm
'
]
=
p
return
self
.
get_form_step_data
(
form
)
def
done
(
self
,
form_list
,
**
kwargs
):
...
...
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