-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with user-uploaded mutations (#147)
* Fix issues with user-uploaded mutations; backport of 0c77dd6 By better separation of ORM and the user uploaded content, the two mechanisms should no longer interfere and cause problems. * Fix get_relationship method * Ignore user uploaded mutations in statistics * Fix to previous commit * Filter out user mutations in source fields * Final portion of backporting - search view * Amend chromosome.py * Try to use newer nodejs for travis to pass * Do not attempt to install npm * Improve sequence view * Improve filters
- Loading branch information
1 parent
a69ca0d
commit 6cebf94
Showing
12 changed files
with
127 additions
and
80 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
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
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
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
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,46 @@ | ||
from models import Protein, Mutation | ||
|
||
|
||
class SearchResult: | ||
|
||
def __init__(self, protein, mutation, is_mutation_novel, type, **kwargs): | ||
self.protein = protein | ||
self.mutation = mutation | ||
self.is_mutation_novel = is_mutation_novel | ||
self.type = type | ||
self.meta_user = None | ||
self.__dict__.update(kwargs) | ||
|
||
def __getstate__(self): | ||
state = self.__dict__.copy() | ||
|
||
state['protein_refseq'] = self.protein.refseq | ||
del state['protein'] | ||
|
||
state['mutation_kwargs'] = { | ||
'position': self.mutation.position, | ||
'alt': self.mutation.alt | ||
} | ||
del state['mutation'] | ||
|
||
state['meta_user'].mutation = None | ||
|
||
return state | ||
|
||
def __setstate__(self, state): | ||
|
||
state['protein'] = Protein.query.filter_by( | ||
refseq=state['protein_refseq'] | ||
).one() | ||
del state['protein_refseq'] | ||
|
||
state['mutation'] = Mutation.query.filter_by( | ||
protein=state['protein'], | ||
**state['mutation_kwargs'] | ||
).one() | ||
del state['mutation_kwargs'] | ||
|
||
state['meta_user'].mutation = state['mutation'] | ||
state['mutation'].meta_user = state['meta_user'] | ||
|
||
self.__dict__.update(state) |
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
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
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
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
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
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
Oops, something went wrong.