forked from Rappsilber-Laboratory/xiview-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91596c0
commit 3453dd8
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from xi_web_api.models.proteindetails import ProteinDetails | ||
|
||
|
||
class DetailedView: | ||
|
||
def __init__(self, accession, title, description, pubmed_id, protein_details): | ||
self.accession = accession | ||
self.title = title | ||
self.description = description | ||
self.pubmed_id = pubmed_id | ||
self.protein_details = protein_details | ||
|
||
def add_protein_details(self, protein_details): | ||
if isinstance(protein_details, ProteinDetails): | ||
self.protein_details.append(protein_details) | ||
else: | ||
print("Invalid protein_details object. Please provide a protein_details instance.") | ||
|
||
def remove_protein_details(self, protein_details): | ||
if protein_details in self.protein_details: | ||
self.protein_details.remove(protein_details) | ||
else: | ||
print("Protein details not found in the Detailed View.") | ||
|
||
# def to_dict(self): | ||
# return { | ||
# 'accession': self.accession, | ||
# 'title': self.title, | ||
# 'description': self.description, | ||
# 'pubmed_id': self.pubmed_id, | ||
# 'protein_details': self.protein_details | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class ProteinDetails: | ||
|
||
def __init__(self, proteins, peptides, spectra, cross_linking, pdb): | ||
self.proteins = proteins | ||
self.peptides = peptides | ||
self.spectra = spectra | ||
self.cross_linking = cross_linking | ||
self.pdb = pdb | ||
|
||
# def to_dict(self): | ||
# return { | ||
# 'proteins': self.self.proteins, | ||
# 'peptides': self.self.peptides, | ||
# 'spectra': self.self.spectra, | ||
# 'cross_linking': self.self.cross_linking, | ||
# 'pdb': self.self.pdb | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Summary: | ||
|
||
def __init__(self): | ||
self.accession = "" | ||
self.title = "" | ||
self.pubmed_id = "" | ||
self.proteins = 0 | ||
self.peptides = 0 | ||
self.spectra = 0 | ||
self.aggregated_view = "" |