{"action":"created","issue":{"url":"https://api.github.com/repos/vishnubob/ssw/issues/4","repository_url":"https://api.github.com/repos/vishnubob/ssw","labels_url":"https://api.github.com/repos/vishnubob/ssw/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/vishnubob/ssw/issues/4/comments","events_url":"https://api.github.com/repos/vishnubob/ssw/issues/4/events","html_url":"https://github.com/vishnubob/ssw/issues/4","id":130789657,"number":4,"title":"Speed enhancement","user":{"login":"ksahlin","id":1714667,"avatar_url":"https://avatars.githubusercontent.com/u/1714667?v=3","gravatar_id":"","url":"https://api.github.com/users/ksahlin","html_url":"https://github.com/ksahlin","followers_url":"https://api.github.com/users/ksahlin/followers","following_url":"https://api.github.com/users/ksahlin/following{/other_user}","gists_url":"https://api.github.com/users/ksahlin/gists{/gist_id}","starred_url":"https://api.github.com/users/ksahlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksahlin/subscriptions","organizations_url":"https://api.github.com/users/ksahlin/orgs","repos_url":"https://api.github.com/users/ksahlin/repos","events_url":"https://api.github.com/users/ksahlin/events{/privacy}","received_events_url":"https://api.github.com/users/ksahlin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vishnubob/ssw/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-02-02T19:26:40Z","updated_at":"2016-09-16T22:50:25Z","closed_at":null,"body":"Hi again,\r\n\r\nI'm currently calculating lots of align instances with your library. I did some profiling of my code and noticed that there might be room for speed improvement without significant rewriting. When I studied the profiling stats (attached below), it seems like the alignment parser `sswobj.py:149(alignment)` and converting sequences to ints `convert_sequence_to_ints` pretty much takes up all the overhead time. \r\n\r\n* My intuition tells me that at least the speed of the `alignment` function can be greatly reduced e.g. by omitting `sswobj.py:153(getseq)` completely --- maybe r_seq and q_seq can be made strings immediately and operated on?\r\n* Maybe also some of the `.upper()` calls can be skipped or be made once for an entire string? I see that there are a huge amount of calls to `upper()` for my instance 309373840, for only 88409 calls to align. Maybe .upper() can be called once on a entire string?\r\n* I have no idea for now to why `convert_sequence_to_ints` takes the time it does, but my intuition tells me that the time spent in it can be improved :)\r\n\r\nI will eventually look into this myself, but thought I should let you know --- maybe you have some quick insights?\r\n\r\n\r\n\r\n```\r\n   Ordered by: cumulative time\r\n\r\n   ncalls  tottime  percall  cumtime  percall filename:lineno(function)\r\n      2/1    0.097    0.048  491.491  491.491 runHIT:30(<module>)\r\n        1    0.040    0.040  490.521  490.521 runHIT:74(get_alignment_information)\r\n        1    2.234    2.234  480.330  480.330 transcript_module.py:155(get_alignments_from_SW)\r\n    88409    0.418    0.000  285.299    0.003 sswobj.py:90(align)\r\n    88410  168.563    0.002  284.786    0.003 sswobj.py:107(_align)\r\n    88412   52.584    0.001  158.666    0.002 sswobj.py:149(alignment)\r\n   176820   54.718    0.000  113.293    0.001 sswobj.py:61(convert_sequence_to_ints)\r\n  4601464   28.244    0.000   76.336    0.000 sswobj.py:153(getseq)\r\n156490544   45.569    0.000   58.548    0.000 sswobj.py:63(<genexpr>)\r\n160414072   35.748    0.000   48.092    0.000 sswobj.py:154(<genexpr>)\r\n    88409    0.499    0.000   33.352    0.000 collections.py:441(__init__)\r\n    88409   26.037    0.000   32.853    0.000 collections.py:504(update)\r\n309373840   25.654    0.000   25.654    0.000 {method 'upper' of 'str' objects}\r\n155812906   12.345    0.000   12.348    0.000 {next}\r\n  3126588    7.235    0.000   10.923    0.000 sswobj.py:131(iter_cigar)\r\n.....\r\n```"},"comment":{"url":"https://api.github.com/repos/vishnubob/ssw/issues/comments/247726684","html_url":"https://github.com/vishnubob/ssw/issues/4#issuecomment-247726684","issue_url":"https://api.github.com/repos/vishnubob/ssw/issues/4","id":247726684,"user":{"login":"ksahlin","id":1714667,"avatar_url":"https://avatars.githubusercontent.com/u/1714667?v=3","gravatar_id":"","url":"https://api.github.com/users/ksahlin","html_url":"https://github.com/ksahlin","followers_url":"https://api.github.com/users/ksahlin/followers","following_url":"https://api.github.com/users/ksahlin/following{/other_user}","gists_url":"https://api.github.com/users/ksahlin/gists{/gist_id}","starred_url":"https://api.github.com/users/ksahlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksahlin/subscriptions","organizations_url":"https://api.github.com/users/ksahlin/orgs","repos_url":"https://api.github.com/users/ksahlin/repos","events_url":"https://api.github.com/users/ksahlin/events{/privacy}","received_events_url":"https://api.github.com/users/ksahlin/received_events","type":"User","site_admin":false},"created_at":"2016-09-16T22:50:24Z","updated_at":"2016-09-16T22:50:24Z","body":"@Chris7 Ok! Done in https://github.com/vishnubob/ssw/pull/5"}}
{"actor":{"display_login":"ksahlin"}}