Skip to content

Commit

Permalink
#RNA-489 - Show anticodon
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosribas committed Feb 29, 2024
1 parent d9ec22c commit 90f5af8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
16 changes: 7 additions & 9 deletions rnacentral/apiv1/views.py
Expand Up @@ -777,16 +777,14 @@ class SequenceFeaturesAPIViewSet(generics.ListAPIView):
def get_queryset(self):
upi = self.kwargs["pk"]
taxid = self.kwargs["taxid"]
return SequenceFeature.objects.filter(
upi=upi,
taxid=taxid,
feature_name__in=[
"conserved_rna_structure",
"mature_product",
"cpat_orf",
"rna_editing_event",
],
features = SequenceFeature.objects.filter(upi=upi, taxid=taxid).exclude(
feature_name__in=["modification", "rfam_hit"]
)
# create list of anticodon ids to remove all but 1
anticodon_ids = features.filter(feature_name="anticodon").values_list(
"pk", flat=True
)[1:]
return features.exclude(pk__in=anticodon_ids)


class RnaGoAnnotationsView(APIView):
Expand Down
2 changes: 1 addition & 1 deletion rnacentral/portal/static/css/main.css
Expand Up @@ -1484,7 +1484,7 @@ textarea {
border-radius: 15px;
}

.rfamModelsGroup, .crsFeaturesGroup, .matureMirnaFeaturesGroup, .rediPortalFeaturesGroup {
.rfamModelsGroup, .crsFeaturesGroup, .matureMirnaFeaturesGroup, .rediPortalFeaturesGroup, .anticodonFeaturesGroup {
cursor: pointer;
}

Expand Down
24 changes: 24 additions & 0 deletions rnacentral/portal/static/js/components/sequence/sequence.module.js
Expand Up @@ -559,6 +559,30 @@ $q.all([$scope.fetchRna(), $scope.featureViewerContainerReady()]).then(function(
});
},
},
anticodon: {
features: [],
normalize: function(feature) {
return {
x: feature.start >= 0 ? feature.start : 1,
y: feature.stop < $scope.rna.length ? feature.stop : $scope.rna.length - 1,
description: 'Anticodon (Isotype: ' + feature.metadata.isotype + ', Sequence: ' + feature.metadata.sequence + ')',
}
},
addFeature: function(data) {
$scope.featureViewer.addFeature({
id: 'anticodon',
data: data,
name: "Anticodon",
className: "anticodonFeatures",
color: "#267431",
type: "rect",
filter: "type1",
height: 16,
});

$('svg .anticodonFeaturesGroup text').css('fill', 'white').css('font-size', 'small');
},
},
};

$scope.features = "pending";
Expand Down

0 comments on commit 90f5af8

Please sign in to comment.