Permalink
Browse files

show protein extinction; improve protein parameter view

  • Loading branch information...
graik committed Aug 13, 2016
1 parent a26b5ae commit 2f674074600bbc9cde6447bf67db84004a3b8098
@@ -457,7 +457,7 @@ def mass( self ):
if not self.sequence:
return 0.0
try:
return PP.ProteinAnalysis(self.sequence).molecular_weight()
return round(PP.ProteinAnalysis(self.sequence).molecular_weight(),2)
except:
return 0.0
@@ -470,7 +470,37 @@ def isoelectric( self ):
return round(r, 2)
except:
return 0.0
def maxSS( self ):
"""
@return int, number of maximally possible S-S bonds (n_cys/2)
"""
if not self.sequence:
return 0
return divmod( self.sequence.upper().count('C'), 2 )[0] ## full pairs only
def e280reduced( self ):
"""
E(Prot) = Numb(Tyr)*Ext(Tyr) + Numb(Trp)*Ext(Trp) + Numb(Cystine)*Ext(Cystine)
where (for proteins in water measured at 280 nm): Ext(Tyr) = 1490, Ext(Trp) = 5500, Ext(Cystine) = 125;
@return float, extinction coefficient at 280 nm assuming no S-S bonds [/M/cm]
"""
if not self.sequence:
return 0
eY = 1490
eW = 5500
nY = self.sequence.upper().count('Y')
nW = self.sequence.upper().count('W')
return eY*nY + eW*nW
def e280ss( self ):
"""
@return extinction at 280 nm [/M/cm] assuming all Cys are involved in S-S bonds
"""
if not self.sequence:
return 0
eSS = 125
return self.e280reduced() + self.maxSS() * eSS
class Meta:
app_label = 'rotmic'
@@ -5,7 +5,7 @@
{% block content-top %}
<div class='module'>
{% block content-title %}<h2>Details</h2>{% endblock %}
{% block content-title %}<h2>Description</h2>{% endblock %}
{% block projects %}
<p><em>by</em>
@@ -23,12 +23,8 @@
</p>
{% endblock %}
{% block content-details %}{% endblock %}
{% block content-description %} {# override #}
{% if o.description %}
<div style="width: 100%; height: 1px;background: lightgrey; text-align: center;"><h4>Description</h4></div>
<p></p>
<div id="description">
<p class='description'>
{{o.description|markdown}}
@@ -37,6 +33,8 @@
{% endif %}
{% endblock %}
{% block content-details %}{% endblock %}
{% block attachments %}
{% if o.attachments.count != 0 %}
<div style="width: 100%; height: 1px;background: lightgrey; text-align: center;"><h4>Attachments</h4></div>
@@ -32,95 +32,93 @@
{% block content-title%}<h2>Description</h2>{% endblock %}
{% block content-details %}{% endblock %}
{% block content-description %}
<div id="description">
<p class='description'>
{{o.description|markdown}}
</p>
</div>
{% endblock %}
<table>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td>
</tr>
{% if o.vectorBackbone %}
{% with o.vectorBackbone as vector %}
<tr class="row1" style="vertical-align:middle">
<td style="background-color:white;">
<img src="{% static "img/icon_plasmid_open.png" %}" align="left" height="35">
</td>
<td style="vertical-align:middle">Vector<br>Backbone:</td>
<td style="vertical-align:middle">
<b><a href="{{vector.get_absolute_url}}" title="{{vector.description}}">
{{vector}}</a></b>
</td>
<td style="vertical-align:middle">
[{{vector.componentType.name}}]</td>
<td style="vertical-align:middle"
>{{vector.showDescription}}</td>
<td></td>
</tr>
{% for m in vector.markers.all %}
<tr class="row1">
<td style="background-color:white;">
<img src="{% static "img/icon_marker.png" %}" align="left">
</td>
<td>
Marker:
</td>
<td>
<a href="{{m.get_absolute_url}}" title="{{m.description}}"><b>{{m.name}}</b></a>
</td>
<td>[{{m.componentType.name}}]</td>
<td>{{m.showDescription}}</td>
<td></td>
</tr>
{% endfor %}
{% endwith %}
{% endif %}
{% for m in o.markers.all %}
<tr class="row1">
<td style="background-color:white;">
<img src="{% static "img/icon_marker.png" %}" align="left"></td>
<td>
Marker (own):
</td>
<td>
<a href="{{m.get_absolute_url}}" title="{{m.description}}"><b>{{m.name}}</b></a>
</td>
<td>[{{m.componentType.name}}]</td>
<td>{{m.showDescription}}</td>
<td></td>
</tr>
{% endfor %}
{% for x in o.allProteins %}
<tr class="row1">
<td style="background-color:white;">
<img src="{% static "img/icon_protein.png" %}" align="left" height="30">
{% block content-details %}
<table>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td>
</tr>
{% if o.vectorBackbone %}
{% with o.vectorBackbone as vector %}
<tr class="row1" style="vertical-align:middle">
<td style="background-color:white;">
<img src="{% static "img/icon_plasmid_open.png" %}" align="left" height="35">
</td>
<td style="vertical-align:middle">Vector<br>Backbone:</td>
<td style="vertical-align:middle">
generates<br>Protein:
<b><a href="{{vector.get_absolute_url}}" title="{{vector.description}}">
{{vector}}</a></b>
</td>
<td style="vertical-align:middle">
<b><a href="{{x.get_absolute_url}}" title="{{x.description}}">{{x}}</a></b></td>
<td style="vertical-align:middle">
[{{x.componentType.name}}]</td>
<td style="vertical-align:middle">
{{x.showDescription}}</td>
<td style="text-align: center;vertical-align:middle;">
{{x.protein_samples.count}} samples
</td>
[{{vector.componentType.name}}]</td>
<td style="vertical-align:middle"
>{{vector.showDescription}}</td>
<td></td>
</tr>
{% endfor %}
</table></p>
</div>
{% for m in vector.markers.all %}
<tr class="row1">
<td style="background-color:white;">
<img src="{% static "img/icon_marker.png" %}" align="left">
</td>
<td>
Marker:
</td>
<td>
<a href="{{m.get_absolute_url}}" title="{{m.description}}"><b>{{m.name}}</b></a>
</td>
<td>[{{m.componentType.name}}]</td>
<td>{{m.showDescription}}</td>
<td></td>
</tr>
{% endfor %}
{% endwith %}
{% endif %}
{% for m in o.markers.all %}
<tr class="row1">
<td style="background-color:white;">
<img src="{% static "img/icon_marker.png" %}" align="left"></td>
<td>
Marker (own):
</td>
<td>
<a href="{{m.get_absolute_url}}" title="{{m.description}}"><b>{{m.name}}</b></a>
</td>
<td>[{{m.componentType.name}}]</td>
<td>{{m.showDescription}}</td>
<td></td>
</tr>
{% endfor %}
{% for x in o.allProteins %}
<tr class="row1">
<td style="background-color:white;">
<img src="{% static "img/icon_protein.png" %}" align="left" height="30">
</td>
<td style="vertical-align:middle">
generates<br>Protein:
</td>
<td style="vertical-align:middle">
<b><a href="{{x.get_absolute_url}}" title="{{x.description}}">{{x}}</a></b></td>
<td style="vertical-align:middle">
[{{x.componentType.name}}]</td>
<td style="vertical-align:middle">
{{x.showDescription}}</td>
<td style="text-align: center;vertical-align:middle;">
{{x.protein_samples.count}} samples
</td>
</tr>
{% endfor %}
</table></p>
{% endblock content-description%}
{% endblock content-details%}
{% block content-middle %}
@@ -2,6 +2,7 @@
{% load i18n admin_static admin_list %}
{% load admin_urls %}
{% load rotmicfilters benchling seqdisplay %}
{% load humanize %}
{% block extrastyle %}{{block.super}}
{% seqdisplay_css %}
@@ -27,11 +28,44 @@
{%endblock%}
{% block content-details %}
<p><ul>
<li><b>Length:</b> {{o.length}} aa</li>
<li><b>Molecular Weight:</b> {{o.mass}} D</li>
<li><b>Isoelectric Point:</b> {{o.isoelectric}}</li>
</ul><p>
<p>
<table>
<!--
<tr class="row1" style="vertical-align:middle">
<td></td><td></td><td></td>
</tr>
-->
<tr class="row1" style="vertical-align:middle" >
<td style="background-color:white; text-align:right" width="12">&bull;</td>
<td><b>Length:</b></td><td>{{o.length}} aa</td>
</tr>
<tr class="row1" style="vertical-align:middle" >
<td style="background-color:white; text-align:right" width="12">&bull;</td>
<td><b>Molecular Weight:</b></td><td>{{o.mass |intcomma}} D</td>
</tr>
<tr class="row1" style="vertical-align:middle" >
<td style="background-color:white; text-align:right" width="12">&bull;</td>
<td><b>Isoelectric Point:</b></td><td>{{o.isoelectric}}</td>
</tr>
<tr class="row1" style="vertical-align:middle" >
<td style="background-color:white; text-align:right" width="12">&bull;</td>
<td><b>E (280 nm):</b></td><td>{{o.e280reduced |intcomma}} M<sup>-1</sup> cm<sup>-1</sup></td>
</tr>
{%if o.maxSS%}
<tr class="row1" style="vertical-align:middle" >
<td style="background-color:white; text-align:right" width="12">&bull;</td>
<td><b>E (280 nm):</b></td><td>{{o.e280ss |intcomma}} M<sup>-1</sup> cm<sup>-1</sup>
(assuming {{o.maxSS}} S-S bonds) </td>
</tr>
{% else %}
<tr class="row1" style="vertical-align:middle" >
<td style="background-color:white; text-align:right" width="12">&bull;</td>
<td></td><td>no disulfide bonds possible</td>
</tr>
{%endif%}
</table>
</p>
{% endblock %}
{% block add-sample-url %} {# Link for "Add Sample" Button #}
@@ -184,6 +184,7 @@
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',

0 comments on commit 2f67407

Please sign in to comment.