Commit 227ff4a7 authored by Anze Vavpetic's avatar Anze Vavpetic
Browse files

merge

parents f1d4864b c28eaba0
This file is placed here by pip to indicate the source was put
here by pip.
Once this package is successfully installed this source code will be
deleted (unless you remove this file).
......@@ -159,59 +159,51 @@ except NameError:
from local_settings import *
except ImportError:
pass
if USE_CONCURRENCY:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'workflows',
'workflows.latino',
'workflows.decision_support',
'workflows.bioinformatics',
'workflows.subgroup_discovery',
'workflows.nlp',
'workflows.ilp',
'workflows.mysql',
'website',
'signuplogin',
'django_extensions',
'django.contrib.humanize',
'orderable_inlines',
INSTALLED_APPS_DEFAULT = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'website',
'signuplogin',
'django_extensions',
'django.contrib.humanize',
'orderable_inlines',
'workflows',
)
INSTALLED_APPS_CONCUR = (
'djcelery',
)
else:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'workflows',
'workflows.latino',
'workflows.decision_support',
'workflows.bioinformatics',
'workflows.subgroup_discovery',
'workflows.nlp',
'workflows.ilp',
'workflows.mysql',
'workflows.base',
'website',
'signuplogin',
'django_extensions',
'django.contrib.humanize',
'orderable_inlines',
) if USE_CONCURRENCY else (
'streams',
)
)
INSTALLED_APPS_WORKFLOWS_SUB = (
'workflows.base',
'workflows.latino',
'workflows.decision_support',
'workflows.bioinformatics',
'workflows.subgroup_discovery',
'workflows.nlp',
'workflows.nl_toolkit',
'workflows.ilp',
'workflows.weka',
'workflows.cforange',
'workflows.perfeval',
'workflows.mysql'
#WORKFLOWS_SUBAPP_PLACEHOLDER
)
INSTALLED_APPS = \
INSTALLED_APPS_DEFAULT +\
INSTALLED_APPS_CONCUR +\
INSTALLED_APPS_WORKFLOWS_SUB
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS
TEMPLATES_FOLDER = os.path.join(PROJECT_DIR, 'templates')
......@@ -226,3 +218,4 @@ LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/'
STATIC_DOC_ROOT = os.path.join(os.getcwd(), 'mothra/public/media')
......@@ -7,4 +7,5 @@ django-extensions==0.9
django-orderable-inlines==0.0.6
django-picklefield==0.2.1
httplib2==0.7.5
pydot==1.0.28
wsgiref==0.1.2
This diff is collapsed.
def base_concatenate_lists(input_dict):
lists = input_dict['lists']
new_list = []
for every_list in lists:
new_list = new_list+every_list
output_dict = {}
output_dict['list']=new_list
return output_dict
\ No newline at end of file
[\n]
\ No newline at end of file
......@@ -5,6 +5,7 @@ Bioinformatics interaction viewes.
'''
from django.shortcuts import render
def insilico_search(request, input_dict, output_dict, widget):
#TODOl
return render(request, 'interactions/insilico_search.html', {'widget':widget})
def feature_selection(request, input_dict, output_dict, widget):
#TODO
return render(request, 'interactions/feature_selection.html', {'widget':widget})
......@@ -3,9 +3,25 @@ Bioinformatics library.
@author: Anze Vavpetic <anze.vavpetic@ijs.si>
'''
def insilico_search(input_dict):
#
# Visualization widgets:
#
def rank_plotter(input_dict):
return input_dict
def segs_rule_browser(input_dict):
return input_dict
#
# Interactions widgets:
#
def feature_selection_finished(postdata, input_dict, output_dict):
# TODO
return output_dict
def insilico_finished(input_dict):
#TODO
return input_dict
\ No newline at end of file
#
# Regular widgets:
#
def segs(input_dict):
# TODO
output_dict = {}
return output_dict
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -6,6 +6,6 @@ package_root = os.path.dirname(__file__)
package_statics = os.path.join(os.path.dirname(__file__), 'static', package_name)
package_bin = os.path.join(package_root, 'bin')
auto_update_db = True
auto_update_db = False
create_backups = True
from django.conf.urls.defaults import patterns, include, url
urlpatterns = patterns('',
url(r'^get-new-feature-selection-scores/widget(?P<widget_id>[0-9]+)/(?P<method>\w+)/$', 'workflows.bioinformatics.views.get_new_feature_selection_scores',
name='get new feature selection scores'),
)
\ No newline at end of file
# helperji, context stvari
from django.shortcuts import render, get_object_or_404, redirect
from django.http import Http404, HttpResponse
# modeli
from workflows.models import *
# auth fore
from django.contrib.auth.decorators import login_required
# Orange bioinformatics differential expression
# from orngBioinformatics.obiExpression import *
# SCORE_METHODS = [("fold change", ExpressionSignificance_FoldChange, twoTailTest, True),
# ("log2 fold change", ExpressionSignificance_Log2FoldChange, twoTailTest, True),
# ("t-test", ExpressionSignificance_TTest_T, twoTailTest, True),
# ("t-test p-value", ExpressionSignificance_TTest_PValue, oneTailTestLow, True),
# ("anova", ExpressionSignificance_ANOVA_F, oneTailTestHi, False),
# ("anova p-value", ExpressionSignificance_ANOVA_PValue, oneTailTestLow, False),
# ("signal to noise ratio", ExpressionSignificance_SignalToNoise, twoTailTest, True),
# ("info gain", ExpressionSignificance_Info, oneTailTestHi, True),
# ("chi-square", ExpressionSignificance_ChiSquare, oneTailTestHi, True),
# ("mann-whitney", ExpressionSignigicance_MannWhitneyu_U, oneTailTestLow, True),
# ("AREA (timeseries)", ExpressionSignificance_AREA, oneTailTestHi, False),
# ("FC (timeseries)", ExpressionSignificance_FCts, oneTailTestHi, False)]
@login_required
def get_new_feature_selection_scores(request, widget_id, method = 0):
w = get_object_or_404(Widget, pk=widget_id)
if w.workflow.user == request.user:
data = w.inputs.all()[0]
_, score_method, _, twotailtest = SCORE_METHODS[method]
return HttpResponse(data, mimetype='text/json')
else:
return HttpResponse(status=400)
'''
Bioinformatics visualization viewes.
@author: Anze Vavpetic <anze.vavpetic@ijs.si>
'''
from django.shortcuts import render
def rank_plotter(request, input_dict, output_dict, widget):
#TODO
return render(request, 'interactions/rank_plotter.html', {'widget':widget})
def segs_rule_browser(request, input_dict, output_dict, widget):
#TODO
return render(request, 'interactions/segs_rule_browser.html', {'widget':widget})
This diff is collapsed.
from django.shortcuts import render
def cforange_filter_integers(request,input_dict,output_dict,widget):
return render(request, 'interactions/cforange_filter_integers.html',{'widget':widget,'intList':input_dict['intList']})
\ No newline at end of file
def cforange_split_dataset(input_dict):
import orange
output_dict = {}
data = input_dict['dataset']
selection = orange.MakeRandomIndices2(data,float(input_dict['p']))
train_data = data.select(selection,0)
test_data = data.select(selection,1)
output_dict['train_data']=train_data
output_dict['test_data']=test_data
return output_dict
def cforange_score_estimation(input_dict):
import orange
import orngFSS
data = input_dict['dataset']
ma = orngFSS.attMeasure(data,orange.MeasureAttribute_relief(k=int(input_dict['k']), m=int(input_dict['m'])))
output_string = ""
output_dict = {}
output_dict['results'] = ma
return output_dict
def cforange_best_natts(input_dict):
import orange
import orngFSS
data = input_dict['dataset']
scores = input_dict['scores']
n = int(input_dict['n'])
new_dataset = orngFSS.selectBestNAtts(data,scores,n)
output_dict={}
output_dict['new_dataset'] = new_dataset
return output_dict
def cforange_atts_above_thresh(input_dict):
import orange
import orngFSS
data = input_dict['dataset']
scores = input_dict['scores']
thresh = float(input_dict['thresh'])
new_dataset = orngFSS.selectAttsAboveThresh(data,scores,thresh)
output_dict={}
output_dict['new_dataset'] = new_dataset
return output_dict
def cforange_filter_relieff(input_dict):
import orange
import orngFSS
data = input_dict['dataset']
measure = orange.MeasureAttribute_relief(k=int(input_dict['k']), m=int(input_dict['m']))
margin = float(input_dict['margin'])
new_dataset = orngFSS.filterRelieff(data,measure,margin)
output_dict = {}
output_dict['new_dataset'] = new_dataset
return output_dict
def cforange_multiple_cross_validation(input_dict):
import orange, orngTest, orngStat
learners = input_dict['learners']
data = input_dict['dataset']
folds = int(input_dict['folds'])
results = orngTest.crossValidation(learners, data, folds=folds)
output_dict = {}
output_dict['results']=results
return output_dict
def cforange_proportion_test(input_dict):
import orange, orngTest, orngStat
learners = input_dict['learners']
data = input_dict['dataset']
learnProp = float(input_dict['learnProp'])
times = int(input_dict['times'])
results = orngTest.proportionTest(learners, data, learnProp, times=times)
output_dict = {}
output_dict['results']=results
return output_dict
def cforange_leave_one_out(input_dict):
import orange, orngTest, orngStat
learners = input_dict['learners']
data = input_dict['dataset']
results = orngTest.leaveOneOut(learners, data)
output_dict = {}
output_dict['results']=results
return output_dict
def cforange_cross_validation(input_dict):
import orange, orngTest, orngStat
learners = [input_dict['learner']]
data = input_dict['dataset']
folds = int(input_dict['folds'])
results = orngTest.crossValidation(learners, data, folds=folds)
output_dict = {}
output_dict['results']=results
return output_dict
def cforange_classification_accuracy(input_dict):
import orngStat
results = input_dict['results']
CAs = orngStat.CA(results)
if len(CAs)==1:
CAs = CAs[0]
output_dict = {}
output_dict['ca']=CAs
return output_dict
def cforange_classification_accuracy(input_dict):
import orngStat
results = input_dict['results']
if input_dict['reportSE']=='true':
reportSE = True
else:
reportSE = False
CAs = orngStat.CA(results,reportSE=reportSE)
if len(CAs)==1:
CAs = CAs[0]
output_dict = {}
output_dict['ca']=CAs
return output_dict
def cforange_average_probability(input_dict):
import orngStat
results = input_dict['results']
if input_dict['reportSE']=='true':
reportSE = True
else:
reportSE = False
APs = orngStat.AP(results,reportSE=reportSE)
if len(APs)==1:
APs = APs[0]
output_dict = {}
output_dict['ap']=APs
return output_dict
def cforange_brier_score(input_dict):
import orngStat
results = input_dict['results']
if input_dict['reportSE']=='true':
reportSE = True
else:
reportSE = False
BSs = orngStat.BrierScore(results,reportSE=reportSE)
if len(BSs)==1:
BSs = BSs[0]
output_dict = {}
output_dict['bs']=BSs
return output_dict
def cforange_information_score(input_dict):
import orngStat
results = input_dict['results']
if input_dict['reportSE']=='true':
reportSE = True
else:
reportSE = False
ISs = orngStat.IS(results,apriori=None,reportSE=reportSE)
if len(ISs)==1:
ISs = ISs[0]
output_dict = {}
output_dict['is']=ISs
return output_dict
def cforange_confusion_matrix(input_dict):
import orngStat
results = input_dict['results']
classIndex = int(input_dict['classIndex'])
if input_dict['cutoff']!='':
cutoff = float(input_dict['cutoff'])
cm = orngStat.confusionMatrices(results,classIndex=classIndex,cutoff=cutoff)
else:
cm = orngStat.confusionMatrices(results,classIndex=classIndex)
if len(cm)==1:
cm = cm[0]
print cm
output_dict = {}
output_dict['cm']=cm
return output_dict
def cforange_confusion_matrix_computations(input_dict):
import orngStat
cm = input_dict['cm']
alpha = float(input_dict['alpha'])
output_dict = {}
output_dict['sens']=orngStat.sens(cm)
output_dict['spec']=orngStat.spec(cm)
output_dict['PPV']=orngStat.PPV(cm)
output_dict['NPV']=orngStat.NPV(cm)
output_dict['precision']=orngStat.precision(cm)
output_dict['recall']=orngStat.recall(cm)
output_dict['F1']=orngStat.F1(cm)
output_dict['Falpha']=orngStat.Falpha(cm,alpha=alpha)
output_dict['MCC']=orngStat.MCC(cm)
return output_dict
def cforange_auc(input_dict):
import orngStat
results = input_dict['results']
method = int(input_dict['method'])
auc = orngStat.AUC(results,method)
output_dict = {}
output_dict['AUC']=auc
return output_dict
def cforange_MSE(input_dict):
import orngStat
results = input_dict['results']
errors = orngStat.MSE(results)
if len(errors)==1:
errors = errors[0]
output_dict = {}
output_dict['MSE']=errors
return output_dict
def cforange_RMSE(input_dict):
import orngStat
results = input_dict['results']
errors = orngStat.RMSE(results)
if len(errors)==1:
errors = errors[0]
output_dict = {}
output_dict['RMSE']=errors
return output_dict
def cforange_MAE(input_dict):
import orngStat
results = input_dict['results']
errors = orngStat.MAE(results)
if len(errors)==1:
errors = errors[0]
output_dict = {}
output_dict['MAE']=errors
return output_dict
def cforange_RSE(input_dict):
import orngStat
results = input_dict['results']
errors = orngStat.RSE(results)
if len(errors)==1:
errors = errors[0]
output_dict = {}
output_dict['RSE']=errors
return output_dict
def cforange_RRSE(input_dict):
import orngStat
results = input_dict['results']
errors = orngStat.RRSE(results)
if len(errors)==1:
errors = errors[0]
output_dict = {}
output_dict['RRSE']=errors
return output_dict
def cforange_RAE(input_dict):
import orngStat
results = input_dict['results']
errors = orngStat.RAE(results)
if len(errors)==1:
errors = errors[0]
output_dict = {}
output_dict['RAE']=errors
return output_dict
def cforange_R2(input_dict):
import orngStat
results = input_dict['results']
errors = orngStat.R2(results)
if len(errors)==1:
errors = errors[0]
output_dict = {}
output_dict['R2']=errors
return output_dict
def cforange_prepare_results(input_dict):
output_dict = {}
learners = input_dict['learners']
newlist = []
for i in range(0,len(learners)):
newdict = {}
newdict['name']=str(learners[i])
newdict['fbeta']=0.5
newdict['precision']=input_dict['precision'][i]
newdict['recall']=input_dict['recall'][i]
newdict['fscore']=input_dict['f'][i]
newlist.append(newdict)
output_dict['alp']=newlist
return output_dict
\ No newline at end of file
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