-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:RBVI/ChimeraX into develop
- Loading branch information
Showing
28 changed files
with
1,047 additions
and
43 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
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 @@ | ||
include ../Makefile.bundle |
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,41 @@ | ||
<BundleInfo name="ChimeraX-DeepMutationalScan" version="1.0" | ||
package="chimerax.deep_mutational_scan" | ||
minSessionVersion="1" maxSessionVersion="1"> | ||
|
||
<Author>UCSF RBVI</Author> | ||
<Email>[email protected]</Email> | ||
<URL>https://www.rbvi.ucsf.edu/chimerax/</URL> | ||
|
||
<Synopsis>Visualize deep mutational scanning data</Synopsis> | ||
<Description>Visualize deep mutational scanning data.</Description> | ||
|
||
<Categories> | ||
<Category name="Molecular structure"/> | ||
</Categories> | ||
|
||
<Dependencies> | ||
<Dependency name="ChimeraX-Core" version="~=1.0"/> | ||
<Dependency name="ChimeraX-DataFormats" version="~=1.0"/> | ||
<Dependency name="ChimeraX-UI" version="~=1.0"/> | ||
</Dependencies> | ||
|
||
<Providers manager="data formats"> | ||
<Provider name="Deep mutational scan" synopsis="Deep mutational scan csv file" nicknames="dms" category="Molecular structure" suffixes=".csv" /> | ||
</Providers> | ||
|
||
<Providers manager="open command"> | ||
<Provider name="Deep mutational scan" want_path="true" /> | ||
</Providers> | ||
|
||
<Classifiers> | ||
<PythonClassifier>Development Status :: 2 - Pre-Alpha</PythonClassifier> | ||
<PythonClassifier>License :: Free for non-commercial use</PythonClassifier> | ||
<ChimeraXClassifier>Command :: dms label :: Molecular structure :: Label residues with deep mutational scan values</ChimeraXClassifier> | ||
<ChimeraXClassifier>Command :: dms attribute :: Molecular structure :: Assign a residue attribute computed from deep mutational scan values</ChimeraXClassifier> | ||
<ChimeraXClassifier>Command :: dms scatterplot :: Molecular structure :: Show a scatter plot for two phenotypes from deep mutational scan data</ChimeraXClassifier> | ||
<ChimeraXClassifier>Command :: dms statistics :: Molecular structure :: Report mean and standard deviation of deep mutational scan scores</ChimeraXClassifier> | ||
<ChimeraXClassifier>Command :: dms histogram :: Molecular structure :: Show histogram of deep mutational scan scores</ChimeraXClassifier> | ||
<ChimeraXClassifier>Command :: dms umap :: Molecular structure :: Show umap plot of residue deep mutational scan scores</ChimeraXClassifier> | ||
</Classifiers> | ||
|
||
</BundleInfo> |
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,63 @@ | ||
# vim: set expandtab ts=4 sw=4: | ||
|
||
# === UCSF ChimeraX Copyright === | ||
# Copyright 2022 Regents of the University of California. All rights reserved. | ||
# The ChimeraX application is provided pursuant to the ChimeraX license | ||
# agreement, which covers academic and commercial uses. For more details, see | ||
# <http://www.rbvi.ucsf.edu/chimerax/docs/licensing.html> | ||
# | ||
# This particular file is part of the ChimeraX library. You can also | ||
# redistribute and/or modify it under the terms of the GNU Lesser General | ||
# Public License version 2.1 as published by the Free Software Foundation. | ||
# For more details, see | ||
# <https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html> | ||
# | ||
# THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER | ||
# EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ADDITIONAL LIABILITY | ||
# LIMITATIONS ARE DESCRIBED IN THE GNU LESSER GENERAL PUBLIC LICENSE | ||
# VERSION 2.1 | ||
# | ||
# This notice must be embedded in or attached to all copies, including partial | ||
# copies, of the software or any revisions or derivations thereof. | ||
# === UCSF ChimeraX Copyright === | ||
|
||
from chimerax.core.toolshed import BundleAPI | ||
|
||
class _DeepMutationalScanAPI(BundleAPI): | ||
|
||
@staticmethod | ||
def register_command(command_name, logger): | ||
# 'register_command' is called by the toolshed on start up | ||
from . import dms_label | ||
dms_label.register_command(logger) | ||
from . import dms_attribute | ||
dms_attribute.register_command(logger) | ||
from . import dms_scatter_plot | ||
dms_scatter_plot.register_command(logger) | ||
from . import dms_stats | ||
dms_stats.register_command(logger) | ||
from . import dms_histogram | ||
dms_histogram.register_command(logger) | ||
from . import dms_umap | ||
dms_umap.register_command(logger) | ||
|
||
@staticmethod | ||
def run_provider(session, name, mgr): | ||
if mgr == session.open_command: | ||
if name == 'Deep mutational scan': | ||
from chimerax.open_command import OpenerInfo | ||
class DeepMutationalScanInfo(OpenerInfo): | ||
def open(self, session, path, file_name, **kw): | ||
from .dms_data import open_deep_mutational_scan_csv | ||
dms_data, message = open_deep_mutational_scan_csv(session, path, **kw) | ||
return [], message | ||
|
||
@property | ||
def open_args(self): | ||
from chimerax.atomic import ChainArg | ||
return {'Chain': ChainArg} | ||
|
||
return DeepMutationalScanInfo() | ||
|
||
bundle_api = _DeepMutationalScanAPI() |
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,50 @@ | ||
# Assign a residue attribute from deep mutational scan scores. | ||
def dms_attribute(session, chain, column_name, subtract_fit = None, | ||
name = None, type = 'sum_absolute', above = None, below = None): | ||
from .dms_data import dms_data | ||
data = dms_data(chain) | ||
if data is None: | ||
from chimerax.core.errors import UserError | ||
raise UserError(f'No deep mutation scan data associated with chain {chain}') | ||
scores = data.column_values(column_name, subtract_fit = subtract_fit) | ||
|
||
attr_name = _attribute_name(column_name, type, above, below) if name is None else name | ||
from chimerax.atomic import Residue | ||
Residue.register_attr(session, attr_name, "Deep Mutational Scan", attr_type=float) | ||
|
||
residues = chain.existing_residues | ||
count = 0 | ||
for res in residues: | ||
value = scores.residue_value(res.number, value_type=type, above=above, below=below) | ||
if value is not None: | ||
setattr(res, attr_name, value) | ||
count += 1 | ||
|
||
message = f'Set attribute {attr_name} for {count} residues of chain {chain}' | ||
session.logger.info(message) | ||
|
||
def _attribute_name(column_name, type, above, below): | ||
attr_name = f'{column_name}_{type}' | ||
if above is not None: | ||
attr_name += f'_ge_{"%.3g"%above}' | ||
if below is not None: | ||
attr_name += f'_le_{"%.3g"%below}' | ||
return attr_name | ||
|
||
def register_command(logger): | ||
from chimerax.core.commands import CmdDesc, register, StringArg, EnumOf, FloatArg | ||
from chimerax.atomic import ChainArg | ||
from .dms_data import ColumnValues | ||
desc = CmdDesc( | ||
required = [('chain', ChainArg)], | ||
keyword = [('column_name', StringArg), | ||
('subtract_fit', StringArg), | ||
('name', StringArg), | ||
('type', EnumOf(ColumnValues.residue_value_types)), | ||
('above', FloatArg), | ||
('below', FloatArg), | ||
], | ||
required_arguments = ['column_name'], | ||
synopsis = 'Assign a residue attribute using deep mutation scan scores' | ||
) | ||
register('dms attribute', desc, dms_attribute, logger=logger) |
Oops, something went wrong.