DEIB-GECO / GMQL

GMQL - GenoMetric Query Language
http://www.bioinformatics.deib.polimi.it/geco/
Apache License 2.0
18 stars 11 forks source link

COVER - mathematical expressions with the ALL keyword #18

Closed marcomass closed 7 years ago

marcomass commented 7 years ago

COVER / SUMMIT / FLAT / HISTOGRAM: Support using mathematical expressions with the ALL keyword as accumulation values for COVER [e.g. B = COVER(1, ALL/2) A;] o Implementation: requires changes at all the levels

akaitoua commented 7 years ago

@pp86 is this modification implemented in the compiler?

pp86 commented 7 years ago

@akaitoua sorry, I did notice this question. By the way it is not included in the compiler

pp86 commented 7 years ago

@akaitoua please, let me know exactly what kind of expression is expected by the low level and I will include it in the compiler

pp86 commented 7 years ago

Hello @akaitoua , I need the signature in order to do that.

akaitoua commented 7 years ago

I will provide it tonight

akaitoua commented 7 years ago

@pp86, I did the changes to get a function on the ALL and ANY parameters in COVER. @pp86 please check the new branch named CoverParameters and especially the last commit on the new branch called "Flink executed from compiler" (I mistakenly left an old message for this commit).

pp86 commented 7 years ago

Hello @akaitoua ,

it is not very clear to me. Take for example the case ANY/2. What should I pass to the lower layer?

akaitoua commented 7 years ago

@pp86, This is an example on how to call the DAG. DS1.COVER(CoverFlag.COVER, new N{override val n=2}, new ALL{ override val fun: (Int) => Int = (x)=>x/2}, List(), None )

This is equivalent to : COVER(2,ALL/2) Please check the changes that i introduced on the compiler in the link above.

akaitoua commented 7 years ago

@pp86, if you agree i will merge the branch with the master branch. I tested it and it is working.

marcomass commented 7 years ago

@akaitoua @pp86 Is this ready?

marcomass commented 7 years ago

@akaitoua @pp86 Hi. I think we need to have this implemented as floor(ALL/k) so that when k=2,, with (ALL+1)/k we always have an integer number above or equal ALL/2 (based on ALL is even or odd); do you agree?

pp86 commented 7 years ago

@akaitoua Hello, yes please merge. I forgot to ask before doing the changes XD

akaitoua commented 7 years ago

@pp86, I did the merge and tried to test. The compiler still does not recognise the division.

Error: Operator COVER at line 2: invalid unnamed parameter 2 , ALL / 2

pp86 commented 7 years ago

@akaitoua yes, I did not commit since it was not compiling. I'll do it now. tnx btw!

pp86 commented 7 years ago

@akaitoua Ok, looks like it is working now, thanks for the support again.

pp86 commented 7 years ago

@marcomass about your comment, i made it supports these two kind of expressions:

marcomass commented 7 years ago

@pp86 @akaitoua Ok, thanks. How is it implemented the casting / approximation of the division to the integer value required by the minAcc maxAcc parameters? As floor(ALL/k)?

pp86 commented 7 years ago

@marcomass , yes, it is the floor

marcomass commented 7 years ago

@pp86 @akaitoua Quanto implementato (ALL / k o (ALL + n) /k) è disponibile anche a livello di API? Se si, è documentato?

akaitoua commented 7 years ago

Ok. I will add the documentation.

Sent from my iPhone

On 30 May 2017, at 00:49, marcomass notifications@github.com<mailto:notifications@github.com> wrote:

@pp86https://github.com/pp86 @akaitouahttps://github.com/akaitoua Quanto implementato (ALL / k o (ALL + n) /k) è disponibile anche a livello di API? Se si, è documentato?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/DEIB-GECO/GMQL/issues/18#issuecomment-304740979, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQP_637nXwDfCOcm53CvUbcsvetOicaRks5r-0tugaJpZM4M05mX.

Erlaad commented 7 years ago

issue18.zip Tested and confirmed. See attached query.

marcomass commented 7 years ago

Tested by Stefano P (Erlaad) with the following query: DATA = SELECT(biosample_term_name == "K562" AND experiment_target == "ATF3-human") HG19_ENCODE_NARROW_NOV_2016; MATERIALIZE DATA into data; # Includes 3 samples RESULT = COVER(1,ALL/2) DATA; # Expected result of ALL/2: 1 MATERIALIZE RESULT into res; RESULT2 = COVER(1,(ALL+1)/2) DATA; # Expected result of (ALL+1)/2: 2 MATERIALIZE RESULT2 into res2; RESULT3 = COVER(1,(ALL+11)/2) DATA; # Expected result of (ALL+11)/2: 7 (but max is 3) MATERIALIZE RESULT3 into res3;

RESULT4 = COVER(1,(ALL-1)/2) DATA; # Expected result of (ALL-1)/2: 1 (error) ## unfortunately ALL-k not supported ...

MATERIALIZE RESULT4 into res4;