<commit_before>/**
* KBase Reads viewer.
* A widget for viewing info about a KBaseFile.PairedEndLibrary or KBaseFile.SingleEndLibrary
* @public
*/
define ([
    'bluebird',
    'kbwidget',
    'bootstrap',
    'jquery',
    'kbaseAuthenticatedWidget',
    'narrativeConfig',
    'kbase-client-api',
    'util/string',
    'util/display',
    'kbase-generic-client-api'
], function (
    Promise,
    KBWidget,
    bootstrap,
    $,
    kbaseAuthenticatedWidget,
    Config,
    KBaseClientApi,
    StringUtil,
    DisplayUtil,
    GenericClient
) {
    'use strict';
    return KBWidget({
        /*
        * (required) Your widget should be named in CamelCase.
        */
        name: 'kbaseDefaultNarrativeOutput',
        parent : kbaseAuthenticatedWidget,
        version: "1.0.0",
        token: null,
        width: 1150,
        options: {
            wsId: null,
            wsName: null,
            objId: null,
            jobId: null,
            data: null
        },

        init: function(options) {
            this._super(options);
            return this;
        },

        render: function() {
            if (this.options._obj_info) {
                this.reference =  this.options.wsName + '/' + this.options.objId + '/' + this.options._obj_info['version'];
            } else {
                this.reference =  this.options.wsName + '/' + this.options.objId;
            }
            Promise.resolve(this.client.sync_call("ReadsAPI.get_reads_info_all_formatted",[{workspace_obj_ref: this.reference}]))
            .then(function(results) {
                this.reads = results[0];
                //		this.$elem.append('<div>' + JSON.stringify(this.reads) + '</div>');
                this.renderBasicTable();
            }.bind(this))
            .catch(function(error) {
                var errorMsg = 'No further information available',
                    errorTrace = undefined;
                console.error("Render Function Error : ", error);
                if (error && typeof error === 'object') {<commit_msg>Add ref path for viewing the reads viewer<commit_after>/**
* KBase Reads viewer.
* A widget for viewing info about a KBaseFile.PairedEndLibrary or KBaseFile.SingleEndLibrary
* @public
*/
define ([
    'bluebird',
    'kbwidget',
    'bootstrap',
    'jquery',
    'kbaseAuthenticatedWidget',
    'narrativeConfig',
    'kbase-client-api',
    'util/string',
    'util/display',
    'kbase-generic-client-api'
], function (
    Promise,
    KBWidget,
    bootstrap,
    $,
    kbaseAuthenticatedWidget,
    Config,
    KBaseClientApi,
    StringUtil,
    DisplayUtil,
    GenericClient
) {
    'use strict';
    return KBWidget({
        /*
        * (required) Your widget should be named in CamelCase.
        */
        name: 'kbaseReadsViewer',
        parent : kbaseAuthenticatedWidget,
        version: "1.0.0",
        token: null,
        width: 1150,
        options: {
            obj_ref: null,
//            wsId: null,
            wsName: null,
            objId: null,
            jobId: null,
            data: null
        },

        init: function(options) {
            this._super(options);
            return this;
        },

        render: function() {
            if (this.options.obj_ref) {
                this.reference = this.options.obj_ref;
            }
            else{
                if (this.options._obj_info) {
                    this.reference =  this.options.wsName + '/' + this.options.objId + '/' + this.options._obj_info['version'];
                } else {
                    this.reference =  this.options.wsName + '/' + this.options.objId;
                }
            }
            Promise.resolve(this.client.sync_call("ReadsAPI.get_reads_info_all_formatted",[{workspace_obj_ref: this.reference}]))
            .then(function(results) {
                this.reads = results[0];
                //		this.$elem.append('<div>' + JSON.stringify(this.reads) + '</div>');
                this.renderBasicTable();
            }.bind(this))
            .catch(function(error) {
                var errorMsg = 'No further information available',
                    errorTrace = undefined;
                console.error("Render Function Error : ", error);
                if (error && typeof error === 'object') {
{'fraction_non_alphanumeric': 0.12293748547524982, 'fraction_numerical': 0.0037183360446200325, 'mean_word_length': 1.7344345616264294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6126448', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1212, 'n_words': 242}