{"action":"created","comment":{"url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments/32108364","id":32108364,"diff_hunk":"@@ -0,0 +1,48 @@\n+## This is an R script reformats mzTab files (*.tsv) to excel files (*.csv)\n+\n+options(warn=-1)\n+\n+#source(\"http://bioconductor.org/biocLite.R\")\n+#biocLite(\"MSnbase\")\n+library(MSnbase)\n+\n+input.file<-commandArgs(TRUE)[1]\n+output.file<-commandArgs(TRUE)[2]\n+\n+# MSnSet\n+x <- readMzTabData(input.file, what = \"PEP\")\n+\n+# data frame\n+peptide.data <- fData(x)\n+peptide.data[] <- lapply(peptide.data, as.character)\n+\n+# column names\n+columns <- colnames(peptide.data)\n+\n+unique.stripped.sequences <- unique(peptide.data$sequence)\n+unique.modified.sequences <- unique(peptide.data$opt_global_modified_sequence)\n+\n+# find best (lowest PEP score) modified sequences\n+n <- length(unique.modified.sequences)\n+indices <- c()\n+for (i in 1:n) {\n+\tj <- which(peptide.data$\"opt_global_modified_sequence\" == unique.modified.sequences[i])\n+\tPEPs <- peptide.data[j,]$\"opt_psm_Posterior Error Probability_score\"\n+\tk <- j[which(PEPs == min(PEPs))]\n+\tk <- k[1]\n+\t\n+\tindices <- c(indices, k)\n+}\n+\n+# simplify accession\n+list <- strsplit(peptide.data$accession,\"[|]\")\n+peptide.data$accession <- unlist(lapply(list, '[[', 2))\n+\n+# add fold change\n+peptide.data$fold_change <- log(as.numeric(peptide.data$\"peptide_abundance_study_variable[2]\")/as.numeric(peptide.data$\"peptide_abundance_study_variable[1]\"), base =2)","path":"share/OpenMS/SCRIPTS/mzTab2csv_peptides.R","position":42,"original_position":42,"commit_id":"982ea6d06445b832af4e8700917dd78d7c0f7da7","original_commit_id":"982ea6d06445b832af4e8700917dd78d7c0f7da7","user":{"login":"timosachsenberg","id":5803621,"avatar_url":"https://avatars.githubusercontent.com/u/5803621?v=3","gravatar_id":"","url":"https://api.github.com/users/timosachsenberg","html_url":"https://github.com/timosachsenberg","followers_url":"https://api.github.com/users/timosachsenberg/followers","following_url":"https://api.github.com/users/timosachsenberg/following{/other_user}","gists_url":"https://api.github.com/users/timosachsenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/timosachsenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timosachsenberg/subscriptions","organizations_url":"https://api.github.com/users/timosachsenberg/orgs","repos_url":"https://api.github.com/users/timosachsenberg/repos","events_url":"https://api.github.com/users/timosachsenberg/events{/privacy}","received_events_url":"https://api.github.com/users/timosachsenberg/received_events","type":"User","site_admin":false},"body":"ony works if two study variables","created_at":"2015-06-10T11:31:01Z","updated_at":"2015-06-10T11:31:01Z","html_url":"https://github.com/OpenMS/OpenMS/pull/1457#discussion_r32108364","pull_request_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457","_links":{"self":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments/32108364"},"html":{"href":"https://github.com/OpenMS/OpenMS/pull/1457#discussion_r32108364"},"pull_request":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457"}}},"pull_request":{"url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457","id":37108041,"html_url":"https://github.com/OpenMS/OpenMS/pull/1457","diff_url":"https://github.com/OpenMS/OpenMS/pull/1457.diff","patch_url":"https://github.com/OpenMS/OpenMS/pull/1457.patch","issue_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/1457","number":1457,"state":"open","locked":false,"title":"R script for mzTab to csv conversion","user":{"login":"lars20070","id":6149805,"avatar_url":"https://avatars.githubusercontent.com/u/6149805?v=3","gravatar_id":"","url":"https://api.github.com/users/lars20070","html_url":"https://github.com/lars20070","followers_url":"https://api.github.com/users/lars20070/followers","following_url":"https://api.github.com/users/lars20070/following{/other_user}","gists_url":"https://api.github.com/users/lars20070/gists{/gist_id}","starred_url":"https://api.github.com/users/lars20070/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lars20070/subscriptions","organizations_url":"https://api.github.com/users/lars20070/orgs","repos_url":"https://api.github.com/users/lars20070/repos","events_url":"https://api.github.com/users/lars20070/events{/privacy}","received_events_url":"https://api.github.com/users/lars20070/received_events","type":"User","site_admin":false},"body":"The R script generates from the mzTab input a list of unique modified peptide sequences and their attributes. Only the peptide sequence with the highest posterior error probability is kept. The output is a simple csv table with a single header.","created_at":"2015-06-07T15:09:53Z","updated_at":"2015-06-10T11:31:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c46ada24c19da80d37d2ff5ba5fd7cec725f123e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457/commits","review_comments_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457/comments","review_comment_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/1457/comments","statuses_url":"https://api.github.com/repos/OpenMS/OpenMS/statuses/982ea6d06445b832af4e8700917dd78d7c0f7da7","head":{"label":"lars20070:feature/mzTab2csv","ref":"feature/mzTab2csv","sha":"982ea6d06445b832af4e8700917dd78d7c0f7da7","user":{"login":"lars20070","id":6149805,"avatar_url":"https://avatars.githubusercontent.com/u/6149805?v=3","gravatar_id":"","url":"https://api.github.com/users/lars20070","html_url":"https://github.com/lars20070","followers_url":"https://api.github.com/users/lars20070/followers","following_url":"https://api.github.com/users/lars20070/following{/other_user}","gists_url":"https://api.github.com/users/lars20070/gists{/gist_id}","starred_url":"https://api.github.com/users/lars20070/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lars20070/subscriptions","organizations_url":"https://api.github.com/users/lars20070/orgs","repos_url":"https://api.github.com/users/lars20070/repos","events_url":"https://api.github.com/users/lars20070/events{/privacy}","received_events_url":"https://api.github.com/users/lars20070/received_events","type":"User","site_admin":false},"repo":{"id":17056022,"name":"OpenMS","full_name":"lars20070/OpenMS","owner":{"login":"lars20070","id":6149805,"avatar_url":"https://avatars.githubusercontent.com/u/6149805?v=3","gravatar_id":"","url":"https://api.github.com/users/lars20070","html_url":"https://github.com/lars20070","followers_url":"https://api.github.com/users/lars20070/followers","following_url":"https://api.github.com/users/lars20070/following{/other_user}","gists_url":"https://api.github.com/users/lars20070/gists{/gist_id}","starred_url":"https://api.github.com/users/lars20070/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lars20070/subscriptions","organizations_url":"https://api.github.com/users/lars20070/orgs","repos_url":"https://api.github.com/users/lars20070/repos","events_url":"https://api.github.com/users/lars20070/events{/privacy}","received_events_url":"https://api.github.com/users/lars20070/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lars20070/OpenMS","description":"The codebase of the OpenMS project","fork":true,"url":"https://api.github.com/repos/lars20070/OpenMS","forks_url":"https://api.github.com/repos/lars20070/OpenMS/forks","keys_url":"https://api.github.com/repos/lars20070/OpenMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lars20070/OpenMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lars20070/OpenMS/teams","hooks_url":"https://api.github.com/repos/lars20070/OpenMS/hooks","issue_events_url":"https://api.github.com/repos/lars20070/OpenMS/issues/events{/number}","events_url":"https://api.github.com/repos/lars20070/OpenMS/events","assignees_url":"https://api.github.com/repos/lars20070/OpenMS/assignees{/user}","branches_url":"https://api.github.com/repos/lars20070/OpenMS/branches{/branch}","tags_url":"https://api.github.com/repos/lars20070/OpenMS/tags","blobs_url":"https://api.github.com/repos/lars20070/OpenMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lars20070/OpenMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lars20070/OpenMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/lars20070/OpenMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lars20070/OpenMS/statuses/{sha}","languages_url":"https://api.github.com/repos/lars20070/OpenMS/languages","stargazers_url":"https://api.github.com/repos/lars20070/OpenMS/stargazers","contributors_url":"https://api.github.com/repos/lars20070/OpenMS/contributors","subscribers_url":"https://api.github.com/repos/lars20070/OpenMS/subscribers","subscription_url":"https://api.github.com/repos/lars20070/OpenMS/subscription","commits_url":"https://api.github.com/repos/lars20070/OpenMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/lars20070/OpenMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/lars20070/OpenMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/lars20070/OpenMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/lars20070/OpenMS/contents/{+path}","compare_url":"https://api.github.com/repos/lars20070/OpenMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lars20070/OpenMS/merges","archive_url":"https://api.github.com/repos/lars20070/OpenMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lars20070/OpenMS/downloads","issues_url":"https://api.github.com/repos/lars20070/OpenMS/issues{/number}","pulls_url":"https://api.github.com/repos/lars20070/OpenMS/pulls{/number}","milestones_url":"https://api.github.com/repos/lars20070/OpenMS/milestones{/number}","notifications_url":"https://api.github.com/repos/lars20070/OpenMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lars20070/OpenMS/labels{/name}","releases_url":"https://api.github.com/repos/lars20070/OpenMS/releases{/id}","created_at":"2014-02-21T12:47:23Z","updated_at":"2015-05-06T12:13:42Z","pushed_at":"2015-06-10T07:59:10Z","git_url":"git://github.com/lars20070/OpenMS.git","ssh_url":"git@github.com:lars20070/OpenMS.git","clone_url":"https://github.com/lars20070/OpenMS.git","svn_url":"https://github.com/lars20070/OpenMS","homepage":null,"size":206459,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"develop"}},"base":{"label":"OpenMS:develop","ref":"develop","sha":"171ebb4c70813892e0ae1ff8d932741577ae7ec9","user":{"login":"OpenMS","id":5994841,"avatar_url":"https://avatars.githubusercontent.com/u/5994841?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenMS","html_url":"https://github.com/OpenMS","followers_url":"https://api.github.com/users/OpenMS/followers","following_url":"https://api.github.com/users/OpenMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenMS/subscriptions","organizations_url":"https://api.github.com/users/OpenMS/orgs","repos_url":"https://api.github.com/users/OpenMS/repos","events_url":"https://api.github.com/users/OpenMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenMS/received_events","type":"Organization","site_admin":false},"repo":{"id":15763403,"name":"OpenMS","full_name":"OpenMS/OpenMS","owner":{"login":"OpenMS","id":5994841,"avatar_url":"https://avatars.githubusercontent.com/u/5994841?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenMS","html_url":"https://github.com/OpenMS","followers_url":"https://api.github.com/users/OpenMS/followers","following_url":"https://api.github.com/users/OpenMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenMS/subscriptions","organizations_url":"https://api.github.com/users/OpenMS/orgs","repos_url":"https://api.github.com/users/OpenMS/repos","events_url":"https://api.github.com/users/OpenMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenMS/OpenMS","description":"The codebase of the OpenMS project","fork":false,"url":"https://api.github.com/repos/OpenMS/OpenMS","forks_url":"https://api.github.com/repos/OpenMS/OpenMS/forks","keys_url":"https://api.github.com/repos/OpenMS/OpenMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenMS/OpenMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenMS/OpenMS/teams","hooks_url":"https://api.github.com/repos/OpenMS/OpenMS/hooks","issue_events_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/events{/number}","events_url":"https://api.github.com/repos/OpenMS/OpenMS/events","assignees_url":"https://api.github.com/repos/OpenMS/OpenMS/assignees{/user}","branches_url":"https://api.github.com/repos/OpenMS/OpenMS/branches{/branch}","tags_url":"https://api.github.com/repos/OpenMS/OpenMS/tags","blobs_url":"https://api.github.com/repos/OpenMS/OpenMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenMS/OpenMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenMS/OpenMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenMS/OpenMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenMS/OpenMS/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenMS/OpenMS/languages","stargazers_url":"https://api.github.com/repos/OpenMS/OpenMS/stargazers","contributors_url":"https://api.github.com/repos/OpenMS/OpenMS/contributors","subscribers_url":"https://api.github.com/repos/OpenMS/OpenMS/subscribers","subscription_url":"https://api.github.com/repos/OpenMS/OpenMS/subscription","commits_url":"https://api.github.com/repos/OpenMS/OpenMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenMS/OpenMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenMS/OpenMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenMS/OpenMS/contents/{+path}","compare_url":"https://api.github.com/repos/OpenMS/OpenMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenMS/OpenMS/merges","archive_url":"https://api.github.com/repos/OpenMS/OpenMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenMS/OpenMS/downloads","issues_url":"https://api.github.com/repos/OpenMS/OpenMS/issues{/number}","pulls_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenMS/OpenMS/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenMS/OpenMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenMS/OpenMS/labels{/name}","releases_url":"https://api.github.com/repos/OpenMS/OpenMS/releases{/id}","created_at":"2014-01-09T10:15:13Z","updated_at":"2015-05-28T07:14:21Z","pushed_at":"2015-06-09T18:07:53Z","git_url":"git://github.com/OpenMS/OpenMS.git","ssh_url":"git@github.com:OpenMS/OpenMS.git","clone_url":"https://github.com/OpenMS/OpenMS.git","svn_url":"https://github.com/OpenMS/OpenMS","homepage":null,"size":226456,"stargazers_count":29,"watchers_count":29,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":319,"forks":41,"open_issues":319,"watchers":29,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457"},"html":{"href":"https://github.com/OpenMS/OpenMS/pull/1457"},"issue":{"href":"https://api.github.com/repos/OpenMS/OpenMS/issues/1457"},"comments":{"href":"https://api.github.com/repos/OpenMS/OpenMS/issues/1457/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1457/commits"},"statuses":{"href":"https://api.github.com/repos/OpenMS/OpenMS/statuses/982ea6d06445b832af4e8700917dd78d7c0f7da7"}}}}