allpy
changeset 1119:0ea281d09324
pair-cores/web: implement compare-aln-3d.cpp application
author | Boris Nagaev <bnagaev@gmail.com> |
---|---|
date | Wed, 28 Nov 2012 17:16:10 +0400 |
parents | f61814d8bef5 |
children | c9fa6904e3d0 |
files | pair_cores/web/approot/locales/pair-cores-web.xml pair_cores/web/approot/locales/pair-cores-web_ru.xml pair_cores/web/compare-aln-3d.cpp |
diffstat | 3 files changed, 42 insertions(+), 72 deletions(-) [+] |
line diff
1.1 --- a/pair_cores/web/approot/locales/pair-cores-web.xml Wed Nov 28 17:15:45 2012 +0400 1.2 +++ b/pair_cores/web/approot/locales/pair-cores-web.xml Wed Nov 28 17:16:10 2012 +0400 1.3 @@ -41,6 +41,27 @@ 1.4 PDYLLKGD 1.5 </pre> 1.6 </message> 1.7 + <message id='pair.main.Example_fasta_compare'> 1.8 + <pre> 1.9 +>1PER_L 1.10 +SISSRVKSKRIQLGLNQAELAQKVGTTQQSIEQLENGKTK-RPRFLPELASALGVS 1.11 +>1PER_R 1.12 +SISSRVKSKRIQLGLNQAELAQKVGTTQQSIEQLENGKTK-RPRFLPELASALGVS 1.13 +>1ADR_A_1 1.14 +LMGERIRARRKKLKIRQAALGKMVGVSNVAISQWERSETEPNGENLLALSKALQCS 1.15 +>1ADR_A_2 1.16 +LMGERIRARRKKLKIRQAALGKMVGVSNVAISQWERSETEPNGENLLALSKALQCS 1.17 + 1.18 +>1PER_L 1.19 +SISSRVKSKRIQLGLNQAELAQKVGTTQQSIEQLENGKTKRPRFLPELASALGVS- 1.20 +>1PER_R 1.21 +SISSRVKSKRIQLGLNQAELAQKVGTTQQSIEQLENGKTKRPRFLPELASALGVS- 1.22 +>1ADR_A_1 1.23 +LMGERIRARRKKLKIRQAALGKMVGVSNVAISQWERSETEPNGENLLALSKALQCS 1.24 +>1ADR_A_2 1.25 +LMGERIRARRKKLKIRQAALGKMVGVSNVAISQWERSETEPNGENLLALSKALQCS 1.26 + </pre> 1.27 + </message> 1.28 <message id='pair.main.Rfbr'> 1.29 The work was partly supported by 1.30 the Russian Foundation for Basic Research, grant 09-04-92743. 1.31 @@ -57,6 +78,7 @@ 1.32 <message id='pair.out.Pair_blocks'>Pair cores file</message> 1.33 <message id='pair.out.Pair_html'>Pair cores HTML file</message> 1.34 <message id='pair.out.Pymol'>Pair cores PyMol file</message> 1.35 + <message id='pair.out.Result'>Result</message> 1.36 1.37 </messages> 1.38
2.1 --- a/pair_cores/web/approot/locales/pair-cores-web_ru.xml Wed Nov 28 17:15:45 2012 +0400 2.2 +++ b/pair_cores/web/approot/locales/pair-cores-web_ru.xml Wed Nov 28 17:16:10 2012 +0400 2.3 @@ -47,6 +47,7 @@ 2.4 <message id='pair.out.Pair_blocks'>Парные блоки (текст)</message> 2.5 <message id='pair.out.Pair_html'>Парные блоки (HTML)</message> 2.6 <message id='pair.out.Pymol'>Парные блоки (PyMol-скрипт)</message> 2.7 + <message id='pair.out.Result'>Результат</message> 2.8 2.9 </messages> 2.10
3.1 --- a/pair_cores/web/compare-aln-3d.cpp Wed Nov 28 17:15:45 2012 +0400 3.2 +++ b/pair_cores/web/compare-aln-3d.cpp Wed Nov 28 17:16:10 2012 +0400 3.3 @@ -25,7 +25,7 @@ 3.4 std::string file = input->file_upload()->clientFileName().toUTF8(); 3.5 std::string without_extension = file.substr(0, file.find_last_of(".")); 3.6 if (without_extension.empty()) { 3.7 - without_extension = "pair-cores"; 3.8 + without_extension = "compare-aln-3d"; 3.9 } 3.10 return without_extension + "." + extension; 3.11 } 3.12 @@ -68,10 +68,15 @@ 3.13 // 3.14 TableTask* task = new TableTask(root()); 3.15 // 3.16 - TextFileInput* input_aln = new TextFileInput("-i"); 3.17 - input_aln->text_area()->setColumns(60); 3.18 - input_aln->text_area()->setRows(12); 3.19 - task->add_input(input_aln, tr("pair.in.Alignment")); 3.20 + TextFileInput* a = new TextFileInput("-a"); 3.21 + a->text_area()->setColumns(60); 3.22 + a->text_area()->setRows(12); 3.23 + task->add_input(a, tr("pair.in.Alignment") + " A"); 3.24 + // 3.25 + TextFileInput* b = new TextFileInput("-b"); 3.26 + b->text_area()->setColumns(60); 3.27 + b->text_area()->setRows(12); 3.28 + task->add_input(b, tr("pair.in.Alignment") + " B"); 3.29 // 3.30 WLineEdit* delta_edit = new WLineEdit("2.0"); 3.31 delta_edit->setValidator(new WDoubleValidator(0, 10)); 3.32 @@ -79,85 +84,27 @@ 3.33 LineEditInput* delta = new LineEditInput(delta_edit, "-d"); 3.34 task->add_input(delta, tr("pair.in.Delta")); 3.35 // 3.36 - WLineEdit* width_edit = new WLineEdit("3"); 3.37 - width_edit->setValidator(new WIntValidator(3, 9999)); 3.38 - width_edit->validator()->setMandatory(true); 3.39 - LineEditInput* width = new LineEditInput(width_edit, "-w"); 3.40 - task->add_input(width, tr("pair.in.Width")); 3.41 - // 3.42 - BoolInput* blocks3d = new BoolInput(new WCheckBox(), "--blocks3d"); 3.43 - task->add_input(blocks3d, tr("pair.in.Blocks3D")); 3.44 - // 3.45 - BoolInput* ioss = new BoolInput(new WCheckBox(), "-e"); 3.46 - ioss->set_value_if_true("True"); 3.47 - task->add_input(ioss, tr("pair.in.SS")); 3.48 - // 3.49 - WLineEdit* pair_timeout_edit = new WLineEdit("10"); 3.50 - pair_timeout_edit->setValidator(new WIntValidator(-1, 30 * 24 * 3600)); 3.51 - pair_timeout_edit->validator()->setMandatory(true); 3.52 - LineEditInput* pair_timeout = new LineEditInput(pair_timeout_edit, 3.53 - "--pair-timeout"); 3.54 - task->add_input(pair_timeout, tr("pair.in.Pair_timeout")); 3.55 - // 3.56 - WLineEdit* blocks3d_timeout_edit = new WLineEdit("-1"); 3.57 - blocks3d_timeout_edit->setValidator(new WIntValidator(-1, 30 * 24 * 3600)); 3.58 - blocks3d_timeout_edit->validator()->setMandatory(true); 3.59 - LineEditInput* blocks3d_timeout = new LineEditInput(blocks3d_timeout_edit, 3.60 - "--blocks3d-timeout"); 3.61 - task->add_input(blocks3d_timeout, tr("pair.in.Blocks3D_timeout")); 3.62 - // 3.63 // outputs 3.64 // 3.65 boost::function<std::string(std::string)> name_gen2 = boost::bind(name_gen, 3.66 - input_aln, _1); 3.67 + a, _1); 3.68 // 3.69 - ViewFileOutput* homology = new ViewFileOutput("-y"); 3.70 - homology->set_suggested_gen(boost::bind(name_gen2, "hom")); 3.71 - homology->set_selectable(false); 3.72 - task->add_output(homology, tr("pair.out.Homology")); 3.73 - // 3.74 - ViewFileOutput* pair_blocks = new ViewFileOutput("-b"); 3.75 - pair_blocks->set_suggested_gen(boost::bind(name_gen2, "blocks")); 3.76 - task->add_output(pair_blocks, tr("pair.out.Pair_blocks")); 3.77 - // 3.78 - ViewFileOutput* pair_html = new ViewFileOutput("-H", 3.79 - &FileOutput::unique_name, 3.80 - "application/octet-stream", 3.81 - "text/html"); 3.82 - pair_html->set_suggested_gen(boost::bind(name_gen2, "html")); 3.83 - task->add_output(pair_html, tr("pair.out.Pair_html")); 3.84 - // 3.85 - ViewFileOutput* pymol = new ViewFileOutput("-p"); 3.86 - pymol->set_suggested_gen(boost::bind(name_gen2, "pml")); 3.87 - task->add_output(pymol, tr("pair.out.Pymol")); 3.88 - // 3.89 - ViewFileOutput* high_pymol = new ViewFileOutput("--high-blocks-pymol"); 3.90 - high_pymol->set_suggested_gen(boost::bind(name_gen2, "pml")); 3.91 - task->add_output(high_pymol, tr("pair.out.High_pymol")); 3.92 - // 3.93 - ViewFileOutput* high_blocks = new ViewFileOutput("--high-blocks"); 3.94 - high_blocks->set_suggested_gen(boost::bind(name_gen2, "blocks")); 3.95 - task->add_output(high_blocks, tr("pair.out.High_blocks")); 3.96 - // 3.97 - ViewFileOutput* high_html = new ViewFileOutput("--high-blocks-html", 3.98 - &FileOutput::unique_name, 3.99 - "application/octet-stream", 3.100 - "text/html"); 3.101 - high_html->set_suggested_gen(boost::bind(name_gen2, "html")); 3.102 - task->add_output(high_html, tr("pair.out.High_html")); 3.103 - // 3.104 - PrintFileOutput* execution_log = new PrintFileOutput("&>"); 3.105 + ViewFileOutput* execution_log = new ViewFileOutput("2>"); 3.106 execution_log->set_suggested_gen(boost::bind(name_gen2, "log")); 3.107 - execution_log->set_selectable(false); 3.108 task->add_output(execution_log, tr("pair.out.Log")); 3.109 // 3.110 - task->set_runner(new ForkingRunner("pair-cores --no-read-local")); 3.111 + PrintFileOutput* result = new PrintFileOutput("| sed \"s@^@<br/>@\" >"); 3.112 + result->set_suggested_gen(boost::bind(name_gen2, "out")); 3.113 + result->set_selectable(false); 3.114 + task->add_output(result, tr("pair.out.Result")); 3.115 + // 3.116 + task->set_runner(new ForkingRunner("compare-aln-3d")); 3.117 task->set_queue(&queue); 3.118 new TaskCountup(task, root()); 3.119 // 3.120 new WBreak(root()); 3.121 new Wt::WTemplate(tr("pair.main.Example"), root()); 3.122 - new Wt::WTemplate(tr("pair.main.Example_fasta"), root()); 3.123 + new Wt::WTemplate(tr("pair.main.Example_fasta_compare"), root()); 3.124 new Wt::WTemplate(tr("pair.main.Rfbr"), root()); 3.125 } 3.126