{"action":"created","issue":{"url":"https://api.github.com/repos/lgatto/MSnbase/issues/81","repository_url":"https://api.github.com/repos/lgatto/MSnbase","labels_url":"https://api.github.com/repos/lgatto/MSnbase/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/lgatto/MSnbase/issues/81/comments","events_url":"https://api.github.com/repos/lgatto/MSnbase/issues/81/events","html_url":"https://github.com/lgatto/MSnbase/issues/81","id":142171786,"number":81,"title":"combine samples in an MSnSet","user":{"login":"pavel-shliaha","id":1895805,"avatar_url":"https://avatars.githubusercontent.com/u/1895805?v=3","gravatar_id":"","url":"https://api.github.com/users/pavel-shliaha","html_url":"https://github.com/pavel-shliaha","followers_url":"https://api.github.com/users/pavel-shliaha/followers","following_url":"https://api.github.com/users/pavel-shliaha/following{/other_user}","gists_url":"https://api.github.com/users/pavel-shliaha/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-shliaha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-shliaha/subscriptions","organizations_url":"https://api.github.com/users/pavel-shliaha/orgs","repos_url":"https://api.github.com/users/pavel-shliaha/repos","events_url":"https://api.github.com/users/pavel-shliaha/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-shliaha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-20T14:58:27Z","updated_at":"2016-03-20T15:22:41Z","closed_at":null,"body":"Working with synapter now I need to use correction of saturation on a combined MSnSet (after several synapter runs have been converted to MSnSet and combined into a single MSnSet).\r\n\r\nThe next step after saturation correction is to merge several replicas, but averageMSnSet works with a list of MSnSets.\r\n\r\nCould you please modify averageMSnSet so that it takes an argument of the numbers of samples (i.e. numbers of columns in exprs(MSnSet), e.g. 1:5), so it can work with an MSnSet that has been combined?  "},"comment":{"url":"https://api.github.com/repos/lgatto/MSnbase/issues/comments/198949257","html_url":"https://github.com/lgatto/MSnbase/issues/81#issuecomment-198949257","issue_url":"https://api.github.com/repos/lgatto/MSnbase/issues/81","id":198949257,"user":{"login":"sgibb","id":1828443,"avatar_url":"https://avatars.githubusercontent.com/u/1828443?v=3","gravatar_id":"","url":"https://api.github.com/users/sgibb","html_url":"https://github.com/sgibb","followers_url":"https://api.github.com/users/sgibb/followers","following_url":"https://api.github.com/users/sgibb/following{/other_user}","gists_url":"https://api.github.com/users/sgibb/gists{/gist_id}","starred_url":"https://api.github.com/users/sgibb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgibb/subscriptions","organizations_url":"https://api.github.com/users/sgibb/orgs","repos_url":"https://api.github.com/users/sgibb/repos","events_url":"https://api.github.com/users/sgibb/events{/privacy}","received_events_url":"https://api.github.com/users/sgibb/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T15:22:41Z","updated_at":"2016-03-20T15:22:41Z","body":"We could \"misuse\" `utils.applyColumnwiseByGroup` here, e.g.:\r\n\r\n```r\r\ndata(msnset)\r\nhead(exprs(msnset))\r\n#     iTRAQ4.114 iTRAQ4.115 iTRAQ4.116 iTRAQ4.117\r\n# X1   1347.6158  2247.3097  3927.6931  7661.1463\r\n# X10   739.9861   799.3501   712.5983   940.6793\r\n# X11 27638.3582 33394.0252 32104.2879 26628.7278\r\n# X12 31892.8928 33634.6980 37674.7272 37227.7119\r\n# X13 26143.7542 29677.4781 29089.0593 27902.5608\r\n# X14  6448.0829  6234.1957  6902.8903  6437.2303\r\ngroupBy <- c(1, 1, 2, 2)\r\ne <- t(MSnbase:::utils.applyColumnwiseByGroup(t(exprs(msnset)), \r\n       groupBy=groupBy, FUN=colMeans))\r\nhead(e)\r\n#              1          2\r\n# X1   1797.4628  5794.4197\r\n# X10   769.6681   826.6388\r\n# X11 30516.1917 29366.5078\r\n# X12 32763.7954 37451.2196\r\n# X13 27910.6161 28495.8100\r\n# X14  6341.1393  6670.0603\r\n```\r\n\r\nHow to combine (no equal) featureData?"}}