{"action":"created","comment":{"url":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/comments/119573110","pull_request_review_id":41463204,"id":119573110,"diff_hunk":"@@ -258,108 +275,143 @@\n         Scolumn(metID(i),1) = stoichCoeffList(i);\r\n     else\r\n         warning(['Metabolite ' metaboliteList{i} ' not in model - added to the model']);\r\n+        model = addMetabolite(model,metaboliteList{i},metaboliteList{i});\r\n         Scolumn(end+1,1) = stoichCoeffList(i);\r\n-        model.mets{end+1,1} = metaboliteList{i};\r\n-        newMetsCoefs(end+1) = stoichCoeffList(i);\r\n-        if (isfield(model,'metNames'))      %Prompts to add missing info if desired\r\n-            model.metNames{end+1,1} = regexprep(metaboliteList{i},'(\\[.+\\]) | (\\(.+\\))','') ;\r\n-            warning(['Metabolite name for ' metaboliteList{i} ' set to ' model.metNames{end}]);\r\n-            %             model.metNames(end) = cellstr(input('Enter complete metabolite name, if available:', 's'));\r\n-        end\r\n-        if (isfield(model,'metFormulas'))\r\n-            model.metFormulas{end+1,1} = '';\r\n-            warning(['Metabolite formula for ' metaboliteList{i} ' set to ''''']);\r\n-            %             model.metFormulas(end) = cellstr(input('Enter metabolite chemical formula, if available:', 's'));\r\n-        end\r\n-        if isfield(model,'metChEBIID')\r\n-            model.metChEBIID{end+1,1} = '';\r\n-        end\r\n-        if isfield(model,'metChEBIID')\r\n-            model.metChEBIID{end+1,1} = ''; %changed to match Recon 2 nomenclature\r\n-        end\r\n-        if isfield(model,'metKEGGID')\r\n-            model.metKEGGID{end+1,1} = '';\r\n-        end\r\n-        if isfield(model,'metPubChemID')\r\n-            model.metPubChemID{end+1,1} = '';\r\n-        end\r\n-        if isfield(model,'metInChIString')\r\n-            model.metInChIString{end+1,1} = '';\r\n-        end        \r\n-        if isfield(model,'metCharges')\r\n-            model.metCharges(end+1,1) = 0;\r\n-        end\r\n-        if isfield(model,'metHepatoNetID')\r\n-            model.metHepatoNetID{end+1,1} = ''; %added\r\n-        end\r\n-        if isfield(model,'metEHMNID')\r\n-            model.metEHMNID{end+1,1} = ''; %added\r\n-        end\r\n-        if isfield(model,'metHMDBID')\r\n-            model.metHMDBID{end+1,1} = ''; %added\r\n-        end\r\n     end\r\n end\r\n \r\n-%printLabeledData(model.mets,Scolumn,1);\r\n-\r\n-if isfield(model,'b')\r\n-    model.b = [model.b;zeros(length(model.mets)-length(model.b),1)];\r\n-end\r\n \r\n % if ~oldRxnFlag, model.rxnGeneMat(rxnID,:)=0; end\r\n \r\n-if (isfield(model,'genes'))\r\n-    if (nargin < 11)\r\n-        model = changeGeneAssociation(model,rxnName,grRule);\r\n+if (isfield(model,'genes')) \r\n+    if isempty(parser.Results.systNameList)        \r\n+        model = changeGeneAssociation(model,rxnID,grRule);\r\n     else\r\n-        %fprintf('In addReaction, the class of systNameList is %s',\r\n-        %class(systNameList)); % commented out by Thierry Mondeel\r\n-        if ~isempty(geneNameList) && ~isempty(systNameList)\r\n-        model = changeGeneAssociation(model,rxnName,grRule,geneNameList,systNameList);\r\n-        else\r\n-            model = changeGeneAssociation(model,rxnName,grRule);\r\n-        end\r\n+        model = changeGeneAssociation(model,rxnID,grRule,geneNameList,systNameList);\r\n     end\r\n end\r\n \r\n % Figure out if the new reaction already exists\r\n rxnInModel=false;\r\n+duplicatePos = [];\r\n if (nNewMets > 0) && isempty(find(newMetsCoefs == 0, 1))\r\n-    Stmp = [model.S;sparse(nNewMets,nRxns)];\r\n+    Stmp = model.S;\r","path":"src/reconstruction/refinement/addReaction.m","position":487,"original_position":487,"commit_id":"fd73efa7e471ea6a920fad85de8905765de59b5c","original_commit_id":"fd73efa7e471ea6a920fad85de8905765de59b5c","user":{"login":"laurentheirendt","id":20812112,"avatar_url":"https://avatars3.githubusercontent.com/u/20812112?v=3","gravatar_id":"","url":"https://api.github.com/users/laurentheirendt","html_url":"https://github.com/laurentheirendt","followers_url":"https://api.github.com/users/laurentheirendt/followers","following_url":"https://api.github.com/users/laurentheirendt/following{/other_user}","gists_url":"https://api.github.com/users/laurentheirendt/gists{/gist_id}","starred_url":"https://api.github.com/users/laurentheirendt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurentheirendt/subscriptions","organizations_url":"https://api.github.com/users/laurentheirendt/orgs","repos_url":"https://api.github.com/users/laurentheirendt/repos","events_url":"https://api.github.com/users/laurentheirendt/events{/privacy}","received_events_url":"https://api.github.com/users/laurentheirendt/received_events","type":"User","site_admin":false},"body":"Do we need a special condition for `Stmp = model.S;`? It seems as if `Stmp` is also set  in the `else` block.\r\n\r\nThere is actually no need for this `if` condition.","created_at":"2017-06-01T09:53:47Z","updated_at":"2017-06-01T09:56:06Z","html_url":"https://github.com/opencobra/cobratoolbox/pull/495#discussion_r119573110","pull_request_url":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495","_links":{"self":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/comments/119573110"},"html":{"href":"https://github.com/opencobra/cobratoolbox/pull/495#discussion_r119573110"},"pull_request":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495"}}},"pull_request":{"url":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495","id":123450353,"html_url":"https://github.com/opencobra/cobratoolbox/pull/495","diff_url":"https://github.com/opencobra/cobratoolbox/pull/495.diff","patch_url":"https://github.com/opencobra/cobratoolbox/pull/495.patch","issue_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/495","number":495,"state":"open","locked":false,"title":"Model Creation Tutorial and update to Model Manipulation Tutorial","user":{"login":"tpfau","id":9972778,"avatar_url":"https://avatars0.githubusercontent.com/u/9972778?v=3","gravatar_id":"","url":"https://api.github.com/users/tpfau","html_url":"https://github.com/tpfau","followers_url":"https://api.github.com/users/tpfau/followers","following_url":"https://api.github.com/users/tpfau/following{/other_user}","gists_url":"https://api.github.com/users/tpfau/gists{/gist_id}","starred_url":"https://api.github.com/users/tpfau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpfau/subscriptions","organizations_url":"https://api.github.com/users/tpfau/orgs","repos_url":"https://api.github.com/users/tpfau/repos","events_url":"https://api.github.com/users/tpfau/events{/privacy}","received_events_url":"https://api.github.com/users/tpfau/received_events","type":"User","site_admin":false},"body":"Addition of a model creation tutorial and update to the model manipulation tutorial to reflect changes in addReaction useability along with a set of small fixes to several files wrt rev and field names\r\n\r\n**I hereby confirm that I have:**\r\n\r\n- [X] Tested my code on my own machine\r\n- [X] Followed the guidelines in the [Contributing Guide](https://opencobra.github.io/cobratoolbox/docs/contributing.html)\r\n- [X] Selected `develop` as a target branch (top left drop-down menu)\r\n\r\n*(Note: You may replace [ ] with [X] to check the box)*\r\n","created_at":"2017-06-01T09:05:55Z","updated_at":"2017-06-01T09:56:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"191157c7450038f5b2448a73bf2b3bc4500e0a49","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495/commits","review_comments_url":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495/comments","review_comment_url":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/495/comments","statuses_url":"https://api.github.com/repos/opencobra/cobratoolbox/statuses/fd73efa7e471ea6a920fad85de8905765de59b5c","head":{"label":"tpfau:ReconstructionTutorialUpdate","ref":"ReconstructionTutorialUpdate","sha":"fd73efa7e471ea6a920fad85de8905765de59b5c","user":{"login":"tpfau","id":9972778,"avatar_url":"https://avatars0.githubusercontent.com/u/9972778?v=3","gravatar_id":"","url":"https://api.github.com/users/tpfau","html_url":"https://github.com/tpfau","followers_url":"https://api.github.com/users/tpfau/followers","following_url":"https://api.github.com/users/tpfau/following{/other_user}","gists_url":"https://api.github.com/users/tpfau/gists{/gist_id}","starred_url":"https://api.github.com/users/tpfau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpfau/subscriptions","organizations_url":"https://api.github.com/users/tpfau/orgs","repos_url":"https://api.github.com/users/tpfau/repos","events_url":"https://api.github.com/users/tpfau/events{/privacy}","received_events_url":"https://api.github.com/users/tpfau/received_events","type":"User","site_admin":false},"repo":{"id":28035499,"name":"cobratoolbox","full_name":"tpfau/cobratoolbox","owner":{"login":"tpfau","id":9972778,"avatar_url":"https://avatars0.githubusercontent.com/u/9972778?v=3","gravatar_id":"","url":"https://api.github.com/users/tpfau","html_url":"https://github.com/tpfau","followers_url":"https://api.github.com/users/tpfau/followers","following_url":"https://api.github.com/users/tpfau/following{/other_user}","gists_url":"https://api.github.com/users/tpfau/gists{/gist_id}","starred_url":"https://api.github.com/users/tpfau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpfau/subscriptions","organizations_url":"https://api.github.com/users/tpfau/orgs","repos_url":"https://api.github.com/users/tpfau/repos","events_url":"https://api.github.com/users/tpfau/events{/privacy}","received_events_url":"https://api.github.com/users/tpfau/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tpfau/cobratoolbox","description":"COnstraints Based Reconstruction and Analysis toolbox for MATLAB","fork":true,"url":"https://api.github.com/repos/tpfau/cobratoolbox","forks_url":"https://api.github.com/repos/tpfau/cobratoolbox/forks","keys_url":"https://api.github.com/repos/tpfau/cobratoolbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tpfau/cobratoolbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tpfau/cobratoolbox/teams","hooks_url":"https://api.github.com/repos/tpfau/cobratoolbox/hooks","issue_events_url":"https://api.github.com/repos/tpfau/cobratoolbox/issues/events{/number}","events_url":"https://api.github.com/repos/tpfau/cobratoolbox/events","assignees_url":"https://api.github.com/repos/tpfau/cobratoolbox/assignees{/user}","branches_url":"https://api.github.com/repos/tpfau/cobratoolbox/branches{/branch}","tags_url":"https://api.github.com/repos/tpfau/cobratoolbox/tags","blobs_url":"https://api.github.com/repos/tpfau/cobratoolbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tpfau/cobratoolbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tpfau/cobratoolbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/tpfau/cobratoolbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tpfau/cobratoolbox/statuses/{sha}","languages_url":"https://api.github.com/repos/tpfau/cobratoolbox/languages","stargazers_url":"https://api.github.com/repos/tpfau/cobratoolbox/stargazers","contributors_url":"https://api.github.com/repos/tpfau/cobratoolbox/contributors","subscribers_url":"https://api.github.com/repos/tpfau/cobratoolbox/subscribers","subscription_url":"https://api.github.com/repos/tpfau/cobratoolbox/subscription","commits_url":"https://api.github.com/repos/tpfau/cobratoolbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/tpfau/cobratoolbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/tpfau/cobratoolbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/tpfau/cobratoolbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/tpfau/cobratoolbox/contents/{+path}","compare_url":"https://api.github.com/repos/tpfau/cobratoolbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tpfau/cobratoolbox/merges","archive_url":"https://api.github.com/repos/tpfau/cobratoolbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tpfau/cobratoolbox/downloads","issues_url":"https://api.github.com/repos/tpfau/cobratoolbox/issues{/number}","pulls_url":"https://api.github.com/repos/tpfau/cobratoolbox/pulls{/number}","milestones_url":"https://api.github.com/repos/tpfau/cobratoolbox/milestones{/number}","notifications_url":"https://api.github.com/repos/tpfau/cobratoolbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tpfau/cobratoolbox/labels{/name}","releases_url":"https://api.github.com/repos/tpfau/cobratoolbox/releases{/id}","deployments_url":"https://api.github.com/repos/tpfau/cobratoolbox/deployments","created_at":"2014-12-15T12:21:43Z","updated_at":"2016-01-21T06:29:15Z","pushed_at":"2017-06-01T08:43:16Z","git_url":"git://github.com/tpfau/cobratoolbox.git","ssh_url":"git@github.com:tpfau/cobratoolbox.git","clone_url":"https://github.com/tpfau/cobratoolbox.git","svn_url":"https://github.com/tpfau/cobratoolbox","homepage":"","size":436016,"stargazers_count":0,"watchers_count":0,"language":"Matlab","has_issues":false,"has_projects":true,"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":"opencobra:develop","ref":"develop","sha":"6c21f2508d0f5fd55d2695cd44c2d276e7e9f533","user":{"login":"opencobra","id":2708410,"avatar_url":"https://avatars3.githubusercontent.com/u/2708410?v=3","gravatar_id":"","url":"https://api.github.com/users/opencobra","html_url":"https://github.com/opencobra","followers_url":"https://api.github.com/users/opencobra/followers","following_url":"https://api.github.com/users/opencobra/following{/other_user}","gists_url":"https://api.github.com/users/opencobra/gists{/gist_id}","starred_url":"https://api.github.com/users/opencobra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencobra/subscriptions","organizations_url":"https://api.github.com/users/opencobra/orgs","repos_url":"https://api.github.com/users/opencobra/repos","events_url":"https://api.github.com/users/opencobra/events{/privacy}","received_events_url":"https://api.github.com/users/opencobra/received_events","type":"Organization","site_admin":false},"repo":{"id":6512296,"name":"cobratoolbox","full_name":"opencobra/cobratoolbox","owner":{"login":"opencobra","id":2708410,"avatar_url":"https://avatars3.githubusercontent.com/u/2708410?v=3","gravatar_id":"","url":"https://api.github.com/users/opencobra","html_url":"https://github.com/opencobra","followers_url":"https://api.github.com/users/opencobra/followers","following_url":"https://api.github.com/users/opencobra/following{/other_user}","gists_url":"https://api.github.com/users/opencobra/gists{/gist_id}","starred_url":"https://api.github.com/users/opencobra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencobra/subscriptions","organizations_url":"https://api.github.com/users/opencobra/orgs","repos_url":"https://api.github.com/users/opencobra/repos","events_url":"https://api.github.com/users/opencobra/events{/privacy}","received_events_url":"https://api.github.com/users/opencobra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencobra/cobratoolbox","description":"The COnstraint-Based Reconstruction and Analysis Toolbox","fork":false,"url":"https://api.github.com/repos/opencobra/cobratoolbox","forks_url":"https://api.github.com/repos/opencobra/cobratoolbox/forks","keys_url":"https://api.github.com/repos/opencobra/cobratoolbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencobra/cobratoolbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencobra/cobratoolbox/teams","hooks_url":"https://api.github.com/repos/opencobra/cobratoolbox/hooks","issue_events_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/events{/number}","events_url":"https://api.github.com/repos/opencobra/cobratoolbox/events","assignees_url":"https://api.github.com/repos/opencobra/cobratoolbox/assignees{/user}","branches_url":"https://api.github.com/repos/opencobra/cobratoolbox/branches{/branch}","tags_url":"https://api.github.com/repos/opencobra/cobratoolbox/tags","blobs_url":"https://api.github.com/repos/opencobra/cobratoolbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencobra/cobratoolbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencobra/cobratoolbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencobra/cobratoolbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencobra/cobratoolbox/statuses/{sha}","languages_url":"https://api.github.com/repos/opencobra/cobratoolbox/languages","stargazers_url":"https://api.github.com/repos/opencobra/cobratoolbox/stargazers","contributors_url":"https://api.github.com/repos/opencobra/cobratoolbox/contributors","subscribers_url":"https://api.github.com/repos/opencobra/cobratoolbox/subscribers","subscription_url":"https://api.github.com/repos/opencobra/cobratoolbox/subscription","commits_url":"https://api.github.com/repos/opencobra/cobratoolbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencobra/cobratoolbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencobra/cobratoolbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencobra/cobratoolbox/contents/{+path}","compare_url":"https://api.github.com/repos/opencobra/cobratoolbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencobra/cobratoolbox/merges","archive_url":"https://api.github.com/repos/opencobra/cobratoolbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencobra/cobratoolbox/downloads","issues_url":"https://api.github.com/repos/opencobra/cobratoolbox/issues{/number}","pulls_url":"https://api.github.com/repos/opencobra/cobratoolbox/pulls{/number}","milestones_url":"https://api.github.com/repos/opencobra/cobratoolbox/milestones{/number}","notifications_url":"https://api.github.com/repos/opencobra/cobratoolbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencobra/cobratoolbox/labels{/name}","releases_url":"https://api.github.com/repos/opencobra/cobratoolbox/releases{/id}","deployments_url":"https://api.github.com/repos/opencobra/cobratoolbox/deployments","created_at":"2012-11-02T20:38:05Z","updated_at":"2017-05-24T12:36:17Z","pushed_at":"2017-06-01T09:48:03Z","git_url":"git://github.com/opencobra/cobratoolbox.git","ssh_url":"git@github.com:opencobra/cobratoolbox.git","clone_url":"https://github.com/opencobra/cobratoolbox.git","svn_url":"https://github.com/opencobra/cobratoolbox","homepage":"https://opencobra.github.io/cobratoolbox","size":447445,"stargazers_count":47,"watchers_count":47,"language":"Matlab","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":103,"mirror_url":null,"open_issues_count":40,"forks":103,"open_issues":40,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495"},"html":{"href":"https://github.com/opencobra/cobratoolbox/pull/495"},"issue":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/issues/495"},"comments":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/issues/495/comments"},"review_comments":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495/comments"},"review_comment":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/pulls/495/commits"},"statuses":{"href":"https://api.github.com/repos/opencobra/cobratoolbox/statuses/fd73efa7e471ea6a920fad85de8905765de59b5c"}}}}
{"actor":{"display_login":"laurentheirendt"}}