{"action":"opened","issue":{"url":"https://api.github.com/repos/CGATOxford/UMI-tools/issues/11","labels_url":"https://api.github.com/repos/CGATOxford/UMI-tools/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/CGATOxford/UMI-tools/issues/11/comments","events_url":"https://api.github.com/repos/CGATOxford/UMI-tools/issues/11/events","html_url":"https://github.com/CGATOxford/UMI-tools/issues/11","id":125424976,"number":11,"title":"Deducing read position","user":{"login":"IanSudbery","id":5391758,"avatar_url":"https://avatars.githubusercontent.com/u/5391758?v=3","gravatar_id":"","url":"https://api.github.com/users/IanSudbery","html_url":"https://github.com/IanSudbery","followers_url":"https://api.github.com/users/IanSudbery/followers","following_url":"https://api.github.com/users/IanSudbery/following{/other_user}","gists_url":"https://api.github.com/users/IanSudbery/gists{/gist_id}","starred_url":"https://api.github.com/users/IanSudbery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanSudbery/subscriptions","organizations_url":"https://api.github.com/users/IanSudbery/orgs","repos_url":"https://api.github.com/users/IanSudbery/repos","events_url":"https://api.github.com/users/IanSudbery/events{/privacy}","received_events_url":"https://api.github.com/users/IanSudbery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-07T16:13:57Z","updated_at":"2016-01-07T16:13:57Z","closed_at":null,"body":"There is a section of the code that tries to deduce the position of the read, taking into account any soft_clipping. It looks like this:\r\n\r\n```python\r\n           if read.is_reverse:\r\n                pos = read.aend\r\n                if read.cigar[-1][0] == 4:\r\n                    pos = pos + read.cigar[-1][1]\r\n                start = read.pos\r\n\r\n                if ('N' in read.cigarstring or\r\n                    (read.cigar[0][0] == 4 and\r\n                     read.cigar[0][1] > soft_clip_threshold)):\r\n                    is_spliced = True\r\n            else:\r\n                pos = read.pos\r\n                if read.cigar[0][0] == 4:\r\n                    pos = pos - read.cigar[0][1]\r\n                start = pos\r\n\r\n                if ('N' in read.cigarstring or\r\n                    (read.cigar[-1][0] == 4 and\r\n                     read.cigar[-1][1] > soft_clip_threshold)):\r\n                    is_spliced = True\r\n\r\n```\r\n\r\nNote that if the read is reversed, then it takes aend, finds how many bases are add for softclipping.... and then forgets all that and uses read.pos. \r\n\r\nWhere if the read is not reversed then it does use the clipping. \r\n\r\nAny ideas why this might be? It goes right back to the initial commit. I'm sure there is a reason for it, but I can't for the life of me figure out what it might be. "}}