Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fe saved #369

Open
wants to merge 12 commits into
base: FE2_6102
Choose a base branch
from
2 changes: 1 addition & 1 deletion client/jsx/actions/search_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require('isomorphic-fetch');
import { createPath } from '../lib/search_helpers';
import _ from 'underscore';
const queryString = require('query-string');
const RESULTS_URL = '/backend/get_search_results';
const RESULTS_URL = '/redirect_backend?param=get_search_results';
const WRAPPED_PAGE_SIZE = 250;

// helper methods
Expand Down
4 changes: 3 additions & 1 deletion client/jsx/components/blast/search_form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,9 @@ BLAST Help at NCBI</a>.</p><hr>';
// check to make sure sequence type matches the program

// let tmpseq = seq.replace(/[ATCGU]/gi, '');
let tmpseq = seq.replace(/[ATCGUXN]/gi, '');
// let tmpseq = seq.replace(/[ATCGUXN]/gi, '');
// https://droog.gs.washington.edu/mdecode/images/iupac.html
let tmpseq = seq.replace(/[ATCGUMRWSYKVHDBNX]/gi, '');

if (tmpseq == '') {
if (program == 'blastp' || program == 'tblastn') {
Expand Down
10 changes: 5 additions & 5 deletions client/jsx/components/colleagues/colleagues_form_show.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import {
import PropTypes from 'prop-types';

const COLLEAGUES_AUTOCOMPLETE_URL =
'/backend/autocomplete_results?category=colleague&q=';
const GENES_URL = '/backend/autocomplete_results?category=locus&q=';
'/redirect_backend?param=autocomplete_results?category=colleague&q=';
const GENES_URL = '/redirect_backend?param=autocomplete_results?category=locus&q=';
const KEYWORDS_AUTOCOMPLETE_URL =
'/backend/autocomplete_results?category=colleague&field=keywords&q=';
'/redirect_backend?param=autocomplete_results?category=colleague&field=keywords&q=';
const INSTITUTION_URL =
'/backend/autocomplete_results?category=colleague&field=institution&q=';
'/redirect_backend?param=autocomplete_results?category=colleague&field=institution&q=';

const TRIAGED_COLLEAGUE_URL = '/colleagues/triage';
const COLLEAGUE_GET_URL = '/colleagues';
const USER_COLLEAGUE_UPDATE_URL = '/backend/colleagues';
const USER_COLLEAGUE_UPDATE_URL = '/redirect_backend?param=colleagues';
const CURATOR_COLLEAGUE_UPDATE_URL = TRIAGED_COLLEAGUE_URL;

const ColleaguesFormShow = createReactClass({
Expand Down
4 changes: 2 additions & 2 deletions client/jsx/components/gotools/goslimmapper_form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const style = {
};

const GOtoolsUrl = '/run_gotools';
const GOslimUrl = '/backend/goslim';
const GeneChkUrl = '/backend/ambiguous_names';
const GOslimUrl = '/redirect_backend?param=goslim';
const GeneChkUrl = '/redirect_backend?param=ambiguous_names';

const goSet = [
'Yeast GO-Slim: process',
Expand Down
2 changes: 1 addition & 1 deletion client/jsx/components/gotools/gotermfinder_form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const style = {
};

const GOtoolsUrl = '/run_gotools';
const GeneChkUrl = '/backend/ambiguous_names';
const GeneChkUrl = '/redirect_backend?param=ambiguous_names';

const evidenceCode = [
'HDA',
Expand Down
2 changes: 1 addition & 1 deletion client/jsx/components/primer3/primer3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import t from 'tcomb-form';
import createReactClass from 'create-react-class';
const DataTable = require('../widgets/data_table.jsx');
import PropTypes from 'prop-types';
const PRIMER3URL = '/backend/primer3';
const PRIMER3URL = '/redirect_backend?param=primer3';
const queryString = require('query-string');

const Primer3 = createReactClass({
Expand Down
2 changes: 1 addition & 1 deletion client/jsx/containers/app_search_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Typeahead from '../lib/react-typeahead-component';
import { setUserInput } from '../actions/search_actions';
import { getCategoryDisplayName } from '../lib/search_helpers';

const AUTOCOMPLETE_URL = '/backend/autocomplete_results';
const AUTOCOMPLETE_URL = '/redirect_backend?param=autocomplete_results';
const AUTOCOMPLETE_FETCH_DEBOUNCE_WAIT = 200;
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
Expand Down
8 changes: 8 additions & 0 deletions client/jsx/containers/layout/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@ class Header extends Component {
YGOB (Trinity College)
</a>
</li>
<li>
<a
className="disabled-header-a"
href="https://alphafold.ebi.ac.uk/"
>
AlphaFold
</a>
</li>
</ul>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions client/jsx/models/alignment_index_model.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ var BaseModel = require('./base_model.jsx');
module.exports = class AlignmentIndexModel extends BaseModel {
constructor(options) {
var options = options || {};
options.url = options.url || '/backend/alignments';
options.url = options.url || '/redirect_backend?param=alignments';
super(options);
}

// cache from local storage, otherwise normal fetch
fetch(callback) {
var storageKey = '/backend/alignments';
var storageKey = '/redirect_backend?param=alignments';
var maybeCachedResponse = JSON.parse(localStorage.getItem(storageKey));

// cached data available, use
Expand Down
2 changes: 1 addition & 1 deletion client/jsx/models/genome_snapshot_model.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var QUALIFICATION_STATUSES = ['Verified', 'Uncharacterized', 'Dubious'];
module.exports = class GenomeSnapshotModel extends BaseModel {
constructor(options) {
var options = options || {};
options.url = options.url || '/backend/snapshot';
options.url = options.url || '/redirect_backend?param=snapshot';
super(options);
}

Expand Down
2 changes: 1 addition & 1 deletion client/jsx/models/sequence_details_model.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var MAIN_STRAIN_NAME = 'S288C';
module.exports = class SequenceDetailsModel extends BaseModel {
constructor(options) {
options = options || {};
options.url = `/backend/locus/${options.id}/sequence_details`;
options.url = `/redirect_backend?param=locus/${options.id}/sequence_details`;
super(options);
this.baseAttributes = options;
}
Expand Down
2 changes: 1 addition & 1 deletion client/jsx/models/sequence_neighbors_model.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var MAIN_STRAIN_NAME = 'S288C';
module.exports = class SequenceNeighborsModel extends BaseModel {
constructor(options) {
options = options || {};
options.url = `/backend/locus/${options.id}/neighbor_sequence_details`;
options.url = `/redirect_backend?param=locus/${options.id}/neighbor_sequence_details`;
super(options);
if (options.id) this.id = parseInt(options.id);
if (options.mainStrain) this.mainStrain = options.mainStrain;
Expand Down
2 changes: 1 addition & 1 deletion client/jsx/store/search_store.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
var $ = require('jquery');

var AUTOCOMPLETE_URL = '/backend/autocomplete_results';
var AUTOCOMPLETE_URL = '/redirect_backend?param=autocomplete_results';

var autocompleteQuery = '';
var query = '';
Expand Down
4 changes: 2 additions & 2 deletions client/jsx/stores/variant_viewer_store.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var ClusterStrainsWorker = require('./cluster_strains.jsx');
var staticStrainMetadata = require('./strain_metadata.jsx');
var work = require('webworkify');

var LOCI_SEARCH_BASE_URL = '/backend/search_sequence_objects';
var LOCUS_SHOW_BASE_URL = '/backend/get_sequence_object';
var LOCI_SEARCH_BASE_URL = '/redirect_backend?param=search_sequence_objects';
var LOCUS_SHOW_BASE_URL = '/redirect_backend?param=get_sequence_object';
var REFERENCE_STRAIN_ID = 1;

// internal data, initial state
Expand Down
2 changes: 1 addition & 1 deletion client/jsx/views/snapshot_view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ snapshotView.render = function () {

// init the model and fetch data
var genomeModel = new GenomeSnapshotModel({
url: '/backend/genomesnapshot',
url: '/redirect_backend?param=genomesnapshot',
});
genomeModel.fetch((err, nestedData) => {
// features visualization and table alt
Expand Down
2 changes: 1 addition & 1 deletion config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set :application, 'SGDFrontend'
set :ssh_options, {:forward_agent => true}

set :repo_url, 'git://github.com/yeastgenome/SGDFrontend.git'
set :repo_url, 'https://github.com/yeastgenome/SGDFrontend.git'
set :branch, ENV['BRANCH'] || $1 if `git branch` =~ /\* (\S+)\s/m

set :deploy_to, '/data/www/' + fetch(:application)
Expand Down
4 changes: 4 additions & 0 deletions src/sgd/frontend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from src.sgd.frontend import config
from pyramid.view import notfound_view_config
from src.sgd.frontend.yeastgenome import send_message
from src.sgd.redirect import direct_backend
from src.sgd.tools.blast import do_blast
from src.sgd.tools.patmatch import do_patmatch
from src.sgd.tools.seqtools import do_seq_analysis
Expand All @@ -27,7 +28,10 @@ def prep_views(chosen_frontend, config):
config.add_route('gotermfinder', '/goTermFinder')
config.add_route('goslimmapper', '/goSlimMapper')
config.add_route('strain_alignment', '/strainAlignment')
config.add_route('redirect_backend', '/redirect_backend')
config.add_route('complex', '/complex/{identifier}')
config.add_route('complex_literature_details', '/complex/{identifier}/literature')
config.add_route('complex_go_details', '/complex/{identifier}/go')
config.add_route('allele', '/allele/{identifier}')
config.add_route('allele_literature_details', '/allele/{identifier}/literature')
config.add_route('blog_post', '/blog/{slug}')
Expand Down
6 changes: 3 additions & 3 deletions src/sgd/frontend/yeastgenome/static/js/allele.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
$(document).ready(function() {

$.getJSON('/backend/allele/' + allele['sgdid'] + '/phenotype_details', function(data) {
$.getJSON('/redirect_backend?param=allele/' + allele['sgdid'] + '/phenotype_details', function(data) {
var phenotype_table = create_phenotype_table(data);
create_download_button("phenotype_table_download", phenotype_table, allele['display_name'] + "_phenotype_annotations");
});

$.getJSON('/backend/allele/' + allele['sgdid'] + '/interaction_details', function(data) {
$.getJSON('/redirect_backend?param=allele/' + allele['sgdid'] + '/interaction_details', function(data) {
var interaction_table = create_interaction_table(data, allele['name']['display_text']);
create_download_button("interaction_table_download", interaction_table, allele['name']['display_text'] + "_interaction_annotations");
create_analyze_button("interaction_table_analyze", interaction_table, "<a href='' class='gene_name'>" + allele['name']['display_name'] + "</a> interactors", true);
});

$.getJSON('/backend/allele/' + allele['sgdid'] + '/network_graph', function(data) {
$.getJSON('/redirect_backend?param=allele/' + allele['sgdid'] + '/network_graph', function(data) {

if (data != null && data["nodes"].length > 1) {

Expand Down
22 changes: 11 additions & 11 deletions src/sgd/frontend/yeastgenome/static/js/chemical.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@

$(document).ready(function() {

$.getJSON('/backend/chemical/' + chemical['id'] + '/phenotype_details', function(data) {
$.getJSON('/redirect_backend?param=chemical/' + chemical['id'] + '/phenotype_details', function(data) {
var phenotype_table = create_phenotype_table(data);
create_analyze_button("phenotype_table_analyze", phenotype_table, "<a href='" + chemical['link'] + "' class='gene_name'>" + chemical['display_name'] + "</a> Genes", true);
create_download_button("phenotype_table_download", phenotype_table, chemical['display_name'] + "_phenotype_annotations");
});

$.getJSON('/backend/chemical/' + chemical['id'] + '/go_details', function(data) {
$.getJSON('/redirect_backend?param=chemical/' + chemical['id'] + '/go_details', function(data) {
var go_table = create_go_table(data);
create_analyze_button("go_table_analyze", go_table, "<a href='" + chemical['link'] + "' class='gene_name'>" + chemical['display_name'] + "</a> Genes", true);
create_download_button("go_table_download", go_table, chemical['display_name'] + "_go_annotations");
});

$.getJSON('/backend/chemical/' + chemical['id'] + '/proteinabundance_details', function(data) {
$.getJSON('/redirect_backend?param=chemical/' + chemical['id'] + '/proteinabundance_details', function(data) {
var protein_abundance_table = create_protein_abundance_table(data);
create_download_button("protein_abundance_table_download", protein_abundance_table, chemical['display_name'] + "_protein_abundance");
});

$.getJSON('/backend/chemical/' + chemical['id'] + '/network_graph', function(data) {
$.getJSON('/redirect_backend?param=chemical/' + chemical['id'] + '/network_graph', function(data) {

if (data != null && data["nodes"].length > 1) {

Expand Down Expand Up @@ -196,15 +196,15 @@ function create_go_table(data) {
{"bSearchable":false, "bVisible":false,"aTargets":[1],"mData":1}, //analyze_id
{"aTargets":[2],"mData":2}, //gene
{"bSearchable":false, "bVisible":false,"aTargets":[3],"mData":3}, //gene systematic name
{"aTargets":[4],"mData":6}, //gene ontology term -----> qualifier
{"aTargets":[4],"mData":4}, //gene ontology term -----> qualifier
{"bSearchable":false, "bVisible":false,"aTargets":[5],"mData":5}, //gene ontology term id
{"aTargets":[6],"mData":4}, //qualifier -----> gene ontology term
{"aTargets":[6],"mData":6}, //qualifier -----> gene ontology term
{"bSearchable":false, "bVisible":false,"aTargets":[7],"mData":7}, //aspect
{"aTargets":[8],"mData":12}, //evidence -----> annotation_extension
{"aTargets":[9],"mData":8}, //method -----> evidence
{"bSearchable":false,"bVisible":false,"aTargets":[10],"mData":9}, //source -----> method
{"aTargets":[11],"mData":10}, //assigned on -----> source
{"aTargets":[12],"mData":11}, //annotation_extension -----> assigned on
{"aTargets":[8],"mData":8}, //evidence -----> annotation_extension
{"aTargets":[9],"mData":9}, //method -----> evidence
{"bSearchable":false,"bVisible":false,"aTargets":[10],"mData":10}, //source -----> method
{"aTargets":[11],"mData":11}, //assigned on -----> source
{"aTargets":[12],"mData":12}, //annotation_extension -----> assigned on
{"aTargets":[13],"mData":13} // reference
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/sgd/frontend/yeastgenome/static/js/complex.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

$(document).ready(function() {

$.getJSON('/backend/complex/' + complex['complex_accession'], function(data) {
$.getJSON('/redirect_backend?param=complex/' + complex['complex_accession'], function(data) {

document.getElementById("summary_paragraph").innerHTML = data['description'] + "<p></p>" + data['properties']
// document.getElementById("summary_paragraph").innerHTML = data['description'] + "<p></p>" + data['properties']

var complex_table = create_complex_table(data);

Expand Down
99 changes: 99 additions & 0 deletions src/sgd/frontend/yeastgenome/static/js/complex_go.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@

$(document).ready(function() {

$.getJSON('/redirect_backend?param=complex/' + complex['complex_accession'], function(data) {

if (data["process"].length > 0) {
var complex_bp_go_table = create_go_table("complex_bp", data["process"]);
create_download_button("complex_bp_go_table_download", complex_bp_go_table, complex['complex_accession'] + "_complex_bp_go");
}
if (data["function"].length > 0) {
var complex_mf_go_table = create_go_table("complex_mf", data["function"]);
create_download_button("complex_mf_go_table_download", complex_mf_go_table, complex['complex_accession'] +"_complex_mf_go");
}
if (data["component"].length > 0) {
var complex_cc_go_table = create_go_table("complex_cc", data["component"]);
create_download_button("complex_cc_go_table_download", complex_cc_go_table, complex['complex_accession'] +"_complex_cc_go");
}

all_data = [];
var p = data["process"];
for (var i=0; i < p.length; i++) {
all_data.push(go_data_to_table(p[i], i));
}
var f = data["function"];
for (var i=0; i < f.length; i++) {
all_data.push(go_data_to_table(f[i], i));
}
var c = data["component"];
for (var i=0; i < c.length; i++) {
all_data.push(go_data_to_table(c[i], i));
}

var headers = ["Evidence ID", "Analyze ID", "Complex Name", "Complex Accession", "Qualifier", "Gene Ontology Term ID", "Gene Ontology Term ", "Aspect", "Annotation Extension", "Evidence", "Method", "Source", "Assigned On", "Reference"]
create_download_button_no_table("complex_go_download_all", headers, all_data, complex['complex_accession'] + "_go_annotations")

//if (data != null && data["go_network_graph"]["nodes"].length > 1) {
if (data["go_network_graph"]["nodes"].length > 1) {
var _categoryColors = {
'FOCUS': 'black',
'GO': '#2ca02c',
'complex': '#E6AB03'
};
views.network.render(data["go_network_graph"], _categoryColors, "j-complex-network");
} else {
hide_section("network");
}


});

});

function create_go_table(prefix, data) {
var options = {};
options["aoColumns"] = [
{"bSearchable":false, "bVisible":false,"aTargets":[0],"mData":0}, // evidence_id
{"bSearchable":false, "bVisible":false,"aTargets":[1],"mData":1}, // analyze_id
{"bSearchable":false, "bVisible":false,"aTargets":[2],"mData":2}, // complex name
{"bSearchable":false, "bVisible":false,"aTargets":[3],"mData":3}, // complex accession
{"aTargets":[4],"mData":4}, // qualifier
{"bSearchable":false, "bVisible":false,"aTargets":[5],"mData":5}, // gene ontology term id
{"aTargets":[6],"mData":6}, // gene ontology term
{"bSearchable":false, "bVisible":false,"aTargets":[7],"mData":7}, // aspect
{"aTargets":[8],"mData":8}, // annotation_extension
{"aTargets":[9],"mData":9}, // evidence
{"bSearchable":false, "bVisible":false, "aTargets":[10],"mData":9}, // annotation type
{"aTargets":[11],"mData":11}, // source
{"aTargets":[12],"mData":12}, // assigned on
{"aTargets":[13],"mData":13} // reference
];
options["bPaginate"] = true;
options["aaSorting"] = [[5, "asc"]];
if("Error" in data) {
options["oLanguage"] = {"sEmptyTable": data["Error"]};
options["aaData"] = [];
}
else {
var datatable = [];
var gos = {};
for (var i=0; i < data.length; i++) {
datatable.push(go_data_to_table(data[i], i));
gos[data[i]['go']['id']] = true;
//console.log(prefix + ": " + data[i]["go"]["display_name"])
}
set_up_header(prefix + '_go_table', datatable.length, 'entry', 'entries', Object.keys(gos).length, 'Gene Ontology term', 'Gene Ontology terms');

options["oLanguage"] = {"sEmptyTable": ''};
options["aaData"] = datatable;

if(Object.keys(gos).length == 0) {
$("#" + prefix + "_go").hide();
$("#" + prefix + "_subsection").hide();
}
}
$("#" + prefix + "_go_table_analyze").hide();
return create_table(prefix + "_go_table", options);

}

2 changes: 1 addition & 1 deletion src/sgd/frontend/yeastgenome/static/js/contig.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(document).ready(function () {
}
});

$.getJSON('/backend/contig/' + contig['id'] + '/sequence_details', function (data) {
$.getJSON('/redirect_backend?param=contig/' + contig['id'] + '/sequence_details', function (data) {
var feature_table = create_feature_table(data['genomic_dna']);
create_download_button("chromosomal_coord_table_download", feature_table, contig['display_name'] + '_features');
create_analyze_button("chromosomal_coord_table_analyze", feature_table, "<a href='" + contig['link'] + "' class='gene_name'>" + contig['display_name'] + "</a> genes", true);
Expand Down
Loading