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

oncoprint - allow adding gaps to string-valued clinical tracks #2926

Merged
merged 3 commits into from
Feb 18, 2020

Conversation

adamabeshouse
Copy link
Contributor

@adamabeshouse adamabeshouse commented Dec 11, 2019

@jjgao jjgao temporarily deployed to cbioportal-f-gaps-9195xmltssbi December 11, 2019 22:31 Inactive
@jjgao jjgao temporarily deployed to cbioportal-f-gaps-ikexbpaukirv December 11, 2019 22:57 Inactive
@jjgao
Copy link
Member

jjgao commented Dec 12, 2019

Nice! Could you connect the issue and use closing keywords in the comment.

@jjgao
Copy link
Member

jjgao commented Dec 12, 2019

For this query, if you sort by Sex and then Show gaps, the gap is not in the right place.

image

@adamabeshouse
Copy link
Contributor Author

@jjgao fixed the issue.

It was an interesting bug: I determine the position of each column in the shader, part of this is a binary search which checks the list of gap locations to figure out how many gaps are before a column.

Here's where it gets tricky - the shader language does not allow while loops. So instead I was using a for loop and estimating the number of loops I would need, at maximum, to fully execute the binary search. I made an error there and so the binary search was terminating too early in this case and not computing the right offset.

I fixed it by rewriting the for loop like this for (int i=0; i<1/0; i++) to simulate a while loop (I was surprised that this is allowed).

@jjgao jjgao temporarily deployed to cbioportal-f-gaps-ikexbpaukirv December 13, 2019 16:08 Inactive
@Sjoerd-van-Hagen
Copy link

Sjoerd-van-Hagen commented Dec 13, 2019

@adamabeshouse

I fixed it by rewriting the for loop like this for (int i=0; i<1/0; i++) to simulate a while loop (I was surprised that this is allowed).

In most languages for is just syntactic sugar for while

for ( int i = 0; i < n; i++ )
  //do stuff`

equals

int i = 0
while i < n
  //do stuff
  i++

So any while-true-loop can be written as
for (; true ;)

I am wondering about the i<1/0, is it not easier to just put true or 1<2 to make it more obvious what your intention is? What do you get from the 1/0, I am guessing some infinity value, and not a division by zero error?

@adamabeshouse
Copy link
Contributor Author

adamabeshouse commented Dec 13, 2019

@Sjoerd-van-Hagen the issue is that webgl shader language has very specific rules, including that true and 1<2 are not valid conditions for a for loop. however, i<1/0 is. it can also be done as for(int i=0; i==0; i+=0), but I don't think thats more clear than for(int i=0; i<1/0; i++). yes 1/0 is infinity

@jjgao jjgao temporarily deployed to cbioportal-f-gaps-ikexbpaukirv January 17, 2020 21:27 Inactive
@adamabeshouse adamabeshouse changed the title oncoprint - allow adding gaps to string-valued clinical tracks needs product review [oncoprint - allow adding gaps to string-valued clinical tracks] Feb 7, 2020
@adamabeshouse adamabeshouse added this to the Sprint 6 Y2020 milestone Feb 7, 2020
@adamabeshouse adamabeshouse changed the title needs product review [oncoprint - allow adding gaps to string-valued clinical tracks] oncoprint - allow adding gaps to string-valued clinical tracks Feb 7, 2020
@inodb inodb modified the milestones: Sprint 6 Y2020, Sprint 7 Y2020 Feb 11, 2020
Abeshouse, Adam A./Sloan Kettering Institute added 3 commits February 18, 2020 14:49
Signed-off-by: Abeshouse, Adam A./Sloan Kettering Institute <[email protected]>
Signed-off-by: Abeshouse, Adam A./Sloan Kettering Institute <[email protected]>
Signed-off-by: Abeshouse, Adam A./Sloan Kettering Institute <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option to add gaps between different groups based on clinical attribute
5 participants