{"action":"created","comment":{"url":"https://api.github.com/repos/molgenis/ngs-utils/pulls/comments/33777420","id":33777420,"diff_hunk":"@@ -0,0 +1,77 @@\n+#!/usr/bin/perl -w\n+use strict;\n+use warnings;\n+use diagnostics;\n+use Getopt::Long;\n+use List::Util qw(first);\n+use POSIX;\n+\n+my ($help, $inputbed, $output, $outputfolder);\n+\n+#### get options\n+GetOptions(\n+                \"h\"                             => \\$help,\n+                \"input=s\"                       => \\$inputbed,\n+                \"output=s\"                      => \\$output,\n+\t\t\"outputfolder=s\"                => \\$outputfolder,\n+          );\n+usage() and exit(1) if $help;\n+# mandatory args\n+usage() and exit(1) unless $inputbed;\n+usage() and exit(1) unless $output;\n+usage() and exit(1) unless $outputfolder;\n+\n+chomp $inputbed;\n+chomp $output;\n+chomp $outputfolder;\n+\n+\n+#Open input and output files\n+open (INPUT, \"<\", $inputbed ) or die $!;\n+\n+#Read bed file\n+my $number=0;\n+my $regnum = 1;\n+my $binSize= 1;\n+while (my $lines=<INPUT>){\n+        chomp $lines;\n+        if ($lines !~ m/^track.+/gs) {\n+                #print $lines . \"\\n\";\n+                #Remove chr before chrNumber and substitute M with MT\n+                $lines =~ s/^chr//gs;\n+                $lines =~ s/^M/MT/gs;\n+                #Split line\n+                my @array = split(\"\\t\", $lines);\n+                my $chr = $array[0];\n+                my $start = $array[1];\n+                my $stop = $array[2];\n+                my $strand = $array[3];\n+\t\tmy $gene = $array[4];\n+                my $region = ($stop-$start);\n+                #Iterate over region and create bins\n+\t\topen (OUTPUT, \">>\", \"$outputfolder/$output.per_base.bed\" ) or die $!;\n+                for (my $i=($start-1); $i<$stop; $i=($i+$binSize)){\n+                    print OUTPUT \"$chr\\t\" . $i . \"\\t\" . ($i+1) . \"\\t$strand\\t$gene\\n\";\n+                }\n+                close(OUTPUT);\n+\n+                $regnum++; \n+        }else{\n+                #Negative check\n+                #print \"$lines\\n\";\n+        }\n+}\n+sub usage {\n+        print <<EOF;\n+#########################################################################################\n+This script splits a bed file in regions of a length specified by the user.\n+#########################################################################################\n+Usage: ./create_per_base_intervals.pl\n+\\t-input                    Input bed file.\n+\\t-output                   Output prefix\n+\\t-outputfolder\t\t    Outputfolder\t","path":"scripts/create_per_base_intervals.pl","position":72,"original_position":72,"commit_id":"87f1aeb25f742383e1c1e62d28d5ceed887e78c0","original_commit_id":"b886c0d2e420873700115f7b026ae6f05083dc0a","user":{"login":"pneerincx","id":1872368,"avatar_url":"https://avatars.githubusercontent.com/u/1872368?v=3","gravatar_id":"","url":"https://api.github.com/users/pneerincx","html_url":"https://github.com/pneerincx","followers_url":"https://api.github.com/users/pneerincx/followers","following_url":"https://api.github.com/users/pneerincx/following{/other_user}","gists_url":"https://api.github.com/users/pneerincx/gists{/gist_id}","starred_url":"https://api.github.com/users/pneerincx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pneerincx/subscriptions","organizations_url":"https://api.github.com/users/pneerincx/orgs","repos_url":"https://api.github.com/users/pneerincx/repos","events_url":"https://api.github.com/users/pneerincx/events{/privacy}","received_events_url":"https://api.github.com/users/pneerincx/received_events","type":"User","site_admin":false},"body":"Looks like there is a mix of spaces and tabs for example in the commandline help. Please choose either one or the other.","created_at":"2015-07-02T13:33:32Z","updated_at":"2015-07-02T13:33:33Z","html_url":"https://github.com/molgenis/ngs-utils/pull/32#discussion_r33777420","pull_request_url":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/molgenis/ngs-utils/pulls/comments/33777420"},"html":{"href":"https://github.com/molgenis/ngs-utils/pull/32#discussion_r33777420"},"pull_request":{"href":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32","id":39080646,"html_url":"https://github.com/molgenis/ngs-utils/pull/32","diff_url":"https://github.com/molgenis/ngs-utils/pull/32.diff","patch_url":"https://github.com/molgenis/ngs-utils/pull/32.patch","issue_url":"https://api.github.com/repos/molgenis/ngs-utils/issues/32","number":32,"state":"open","locked":false,"title":"added scripts needed or used for pipeline 2.1.1","user":{"login":"RoanKanninga","id":1763752,"avatar_url":"https://avatars.githubusercontent.com/u/1763752?v=3","gravatar_id":"","url":"https://api.github.com/users/RoanKanninga","html_url":"https://github.com/RoanKanninga","followers_url":"https://api.github.com/users/RoanKanninga/followers","following_url":"https://api.github.com/users/RoanKanninga/following{/other_user}","gists_url":"https://api.github.com/users/RoanKanninga/gists{/gist_id}","starred_url":"https://api.github.com/users/RoanKanninga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoanKanninga/subscriptions","organizations_url":"https://api.github.com/users/RoanKanninga/orgs","repos_url":"https://api.github.com/users/RoanKanninga/repos","events_url":"https://api.github.com/users/RoanKanninga/events{/privacy}","received_events_url":"https://api.github.com/users/RoanKanninga/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-02T13:11:27Z","updated_at":"2015-07-02T13:33:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3d5ed455a12521efd8c9540e8b825e47cc9d6b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32/commits","review_comments_url":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32/comments","review_comment_url":"https://api.github.com/repos/molgenis/ngs-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/molgenis/ngs-utils/issues/32/comments","statuses_url":"https://api.github.com/repos/molgenis/ngs-utils/statuses/87f1aeb25f742383e1c1e62d28d5ceed887e78c0","head":{"label":"RoanKanninga:master","ref":"master","sha":"87f1aeb25f742383e1c1e62d28d5ceed887e78c0","user":{"login":"RoanKanninga","id":1763752,"avatar_url":"https://avatars.githubusercontent.com/u/1763752?v=3","gravatar_id":"","url":"https://api.github.com/users/RoanKanninga","html_url":"https://github.com/RoanKanninga","followers_url":"https://api.github.com/users/RoanKanninga/followers","following_url":"https://api.github.com/users/RoanKanninga/following{/other_user}","gists_url":"https://api.github.com/users/RoanKanninga/gists{/gist_id}","starred_url":"https://api.github.com/users/RoanKanninga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoanKanninga/subscriptions","organizations_url":"https://api.github.com/users/RoanKanninga/orgs","repos_url":"https://api.github.com/users/RoanKanninga/repos","events_url":"https://api.github.com/users/RoanKanninga/events{/privacy}","received_events_url":"https://api.github.com/users/RoanKanninga/received_events","type":"User","site_admin":false},"repo":{"id":20251476,"name":"ngs-utils","full_name":"RoanKanninga/ngs-utils","owner":{"login":"RoanKanninga","id":1763752,"avatar_url":"https://avatars.githubusercontent.com/u/1763752?v=3","gravatar_id":"","url":"https://api.github.com/users/RoanKanninga","html_url":"https://github.com/RoanKanninga","followers_url":"https://api.github.com/users/RoanKanninga/followers","following_url":"https://api.github.com/users/RoanKanninga/following{/other_user}","gists_url":"https://api.github.com/users/RoanKanninga/gists{/gist_id}","starred_url":"https://api.github.com/users/RoanKanninga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoanKanninga/subscriptions","organizations_url":"https://api.github.com/users/RoanKanninga/orgs","repos_url":"https://api.github.com/users/RoanKanninga/repos","events_url":"https://api.github.com/users/RoanKanninga/events{/privacy}","received_events_url":"https://api.github.com/users/RoanKanninga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RoanKanninga/ngs-utils","description":"Collection of notes and scripts related to NGS","fork":true,"url":"https://api.github.com/repos/RoanKanninga/ngs-utils","forks_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/forks","keys_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/teams","hooks_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/hooks","issue_events_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/issues/events{/number}","events_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/events","assignees_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/assignees{/user}","branches_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/branches{/branch}","tags_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/tags","blobs_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/languages","stargazers_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/stargazers","contributors_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/contributors","subscribers_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/subscribers","subscription_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/subscription","commits_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/contents/{+path}","compare_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/merges","archive_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/downloads","issues_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/issues{/number}","pulls_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/labels{/name}","releases_url":"https://api.github.com/repos/RoanKanninga/ngs-utils/releases{/id}","created_at":"2014-05-28T09:08:22Z","updated_at":"2015-03-17T16:17:34Z","pushed_at":"2015-07-02T13:22:13Z","git_url":"git://github.com/RoanKanninga/ngs-utils.git","ssh_url":"git@github.com:RoanKanninga/ngs-utils.git","clone_url":"https://github.com/RoanKanninga/ngs-utils.git","svn_url":"https://github.com/RoanKanninga/ngs-utils","homepage":null,"size":26482,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"molgenis:master","ref":"master","sha":"750554354bd26e26e06b363e82c9c98039e02c57","user":{"login":"molgenis","id":1688158,"avatar_url":"https://avatars.githubusercontent.com/u/1688158?v=3","gravatar_id":"","url":"https://api.github.com/users/molgenis","html_url":"https://github.com/molgenis","followers_url":"https://api.github.com/users/molgenis/followers","following_url":"https://api.github.com/users/molgenis/following{/other_user}","gists_url":"https://api.github.com/users/molgenis/gists{/gist_id}","starred_url":"https://api.github.com/users/molgenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molgenis/subscriptions","organizations_url":"https://api.github.com/users/molgenis/orgs","repos_url":"https://api.github.com/users/molgenis/repos","events_url":"https://api.github.com/users/molgenis/events{/privacy}","received_events_url":"https://api.github.com/users/molgenis/received_events","type":"Organization","site_admin":false},"repo":{"id":20060071,"name":"ngs-utils","full_name":"molgenis/ngs-utils","owner":{"login":"molgenis","id":1688158,"avatar_url":"https://avatars.githubusercontent.com/u/1688158?v=3","gravatar_id":"","url":"https://api.github.com/users/molgenis","html_url":"https://github.com/molgenis","followers_url":"https://api.github.com/users/molgenis/followers","following_url":"https://api.github.com/users/molgenis/following{/other_user}","gists_url":"https://api.github.com/users/molgenis/gists{/gist_id}","starred_url":"https://api.github.com/users/molgenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molgenis/subscriptions","organizations_url":"https://api.github.com/users/molgenis/orgs","repos_url":"https://api.github.com/users/molgenis/repos","events_url":"https://api.github.com/users/molgenis/events{/privacy}","received_events_url":"https://api.github.com/users/molgenis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/molgenis/ngs-utils","description":"Collection of notes and scripts related to NGS","fork":false,"url":"https://api.github.com/repos/molgenis/ngs-utils","forks_url":"https://api.github.com/repos/molgenis/ngs-utils/forks","keys_url":"https://api.github.com/repos/molgenis/ngs-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/molgenis/ngs-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/molgenis/ngs-utils/teams","hooks_url":"https://api.github.com/repos/molgenis/ngs-utils/hooks","issue_events_url":"https://api.github.com/repos/molgenis/ngs-utils/issues/events{/number}","events_url":"https://api.github.com/repos/molgenis/ngs-utils/events","assignees_url":"https://api.github.com/repos/molgenis/ngs-utils/assignees{/user}","branches_url":"https://api.github.com/repos/molgenis/ngs-utils/branches{/branch}","tags_url":"https://api.github.com/repos/molgenis/ngs-utils/tags","blobs_url":"https://api.github.com/repos/molgenis/ngs-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/molgenis/ngs-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/molgenis/ngs-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/molgenis/ngs-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/molgenis/ngs-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/molgenis/ngs-utils/languages","stargazers_url":"https://api.github.com/repos/molgenis/ngs-utils/stargazers","contributors_url":"https://api.github.com/repos/molgenis/ngs-utils/contributors","subscribers_url":"https://api.github.com/repos/molgenis/ngs-utils/subscribers","subscription_url":"https://api.github.com/repos/molgenis/ngs-utils/subscription","commits_url":"https://api.github.com/repos/molgenis/ngs-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/molgenis/ngs-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/molgenis/ngs-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/molgenis/ngs-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/molgenis/ngs-utils/contents/{+path}","compare_url":"https://api.github.com/repos/molgenis/ngs-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/molgenis/ngs-utils/merges","archive_url":"https://api.github.com/repos/molgenis/ngs-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/molgenis/ngs-utils/downloads","issues_url":"https://api.github.com/repos/molgenis/ngs-utils/issues{/number}","pulls_url":"https://api.github.com/repos/molgenis/ngs-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/molgenis/ngs-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/molgenis/ngs-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/molgenis/ngs-utils/labels{/name}","releases_url":"https://api.github.com/repos/molgenis/ngs-utils/releases{/id}","created_at":"2014-05-22T12:26:38Z","updated_at":"2015-03-17T18:15:51Z","pushed_at":"2015-07-02T13:22:14Z","git_url":"git://github.com/molgenis/ngs-utils.git","ssh_url":"git@github.com:molgenis/ngs-utils.git","clone_url":"https://github.com/molgenis/ngs-utils.git","svn_url":"https://github.com/molgenis/ngs-utils","homepage":null,"size":27234,"stargazers_count":1,"watchers_count":1,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":2,"forks":9,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32"},"html":{"href":"https://github.com/molgenis/ngs-utils/pull/32"},"issue":{"href":"https://api.github.com/repos/molgenis/ngs-utils/issues/32"},"comments":{"href":"https://api.github.com/repos/molgenis/ngs-utils/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/molgenis/ngs-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/molgenis/ngs-utils/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/molgenis/ngs-utils/statuses/87f1aeb25f742383e1c1e62d28d5ceed887e78c0"}}}}