Commit da77bbcc authored by Boris A. Burkov's avatar Boris A. Burkov
Browse files

Renamed related_proteins to protein_targets everywhere for naming consistency.

parent 24f0f8ed
......@@ -367,7 +367,7 @@ class RnaFastaSerializer(serializers.ModelSerializer):
fields = ('fasta',)
class RelatedProteinSerializer(serializers.ModelSerializer):
class ProteinTargetsSerializer(serializers.ModelSerializer):
target_accession = serializers.CharField() # use non-null target_accession instead of nullable protein_accession
source_accession = serializers.CharField()
methods = serializers.ListField(serializers.CharField())
......
......@@ -132,7 +132,7 @@ class RnaEndpointsTestCase(ApiV1BaseClass):
taxid = '9606'
page = 1
page_size = 1000
url = reverse('rna-related-proteins', kwargs={'pk': upi, 'taxid': taxid})
url = reverse('rnaprotein-targets', kwargs={'pk': upi, 'taxid': taxid})
with Timer() as timer:
c = APIClient()
response = c.get(url, data={'page': page, 'page_size': page_size})
......@@ -143,7 +143,7 @@ class RnaEndpointsTestCase(ApiV1BaseClass):
def test_related_proteins_pagination(self):
upi = 'URS0000021B51' # over 9000 entries =)
taxid = '10090'
url = reverse('rna-related-proteins', kwargs={'pk': upi, 'taxid': taxid})
url = reverse('rna-protein-targets-targets', kwargs={'pk': upi, 'taxid': taxid})
with Timer() as timer:
c = APIClient()
response = c.get(url, data={}) # pagination is enabled by default
......
......@@ -47,7 +47,7 @@ urlpatterns = [
# go annotations for RNA (species-specific)
url(r'^rna/(?P<pk>URS[0-9A-Fa-f]{10})/go-annotations/(?P<taxid>\d+)/?$', cache_page(CACHE_TIMEOUT)(views.RnaGoAnnotationsView.as_view()), name='rna-go-annotations'),
# target proteins for RNA (species-specific)
url(r'^rna/(?P<pk>URS[0-9A-Fa-f]{10})/related-proteins/(?P<taxid>\d+)/?$', cache_page(CACHE_TIMEOUT)(views.RelatedProteinsView.as_view()), name='rna-related-proteins'),
url(r'^rna/(?P<pk>URS[0-9A-Fa-f]{10})/protein-targets/(?P<taxid>\d+)/?$', cache_page(CACHE_TIMEOUT)(views.ProteinTargetsView.as_view()), name='rna-protein-targets'),
# literature citations associated with ENA records
url(r'^accession/(?P<pk>.*?)/citations/?$', cache_page(CACHE_TIMEOUT)(views.CitationsView.as_view()), name='accession-citations'),
# view for an individual cross-reference
......
......@@ -37,7 +37,7 @@ from apiv1.serializers import RnaNestedSerializer, AccessionSerializer, Citation
RnaFlatSerializer, RnaFastaSerializer, RnaGffSerializer, RnaGff3Serializer, RnaBedSerializer, \
RnaSpeciesSpecificSerializer, ExpertDatabaseStatsSerializer, \
RawPublicationSerializer, RnaSecondaryStructureSerializer, RfamHitSerializer, \
EnsemblAssemblySerializer, EnsemblInsdcMappingSerializer, RelatedProteinSerializer
EnsemblAssemblySerializer, EnsemblInsdcMappingSerializer, ProteinTargetsSerializer
from apiv1.renderers import RnaFastaRenderer, RnaGffRenderer, RnaGff3Renderer, RnaBedRenderer
from portal.models import Rna, RnaPrecomputed, Accession, Xref, Database, DatabaseStats, RfamHit, EnsemblAssembly,\
EnsemblInsdcMapping, GenomeMapping, GenomicCoordinates, GoAnnotation, RelatedSequence, ProteinInfo, url2db, db2url
......@@ -801,12 +801,12 @@ class EnsemblKaryotypeAPIView(APIView):
return Response(assembly.karyotype.first().karyotype)
class RelatedProteinsView(generics.ListAPIView):
class ProteinTargetsView(generics.ListAPIView):
"""API endpoint, presenting ProteinInfo, related to given rna."""
permission_classes = ()
authentication_classes = ()
pagination_class = Pagination
serializer_class = RelatedProteinSerializer
serializer_class = ProteinTargetsSerializer
def get_queryset(self):
pk = self.kwargs['pk']
......
......@@ -11,7 +11,7 @@ angular.module("routes", []).service('routes', ['$interpolate', function($interp
apiGenomeLocationsView: '/api/v1/rna/{{ upi }}/genome-locations/{{ taxid }}',
apiGenomeMappingsView: '/api/v1/rna/{{ upi }}/genome-mappings/{{ taxid }}',
apiRfamHitsView: '/api/v1/rna/{{ upi }}/rfam-hits',
apiRelatedProteinsView: '/api/v1/rna/{{ upi }}/related-proteins/{{ taxid }}',
apiProteinTargetsView: '/api/v1/rna/{{ upi }}/protein-targets/{{ taxid }}',
lineageView: '/rna/{{ upi }}/lineage',
expertDbsApi: '/api/v1/expert-dbs/{{ expertDbName }}',
expertDbStatsApi: '/api/v1/expert-db-stats/{{ expertDbName }}',
......
var relatedProteins = {
var proteinTargets = {
bindings: {
upi: '<',
taxid: '<',
......@@ -40,7 +40,7 @@ var relatedProteins = {
ctrl.getPageFromServerSide = function() {
ctrl.status = 'loading';
$http.get(routes.apiRelatedProteinsView({ upi: ctrl.upi, taxid: ctrl.taxid }), {params: { page: ctrl.page, page_size: ctrl.pageSize }}).then(
$http.get(routes.apiProteinTargetsView({ upi: ctrl.upi, taxid: ctrl.taxid }), {params: { page: ctrl.page, page_size: ctrl.pageSize }}).then(
function(response) {
ctrl.status = 'success';
ctrl.displayedProteins = response.data.results;
......@@ -61,7 +61,7 @@ var relatedProteins = {
ctrl.timeout = parseInt(ctrl.timeout) || 5000; // if (time of response) > timeout, paginate on server side
ctrl.status = 'loading'; // {'loading', 'error' or 'success'} - display spinner, error message or xrefs table
$http.get(routes.apiRelatedProteinsView({ upi: ctrl.upi, taxid: ctrl.taxid }), { timeout: ctrl.timeout, params: { page: 1, page_size: 1000000000000 } }).then(
$http.get(routes.apiProteinTargetsView({ upi: ctrl.upi, taxid: ctrl.taxid }), { timeout: ctrl.timeout, params: { page: 1, page_size: 1000000000000 } }).then(
function(response) {
ctrl.status = 'success';
ctrl.proteins = response.data.results;
......@@ -96,7 +96,7 @@ var relatedProteins = {
return $interpolate(template)({ tarbaseId: tarbaseId, ensemblId: ensemblId });
}
}],
templateUrl: '/static/js/components/sequence/related-proteins/related-proteins.html'
templateUrl: '/static/js/components/sequence/protein-targets/protein-targets.html'
};
angular.module("rnaSequence").component("relatedProteins", relatedProteins);
\ No newline at end of file
angular.module("rnaSequence").component("proteinTargets", proteinTargets);
\ No newline at end of file
......@@ -198,7 +198,7 @@ limitations under the License.
<script src="{% static "js/components/sequence/xrefs/xref-publications/xref-publications.component.js" %}"></script>
<script src="{% static "js/components/sequence/2d/2d.component.js" %}"></script>
<script src="{% static "js/components/sequence/go-annotations/go-annotations.component.js" %}"></script>
<script src="{% static "js/components/sequence/related-proteins/related-proteins.component.js" %}"></script>
<script src="{% static "js/components/sequence/protein-targets/protein-targets.component.js" %}"></script>
<script src="{% static "js/components/sequence-search/nhmmer.sequence.search.js" %}"></script>
......
......@@ -71,7 +71,7 @@ limitations under the License.
<xrefs upi="upi" taxid="taxid" timeout="500" page-size="5" on-activate-publications="activatePublications()" on-create-modifications-feature="createModificationsFeature(modifications, accession)" on-activate-genome-browser="activateGenomeBrowser(start, end, chr, genome)" on-scroll-to-genome-browser="scrollToGenomeBrowser()"></xrefs>
<related-proteins ng-if="taxid" upi="upi" taxid="taxid" timeout="500" page-size="5" genomes="genomes"></related-proteins>
<protein-targets ng-if="taxid" upi="upi" taxid="taxid" timeout="500" page-size="5" genomes="genomes"></protein-targets>
<h2 ng-if="taxid">
Genome locations
......
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