Commit dc9de9d6 authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

ordered pockets and chain

parent b470d984
Pipeline #51339 passed with stages
in 23 minutes and 35 seconds
......@@ -138,6 +138,7 @@ class Chain(models.Model):
class Meta:
unique_together = ("pdb", "pdb_chain_id")
ordering = ["pdb", "pdb_chain_id"]
def is_partner(self):
return self.partner_set.count()
......@@ -362,6 +363,7 @@ class Cavity(models.Model):
class Meta:
unique_together = ("full_name", "chain", "cavity_number", "partner")
verbose_name_plural = "Cavities"
ordering = ["chain", "cavity_number"]
@property
def near_cavities(self):
......
......@@ -124,7 +124,6 @@ class ChainSerializer(serializers.ModelSerializer):
"default_isolevel",
"interactfile_set",
)
ordering = ["pdb_chain_id"]
class LigandSerializer(serializers.ModelSerializer):
......
......@@ -397,7 +397,7 @@ function loadNGL(url, callback){
}, false );
var hasmrc = 0
var hasinteract = 0
pdb.chain_set.reverse().forEach(function(chain, indexchain){
pdb.chain_set.forEach(function(chain, indexchain){
var blobchain = new Blob( [ chain.file_content ], {type: 'text/plain'} );
var componentname = pdb.code + '_' + chain.pdb_chain_id;
stage.loadFile( blobchain, {ext:"pdb", name: componentname}).then( function( o ){
......
......@@ -128,7 +128,7 @@
<a class="submithref" href="{% url 'cavities' %}?pdbsearch={{ pdb.code }}"><strong>{{ pdb.code }}</strong></a>
</div>
<div class="card-body text-nowrap">
{% for chain in pdb.chain_set.all reversed %}
{% for chain in pdb.chain_set.all %}
Chain {{ chain.pdb_chain_id }} <a class="submithref" href="{% url 'cavities' %}?uniprotid={{ chain.protein.uniprot_id }}">{{ chain.protein.uniprot_id }}</a>
<a class="submithref" href="{% url 'cavities' %}?organism={{ chain.protein.organism.name }}">{{ chain.protein.organism.name }}</a>
</br>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment