<commit_before>'use strict';

/* Controllers */

angular.module('pkb.controllers', ['ui.bootstrap'])
.controller('AppController', function ($scope) {
	
})
.controller('HomeController', function ($scope, AnatomicalTermSearch, CharacterStateSearch, OntologyTermSearch, GeneSearch, Vocab) {
    $scope.clearResults = function () {
        $scope.anatomyResults = null;
        $scope.statesResults = null;
        $scope.taxaResults = null;
        $scope.geneResults = null;
    };
    $scope.performSearches = function () {
        if ($scope.searchText) {
            $scope.anatomyResults = AnatomicalTermSearch.query({text: $scope.searchText, limit: 20});
            $scope.statesResults = CharacterStateSearch.query({text: $scope.searchText, limit: 20});
            $scope.taxaResults = OntologyTermSearch.query({text: $scope.searchText, limit: 20, definedBy: Vocab.VTO});
            $scope.geneResults = GeneSearch.query({text: $scope.searchText, limit: 20});
        }
    };
})
.controller('AboutPhenoscapeKBController', function ($scope) {
    
})
.controller('AboutPhenoscapeController', function ($scope) {
    
})
.controller('EntityController', function ($scope, $routeParams, Term, EntityPresence, EntityAbsence) {
    $scope.termID = $routeParams.term;
    $scope.term = Term.query({'iri': $scope.termID});
    $scope.queryPresentInTaxa = function () {
        $scope.presentInTaxa = EntityPresence.query({'entity': $scope.termID, 'limit': 20});
    };
    $scope.queryAbsentInTaxa = function () {
        $scope.absentInTaxa = EntityAbsence.query({'entity': $scope.termID, 'limit': 20});
    };
    
    $scope.queryPresentInTaxa();
})
.controller('TaxonController', function ($scope, $routeParams, $location, $log, Taxon, VariationProfileQuery) {
    $scope.taxonID = $routeParams.taxon;
    $scope.taxon = Taxon.query({'iri': $scope.taxonID});
    $scope.variationProfilePage = 1;
    $scope.variationProfileLimit = 20;
    $scope.variationProfileMaxSize = 3;
    $scope.variationProfileTotal = VariationProfileQuery.query({taxon: angular.toJson([$scope.taxonID]), total: true});
    $scope.variationProfilePageChanged = function (newPage) {
        $scope.variationProfilePage = newPage;
        $log.log('Page changed to: ' + $scope.variationProfilePage);
        $scope.variationProfile = VariationProfileQuery.query({taxon: angular.toJson([$scope.taxonID]), limit: $scope.variationProfileLimit, offset: ($scope.variationProfilePage - 1) * $scope.variationProfileLimit});
    };
    $scope.variationProfilePageChanged(1);
    
    $scope.tabs = {
        classification: {active: true},<commit_msg>Updated variation query to send single taxon ID.<commit_after>'use strict';

/* Controllers */

angular.module('pkb.controllers', ['ui.bootstrap'])
.controller('AppController', function ($scope) {
	
})
.controller('HomeController', function ($scope, AnatomicalTermSearch, CharacterStateSearch, OntologyTermSearch, GeneSearch, Vocab) {
    $scope.clearResults = function () {
        $scope.anatomyResults = null;
        $scope.statesResults = null;
        $scope.taxaResults = null;
        $scope.geneResults = null;
    };
    $scope.performSearches = function () {
        if ($scope.searchText) {
            $scope.anatomyResults = AnatomicalTermSearch.query({text: $scope.searchText, limit: 20});
            $scope.statesResults = CharacterStateSearch.query({text: $scope.searchText, limit: 20});
            $scope.taxaResults = OntologyTermSearch.query({text: $scope.searchText, limit: 20, definedBy: Vocab.VTO});
            $scope.geneResults = GeneSearch.query({text: $scope.searchText, limit: 20});
        }
    };
})
.controller('AboutPhenoscapeKBController', function ($scope) {
    
})
.controller('AboutPhenoscapeController', function ($scope) {
    
})
.controller('EntityController', function ($scope, $routeParams, Term, EntityPresence, EntityAbsence) {
    $scope.termID = $routeParams.term;
    $scope.term = Term.query({'iri': $scope.termID});
    $scope.queryPresentInTaxa = function () {
        $scope.presentInTaxa = EntityPresence.query({'entity': $scope.termID, 'limit': 20});
    };
    $scope.queryAbsentInTaxa = function () {
        $scope.absentInTaxa = EntityAbsence.query({'entity': $scope.termID, 'limit': 20});
    };
    
    $scope.queryPresentInTaxa();
})
.controller('TaxonController', function ($scope, $routeParams, $location, $log, Taxon, VariationProfileQuery) {
    $scope.taxonID = $routeParams.taxon;
    $scope.taxon = Taxon.query({'iri': $scope.taxonID});
    $scope.variationProfilePage = 1;
    $scope.variationProfileLimit = 20;
    $scope.variationProfileMaxSize = 3;
    $scope.variationProfileTotal = VariationProfileQuery.query({taxon: $scope.taxonID, total: true});
    $scope.variationProfilePageChanged = function (newPage) {
        $scope.variationProfilePage = newPage;
        $log.log('Page changed to: ' + $scope.variationProfilePage);
        $scope.variationProfile = VariationProfileQuery.query({taxon: $scope.taxonID, limit: $scope.variationProfileLimit, offset: ($scope.variationProfilePage - 1) * $scope.variationProfileLimit});
    };
    $scope.variationProfilePageChanged(1);
    
    $scope.tabs = {
        classification: {active: true},
{'fraction_non_alphanumeric': 0.14983775529681237, 'fraction_numerical': 0.006871540370299675, 'mean_word_length': 4.06280193236715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '719045', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1582, 'n_words': 270}