all files / src/ Evidence.js

30.77% Statements 4/13
0% Branches 0/10
25% Functions 1/4
30.77% Lines 4/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56                                                                                                       
/*jslint node: true */
/*jshint laxbreak: true */
/*jshint laxcomma: true */
"use strict";
 
var _ = require("underscore");
 
var Evidence = function() {
    return {
        manual:
            ['ECO:0000269', 'ECO:0000303', 'ECO:0000305', 'ECO:0000250', 'ECO:0000255', 'ECO:0000244', 'ECO:0000312']
        , automatic: ['ECO:0000256', 'ECO:0000213', 'ECO:0000313', 'ECO:0000259']
        , acronym: {
            'ECO:0000269': 'EXP', 'ECO:0000303': 'NAS', 'ECO:0000305': 'IC', 'ECO:0000250': 'ISS', 'ECO:0000255': 'ISM',
            'ECO:0000244': 'MIXM', 'ECO:0000312': 'MI',
            'ECO:0000256': 'AA', 'ECO:0000213': 'MIXA', 'ECO:0000313': 'AI','ECO:0000259': 'AA'
        }, text: {
            'ECO:0000269': 'Manual assertion based on experiment',
            'ECO:0000303': 'Manual assertion based on opinion',
            'ECO:0000305': 'Manual assertion inferred by curator',
            'ECO:0000250': 'Manual assertion inferred from sequence similarity',
            'ECO:0000255': 'Manual assertion according to rules',
            'ECO:0000244': 'Manual assertion inferred from combination of experimental and computational evidence',
            'ECO:0000312': 'Manual assertion inferred from database entries',
            'ECO:0000256': 'Automatic assertion according to rules',
            'ECO:0000259': 'Automatic assertion inferred from signature match',
            'ECO:0000213': 'Automatic assertion inferred from combination of experimental and computational evidence',
            'ECO:0000313': 'Automatic assertion inferred from database entries'
        }, isLSS: function(evidences) {
            return _.some(evidences, function(evidence) {
                return _.contains(Evidence.automatic, evidence.code);
            });
        }, variantSourceType: {
            uniprot: 'uniprot',
            lss: 'large_scale_study',
            mixed: 'mixed'
        }, existAssociation: function(association) {
            if (association) {
                if (association.length !== 0) {
                    if ((association[0].moreInfo && (association[0].moreInfo.length !== 0))
                        || association[0].name || association[0].description){
                        return true;
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }
            } else {
                return false;
            }
        }
    };
}();
 
module.exports = Evidence;