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

Interleaved product with a (classifying/kscoring) instance #58

Open
HighCaffeineIntake opened this issue Dec 12, 2022 · 0 comments
Open

Comments

@HighCaffeineIntake
Copy link

Hello again,
since my last raised issue turned out to be me not properly understanding the interleaved product yet, I've since put some more work into it and am now running into a different issue when trying to use the interleaved product.
I added a new instance to the macrostates.gap file from fold-grammars:
instance shape_sub = gra_macrostate ( (alg_shape5 / alg_mfe_subopt) * alg_dotBracket ) ;

I then used gapc to compile it with the following call:
gapc --kbacktrace -i shape_sub macrostate.gap

This only returned a list of warnings:

Warning:
  kscoring choice [answer_macrostate_mfe] h([answer_macrostate_mfe] i) {
                                          ^
Algebras/MFE/alg_mfe_macrostate.gap:867.43: Declared role of algebra choice function h (in algebra alg_mfe_subopt) does not match autodetected role none(n).
Warning:
  left_dangle = ambd(edanglel, BASE with unpaired, noleft_dangle) | cadd_Pr(edanglel, {noleft_dangle | nil(LOC)}) | cadd(edanglelr, {left_dangle | left_unpair
                                                                                      ^------------------------^
Grammars/gra_macrostate.gap:2645.87-112: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  left_dangle = ambd(edanglel, BASE with unpaired, noleft_dangle) | cadd_Pr(edanglel, {noleft_dangle | nil(LOC)}) | cadd(edanglelr, {left_dangle | left_unpair
                                                                                                                                    ^---------------------------^
Grammars/gra_macrostate.gap:2645.133-161: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  multiloop = {mldl   (BASE, BASE with unpaired, ml_comps1,                     BASE) with basepair  |
              ^-^
Grammars/gra_macrostate.gap:2662.15-2670.100: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  noleft_dangle = cadd_Pr_Pr(edangler, {left_dangle | left_unpaired}) | cadd_Pr_Pr_Pr(nodangle, {noleft_dangle | nil(LOC)}) | ambd_Pr(nodangle, BASE with unpa
                                       ^---------------------------^
Grammars/gra_macrostate.gap:2647.40-68: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  noleft_dangle = cadd_Pr_Pr(edangler, {left_dangle | left_unpaired}) | cadd_Pr_Pr_Pr(nodangle, {noleft_dangle | nil(LOC)}) | ambd_Pr(nodangle, BASE with unpa
                                                                                                ^------------------------^
Grammars/gra_macrostate.gap:2647.97-122: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  left_dangle = ambd(edanglel, BASE with unpaired, noleft_dangle) | cadd_Pr(edanglel, {noleft_dangle | nil(LOC)}) | cadd(edanglelr, {left_dangle | left_unpair
                                                                                      ^------------------------^
Grammars/gra_macrostate.gap:2645.87-112: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  left_dangle = ambd(edanglel, BASE with unpaired, noleft_dangle) | cadd_Pr(edanglel, {noleft_dangle | nil(LOC)}) | cadd(edanglelr, {left_dangle | left_unpair
                                                                                                                                    ^---------------------------^
Grammars/gra_macrostate.gap:2645.133-161: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  multiloop = {mldl   (BASE, BASE with unpaired, ml_comps1,                     BASE) with basepair  |
              ^-^
Grammars/gra_macrostate.gap:2662.15-2670.100: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  noleft_dangle = cadd_Pr_Pr(edangler, {left_dangle | left_unpaired}) | cadd_Pr_Pr_Pr(nodangle, {noleft_dangle | nil(LOC)}) | ambd_Pr(nodangle, BASE with unpa
                                       ^---------------------------^
Grammars/gra_macrostate.gap:2647.40-68: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.
Warning:
  noleft_dangle = cadd_Pr_Pr(edangler, {left_dangle | left_unpaired}) | cadd_Pr_Pr_Pr(nodangle, {noleft_dangle | nil(LOC)}) | ambd_Pr(nodangle, BASE with unpa
                                                                                                ^------------------------^
Grammars/gra_macrostate.gap:2647.97-122: Block has an answer list >= n, consider moving this block into an extra NT andapplying choice function to it.

I then used the "addRNAoptions.pl" from /Misc/Applications/ to edit the created out.mf and allow me to filter Outputs using the "-e" command line argument. I used the default mode 0 for this:
perl addRNAoptions.pl /mnt/c/Master/fold-grammars-master/out.mf 0
When trying to use make -f out.mf to create the executeable, following errors were raised:

Including global makefile /usr/share/gapc/config_linux-gnu.mf
echo '#include "out.hh"' > out_main.cc
cat /usr/include/rtlib/generic_main.cc >> out_main.cc
/usr/bin/sed -i 's|gapc::Opts opts;||' out_main.cc
/usr/bin/sed -i 's|\([^_]\)opts\.|\1gapc::Opts::getOpts()->|g' out_main.cc
/usr/bin/sed -i 's|obj.init(opts);|obj.init(\*gapc::Opts::getOpts());|g' out_main.cc
/usr/bin/sed -i 's|#include .rtlib/generic_opts.hh.|#include "Extensions/rnaoptions.hh"|' out_main.cc
/usr/bin/sed -i 's%#include .rtlib/generic_opts.hh.%#include "Extensions/rnaoptions.hh"%' out.hh out.cc
g++  -I/usr/include  -I/usr/include -I/usr/include/ -I/usr/include/rtlib -I/usr/include/librna  -O3  -std=c++17 -D_XOPEN_SOURCE=500 -MMD -MP -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses -DNDEBUG -DBISONNEW   -DWITH_RNAOPTIONS out_main.cc -c -o out_main.o
In file included from out_main.cc:1:
<stdin>:6108:109: error: could not convert ‘0’ from ‘int’ to ‘std::pair<std::pair<Fiber<long unsigned int, unsigned char>, answer_macrostate_mfe>, String>’
<stdin>: In member function ‘void out_buddy::print_subopt(std::ostream&, std::pair<std::pair<Fiber<long unsigned int, unsigned char>, answer_macrostate_mfe>, String>)’:
<stdin>:6163:88: error: conversion from ‘List_Ref<std::pair<std::pair<Fiber<long unsigned int, unsigned char>, answer_macrostate_mfe>, String> >’ to non-scalar type ‘std::pair<std::pair<Fiber<long unsigned int, unsigned char>, answer_macrostate_mfe>, String>’ requested
<stdin>: At global scope:
<stdin>:7877:21: error: ‘template<class Iterator> List_Ref<Fiber<long unsigned int, unsigned char> > out::h_l_l(std::pair<_FIter, _FIter>)’ cannot be overloaded with ‘template<class Iterator> List_Ref<Fiber<long unsigned int, unsigned char> > out::h_l_l(std::pair<_FIter, _FIter>)’
<stdin>:7874:21: note: previous declaration ‘template<class Iterator> List_Ref<Fiber<long unsigned int, unsigned char> > out::h_l_l(std::pair<_FIter, _FIter>)’
<stdin>:7951:35: error: ‘template<class Iterator> List_Ref<answer_macrostate_mfe> out::h_l_r(std::pair<_FIter, _FIter>)’ cannot be overloaded with ‘template<class Iterator> List_Ref<answer_macrostate_mfe> out::h_l_r(std::pair<_FIter, _FIter>)’
<stdin>:7948:35: note: previous declaration ‘template<class Iterator> List_Ref<answer_macrostate_mfe> out::h_l_r(std::pair<_FIter, _FIter>)’
<stdin>: In member function ‘void out::init(const gapc::Opts&)’:
<stdin>:7584:37: error: cannot convert ‘const unsigned int’ to ‘std::pair<std::pair<Fiber<long unsigned int, unsigned char>, answer_macrostate_mfe>, String>’
<stdin>:6108:101: note:   initializing argument 2 of ‘void out_buddy::print_subopt(std::ostream&, std::pair<std::pair<Fiber<long unsigned int, unsigned char>, answer_macrostate_mfe>, String>)’
make: *** [out.mf:52: out_main.o] Error 1

This time I made sure to use the fold-grammars framework instead of the testdata and the product in the instance is a ( classifying / kscoring), so I do hope this will be reproduceable and in some way fixable.
The idea here is to have the instance produce filtered results within the -e specified range and then only have the best result from the k best classes returned through the interleaved product.
The first part of this was tested with a simple lexicographic product using a (classifying * kscoring instance), so this already works within the fold-grammars framework. So now I'm hoping to implement the second part using the Interleaved product.
Any help would be greatly appreciated!

@HighCaffeineIntake HighCaffeineIntake changed the title Interleaved Product with a kscoring / scoring algebra Interleaved product with a (classifying/kscoring) instance Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant