{"action":"created","comment":{"url":"https://api.github.com/repos/hiclib/pastis/pulls/comments/77980663","id":77980663,"diff_hunk":"@@ -9,6 +16,88 @@\n \n max_iter = 5\n \n+###############################################################################\n+# Python implementation of 'print_pdb_atom' function in coords.cpp\n+\n+def fprintf(fp, fmt, *args):\n+    fp.write(fmt % args)\n+\n+def print_pdb_atom (outfile,\n+                    #chrom_index,\n+                    #copy_index,\n+                    atom_index,\n+                    is_node, # Is this a node or an edge atom\n+                    atom_name, # eg \"N\", \"O\", or \"C\"\n+                    scale_factor,\n+                    my_coords):\n+    # prev_chrom_index = -1\n+    # atom_index\n+    # if chrom_index != prev_chrom_index:\n+    #     atom_index = 1\n+    #     prev_chrom_index = chrom_index\n+\n+    # http://www.biochem.ucl.ac.uk/~roman/procheck/manual/manappb.html\n+    fprintf(outfile, \"ATOM  \")              #  1- 6: Record ID\n+    fprintf(outfile, \"%5d\", atom_index)     #  7-11: Atom serial number\n+    fprintf(outfile, \" \")                   #    12: Blank\n+    # if (is_node) {                        # 13-16: Atom name\n+    #   fprintf(outfile, \"N   \")\n+    # } else {\n+    #   fprintf(outfile, \"O   \")\n+    # }\n+    fprintf(outfile,\"%s   \",atom_name)\n+    fprintf(outfile, \" \")                   # 17-17: Alternative location code\n+    if is_node:                             # 18-20: 3-letter amino acid code\n+        fprintf(outfile, \"NOD\")\n+    else:\n+        fprintf(outfile, \"EDG\")\n+    fprintf(outfile, \" \")                   #    21: Blank\n+    fprintf(outfile, \"%c\",                  #    22: Chain identifier code\n+            # get_chrom_id(chrom_index, copy_index))\n+            'A')\n+    fprintf(outfile, \"    \")                # 23-26: Residue sequence number\n+    fprintf(outfile, \" \")                   #    27: Insertion code\n+    fprintf(outfile, \"   \")                 # 28-30: Blank\n+    fprintf(outfile, \"%8.3f%8.3f%8.3f\",     # 31-54: Atom coordinates\n+            # (my_coords->x + 1.0) * SCALE_FACTOR,\n+            # (my_coords->y + 1.0) * SCALE_FACTOR,\n+            # (my_coords->z + 1.0) * SCALE_FACTOR)\n+            (my_coords[0] + 1.0) * scale_factor,\n+            (my_coords[1] + 1.0) * scale_factor,\n+            (my_coords[2] + 1.0) * scale_factor)\n+    fprintf(outfile, \"%6.2f\", 1.0)          # 55-60: Occupancy value\n+    if is_node:\n+        fprintf(outfile, \"%6.2f\", 50.0)     # 61-66: B-value (thermal factor)\n+    else:\n+        fprintf(outfile, \"%6.2f\", 75.0)     # 61-66: B-value (thermal factor)\n+    fprintf(outfile, \" \")                   #    67: Blank\n+    fprintf(outfile, \"   \")                 # 68-70: Blank\n+    fprintf(outfile, \"\\n\")\n+\n+def writePDB(Xpdb, pdbfilename):\n+    print('PDB file creation!')","path":"pastis/algorithms.py","position":74,"original_position":74,"commit_id":"c81aab33490f3d98fb4c08ea5a53498009b81782","original_commit_id":"c81aab33490f3d98fb4c08ea5a53498009b81782","user":{"login":"NelleV","id":184798,"avatar_url":"https://avatars.githubusercontent.com/u/184798?v=3","gravatar_id":"","url":"https://api.github.com/users/NelleV","html_url":"https://github.com/NelleV","followers_url":"https://api.github.com/users/NelleV/followers","following_url":"https://api.github.com/users/NelleV/following{/other_user}","gists_url":"https://api.github.com/users/NelleV/gists{/gist_id}","starred_url":"https://api.github.com/users/NelleV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NelleV/subscriptions","organizations_url":"https://api.github.com/users/NelleV/orgs","repos_url":"https://api.github.com/users/NelleV/repos","events_url":"https://api.github.com/users/NelleV/events{/privacy}","received_events_url":"https://api.github.com/users/NelleV/received_events","type":"User","site_admin":false},"body":"We should avoid printing by default in functions that may be used outside of the scripts we provide to run the inference. Maybe add a verbose parameter to the function, set by default to 0, and only print when set to 1?","created_at":"2016-09-08T10:22:48Z","updated_at":"2016-09-08T10:22:48Z","html_url":"https://github.com/hiclib/pastis/pull/19#discussion_r77980663","pull_request_url":"https://api.github.com/repos/hiclib/pastis/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/hiclib/pastis/pulls/comments/77980663"},"html":{"href":"https://github.com/hiclib/pastis/pull/19#discussion_r77980663"},"pull_request":{"href":"https://api.github.com/repos/hiclib/pastis/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/hiclib/pastis/pulls/19","id":84344098,"html_url":"https://github.com/hiclib/pastis/pull/19","diff_url":"https://github.com/hiclib/pastis/pull/19.diff","patch_url":"https://github.com/hiclib/pastis/pull/19.patch","issue_url":"https://api.github.com/repos/hiclib/pastis/issues/19","number":19,"state":"open","locked":false,"title":"Output 3D co-ordinates in PDB format as was done by coords.cpp","user":{"login":"gbonora","id":22042857,"avatar_url":"https://avatars.githubusercontent.com/u/22042857?v=3","gravatar_id":"","url":"https://api.github.com/users/gbonora","html_url":"https://github.com/gbonora","followers_url":"https://api.github.com/users/gbonora/followers","following_url":"https://api.github.com/users/gbonora/following{/other_user}","gists_url":"https://api.github.com/users/gbonora/gists{/gist_id}","starred_url":"https://api.github.com/users/gbonora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbonora/subscriptions","organizations_url":"https://api.github.com/users/gbonora/orgs","repos_url":"https://api.github.com/users/gbonora/repos","events_url":"https://api.github.com/users/gbonora/events{/privacy}","received_events_url":"https://api.github.com/users/gbonora/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-07T17:46:09Z","updated_at":"2016-09-08T10:22:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a14ba0a98de70845fec0f6436cbfed9794d5e79","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hiclib/pastis/pulls/19/commits","review_comments_url":"https://api.github.com/repos/hiclib/pastis/pulls/19/comments","review_comment_url":"https://api.github.com/repos/hiclib/pastis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hiclib/pastis/issues/19/comments","statuses_url":"https://api.github.com/repos/hiclib/pastis/statuses/c81aab33490f3d98fb4c08ea5a53498009b81782","head":{"label":"gbonora:PDBoutput","ref":"PDBoutput","sha":"c81aab33490f3d98fb4c08ea5a53498009b81782","user":{"login":"gbonora","id":22042857,"avatar_url":"https://avatars.githubusercontent.com/u/22042857?v=3","gravatar_id":"","url":"https://api.github.com/users/gbonora","html_url":"https://github.com/gbonora","followers_url":"https://api.github.com/users/gbonora/followers","following_url":"https://api.github.com/users/gbonora/following{/other_user}","gists_url":"https://api.github.com/users/gbonora/gists{/gist_id}","starred_url":"https://api.github.com/users/gbonora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbonora/subscriptions","organizations_url":"https://api.github.com/users/gbonora/orgs","repos_url":"https://api.github.com/users/gbonora/repos","events_url":"https://api.github.com/users/gbonora/events{/privacy}","received_events_url":"https://api.github.com/users/gbonora/received_events","type":"User","site_admin":false},"repo":{"id":67566957,"name":"pastis","full_name":"gbonora/pastis","owner":{"login":"gbonora","id":22042857,"avatar_url":"https://avatars.githubusercontent.com/u/22042857?v=3","gravatar_id":"","url":"https://api.github.com/users/gbonora","html_url":"https://github.com/gbonora","followers_url":"https://api.github.com/users/gbonora/followers","following_url":"https://api.github.com/users/gbonora/following{/other_user}","gists_url":"https://api.github.com/users/gbonora/gists{/gist_id}","starred_url":"https://api.github.com/users/gbonora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbonora/subscriptions","organizations_url":"https://api.github.com/users/gbonora/orgs","repos_url":"https://api.github.com/users/gbonora/repos","events_url":"https://api.github.com/users/gbonora/events{/privacy}","received_events_url":"https://api.github.com/users/gbonora/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gbonora/pastis","description":"Poisson-based algorithm for stable inference of DNA Structure","fork":true,"url":"https://api.github.com/repos/gbonora/pastis","forks_url":"https://api.github.com/repos/gbonora/pastis/forks","keys_url":"https://api.github.com/repos/gbonora/pastis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gbonora/pastis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gbonora/pastis/teams","hooks_url":"https://api.github.com/repos/gbonora/pastis/hooks","issue_events_url":"https://api.github.com/repos/gbonora/pastis/issues/events{/number}","events_url":"https://api.github.com/repos/gbonora/pastis/events","assignees_url":"https://api.github.com/repos/gbonora/pastis/assignees{/user}","branches_url":"https://api.github.com/repos/gbonora/pastis/branches{/branch}","tags_url":"https://api.github.com/repos/gbonora/pastis/tags","blobs_url":"https://api.github.com/repos/gbonora/pastis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gbonora/pastis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gbonora/pastis/git/refs{/sha}","trees_url":"https://api.github.com/repos/gbonora/pastis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gbonora/pastis/statuses/{sha}","languages_url":"https://api.github.com/repos/gbonora/pastis/languages","stargazers_url":"https://api.github.com/repos/gbonora/pastis/stargazers","contributors_url":"https://api.github.com/repos/gbonora/pastis/contributors","subscribers_url":"https://api.github.com/repos/gbonora/pastis/subscribers","subscription_url":"https://api.github.com/repos/gbonora/pastis/subscription","commits_url":"https://api.github.com/repos/gbonora/pastis/commits{/sha}","git_commits_url":"https://api.github.com/repos/gbonora/pastis/git/commits{/sha}","comments_url":"https://api.github.com/repos/gbonora/pastis/comments{/number}","issue_comment_url":"https://api.github.com/repos/gbonora/pastis/issues/comments{/number}","contents_url":"https://api.github.com/repos/gbonora/pastis/contents/{+path}","compare_url":"https://api.github.com/repos/gbonora/pastis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gbonora/pastis/merges","archive_url":"https://api.github.com/repos/gbonora/pastis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gbonora/pastis/downloads","issues_url":"https://api.github.com/repos/gbonora/pastis/issues{/number}","pulls_url":"https://api.github.com/repos/gbonora/pastis/pulls{/number}","milestones_url":"https://api.github.com/repos/gbonora/pastis/milestones{/number}","notifications_url":"https://api.github.com/repos/gbonora/pastis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gbonora/pastis/labels{/name}","releases_url":"https://api.github.com/repos/gbonora/pastis/releases{/id}","deployments_url":"https://api.github.com/repos/gbonora/pastis/deployments","created_at":"2016-09-07T03:01:54Z","updated_at":"2016-09-07T03:01:55Z","pushed_at":"2016-09-07T18:06:12Z","git_url":"git://github.com/gbonora/pastis.git","ssh_url":"git@github.com:gbonora/pastis.git","clone_url":"https://github.com/gbonora/pastis.git","svn_url":"https://github.com/gbonora/pastis","homepage":"cbio.ensmp.fr/pastis","size":546,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"hiclib:master","ref":"master","sha":"1934dd46733336e1d3dcb2291bd5e76eb695c9d0","user":{"login":"hiclib","id":7159186,"avatar_url":"https://avatars.githubusercontent.com/u/7159186?v=3","gravatar_id":"","url":"https://api.github.com/users/hiclib","html_url":"https://github.com/hiclib","followers_url":"https://api.github.com/users/hiclib/followers","following_url":"https://api.github.com/users/hiclib/following{/other_user}","gists_url":"https://api.github.com/users/hiclib/gists{/gist_id}","starred_url":"https://api.github.com/users/hiclib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiclib/subscriptions","organizations_url":"https://api.github.com/users/hiclib/orgs","repos_url":"https://api.github.com/users/hiclib/repos","events_url":"https://api.github.com/users/hiclib/events{/privacy}","received_events_url":"https://api.github.com/users/hiclib/received_events","type":"Organization","site_admin":false},"repo":{"id":18523304,"name":"pastis","full_name":"hiclib/pastis","owner":{"login":"hiclib","id":7159186,"avatar_url":"https://avatars.githubusercontent.com/u/7159186?v=3","gravatar_id":"","url":"https://api.github.com/users/hiclib","html_url":"https://github.com/hiclib","followers_url":"https://api.github.com/users/hiclib/followers","following_url":"https://api.github.com/users/hiclib/following{/other_user}","gists_url":"https://api.github.com/users/hiclib/gists{/gist_id}","starred_url":"https://api.github.com/users/hiclib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiclib/subscriptions","organizations_url":"https://api.github.com/users/hiclib/orgs","repos_url":"https://api.github.com/users/hiclib/repos","events_url":"https://api.github.com/users/hiclib/events{/privacy}","received_events_url":"https://api.github.com/users/hiclib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hiclib/pastis","description":"Poisson-based algorithm for stable inference of DNA Structure","fork":false,"url":"https://api.github.com/repos/hiclib/pastis","forks_url":"https://api.github.com/repos/hiclib/pastis/forks","keys_url":"https://api.github.com/repos/hiclib/pastis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hiclib/pastis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hiclib/pastis/teams","hooks_url":"https://api.github.com/repos/hiclib/pastis/hooks","issue_events_url":"https://api.github.com/repos/hiclib/pastis/issues/events{/number}","events_url":"https://api.github.com/repos/hiclib/pastis/events","assignees_url":"https://api.github.com/repos/hiclib/pastis/assignees{/user}","branches_url":"https://api.github.com/repos/hiclib/pastis/branches{/branch}","tags_url":"https://api.github.com/repos/hiclib/pastis/tags","blobs_url":"https://api.github.com/repos/hiclib/pastis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hiclib/pastis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hiclib/pastis/git/refs{/sha}","trees_url":"https://api.github.com/repos/hiclib/pastis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hiclib/pastis/statuses/{sha}","languages_url":"https://api.github.com/repos/hiclib/pastis/languages","stargazers_url":"https://api.github.com/repos/hiclib/pastis/stargazers","contributors_url":"https://api.github.com/repos/hiclib/pastis/contributors","subscribers_url":"https://api.github.com/repos/hiclib/pastis/subscribers","subscription_url":"https://api.github.com/repos/hiclib/pastis/subscription","commits_url":"https://api.github.com/repos/hiclib/pastis/commits{/sha}","git_commits_url":"https://api.github.com/repos/hiclib/pastis/git/commits{/sha}","comments_url":"https://api.github.com/repos/hiclib/pastis/comments{/number}","issue_comment_url":"https://api.github.com/repos/hiclib/pastis/issues/comments{/number}","contents_url":"https://api.github.com/repos/hiclib/pastis/contents/{+path}","compare_url":"https://api.github.com/repos/hiclib/pastis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hiclib/pastis/merges","archive_url":"https://api.github.com/repos/hiclib/pastis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hiclib/pastis/downloads","issues_url":"https://api.github.com/repos/hiclib/pastis/issues{/number}","pulls_url":"https://api.github.com/repos/hiclib/pastis/pulls{/number}","milestones_url":"https://api.github.com/repos/hiclib/pastis/milestones{/number}","notifications_url":"https://api.github.com/repos/hiclib/pastis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hiclib/pastis/labels{/name}","releases_url":"https://api.github.com/repos/hiclib/pastis/releases{/id}","deployments_url":"https://api.github.com/repos/hiclib/pastis/deployments","created_at":"2014-04-07T15:57:56Z","updated_at":"2015-12-20T17:27:32Z","pushed_at":"2016-09-07T18:06:12Z","git_url":"git://github.com/hiclib/pastis.git","ssh_url":"git@github.com:hiclib/pastis.git","clone_url":"https://github.com/hiclib/pastis.git","svn_url":"https://github.com/hiclib/pastis","homepage":"cbio.ensmp.fr/pastis","size":1023,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hiclib/pastis/pulls/19"},"html":{"href":"https://github.com/hiclib/pastis/pull/19"},"issue":{"href":"https://api.github.com/repos/hiclib/pastis/issues/19"},"comments":{"href":"https://api.github.com/repos/hiclib/pastis/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/hiclib/pastis/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/hiclib/pastis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hiclib/pastis/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/hiclib/pastis/statuses/c81aab33490f3d98fb4c08ea5a53498009b81782"}}}}
{"actor":{"display_login":"NelleV"}}