{"action":"opened","issue":{"url":"https://api.github.com/repos/davidaknowles/leafcutter/issues/2","repository_url":"https://api.github.com/repos/davidaknowles/leafcutter","labels_url":"https://api.github.com/repos/davidaknowles/leafcutter/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/davidaknowles/leafcutter/issues/2/comments","events_url":"https://api.github.com/repos/davidaknowles/leafcutter/issues/2/events","html_url":"https://github.com/davidaknowles/leafcutter/issues/2","id":145005424,"number":2,"title":"Possible bug in clustering approach","user":{"login":"birndle","id":7928926,"avatar_url":"https://avatars.githubusercontent.com/u/7928926?v=3","gravatar_id":"","url":"https://api.github.com/users/birndle","html_url":"https://github.com/birndle","followers_url":"https://api.github.com/users/birndle/followers","following_url":"https://api.github.com/users/birndle/following{/other_user}","gists_url":"https://api.github.com/users/birndle/gists{/gist_id}","starred_url":"https://api.github.com/users/birndle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birndle/subscriptions","organizations_url":"https://api.github.com/users/birndle/orgs","repos_url":"https://api.github.com/users/birndle/repos","events_url":"https://api.github.com/users/birndle/events{/privacy}","received_events_url":"https://api.github.com/users/birndle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-31T20:13:49Z","updated_at":"2016-03-31T20:13:49Z","closed_at":null,"body":"Hello,\r\n\r\nAfter reading through the leafcutter_cluster.py code, I've noticed that there may be edge cases where introns are not clustered properly. Specifically, I mean that some of the final clusters (after the refine_clusters step has been run) may not actually form well-connected graphs as described in the paper.\r\n\r\nFor example, suppose you have three overlapping introns with coordinates (1, 10), (5, 10), and (5, 20), with respective read counts of 10, 5, 10. Cluster_intervals will group these introns together since they overlap. Then, refine_linked will connect this cluster of overlapping introns into a graph since (1, 10) and (5,10) share an edge and (5,10) and (5, 20) also share an edge. \r\n\r\nHowever, during the refine_cluster step, the (5, 10) intron will be purged since it has a read count < 10. Then you are left with two introns: (1, 10) and (5, 20). These will be re-clustered together at line 367 since they still overlap. Refine_cluster will proceed to then return this cluster to the parent function refine_clusters where it will be written to output as a \"refined cluster\". However, **despite overlapping, these two introns do not share an acceptor or a donor site** and thus shouldn't form a \"refined_cluster\". \r\n\r\nI believe this behavior is inconsistent with the description of the method in the paper. But, please let me know if I am misinterpreting something. Hope this is helpful.\r\n\r\nRegards,\r\nDan\r\n\r\n"}}