{"action":"created","comment":{"url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/comments/220472688","pull_request_review_id":158886794,"id":220472688,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDQ3MjY4OA==","diff_hunk":"@@ -0,0 +1,55 @@\n+package uk.ac.ebi.atlas.experimentimport.sdrf;\n+\n+import uk.ac.ebi.atlas.commons.readers.TsvStreamer;\n+import uk.ac.ebi.atlas.resource.DataFileHub;\n+\n+import javax.inject.Inject;\n+import javax.inject.Named;\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+\n+@Named\n+public class SdrfParser {\n+\n+    private final DataFileHub dataFileHub;\n+\n+    @Inject\n+    public SdrfParser(DataFileHub dataFileHub) {\n+        this.dataFileHub = dataFileHub;\n+    }\n+\n+    // Returns a map containing the header values for characteristics and factors\n+    public Map<String, List<String>> parseHeader(String experimentAccession) {\n+        try (TsvStreamer sdrfStreamer = dataFileHub.getExperimentFiles(experimentAccession).sdrf.get()) {\n+            Pattern pattern = Pattern.compile(\"(.*?)(\\\\[)(.*?)(].*)\");","path":"base/src/main/java/uk/ac/ebi/atlas/experimentimport/sdrf/SdrfParser.java","position":34,"original_position":29,"commit_id":"df793e7f369094a714f758aa9bc8ce36aa6bfc6e","original_commit_id":"66bc060afda3ca9d79efbbace417b124dce87dea","user":{"login":"monicajianu","id":5923538,"node_id":"MDQ6VXNlcjU5MjM1Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/5923538?v=4","gravatar_id":"","url":"https://api.github.com/users/monicajianu","html_url":"https://github.com/monicajianu","followers_url":"https://api.github.com/users/monicajianu/followers","following_url":"https://api.github.com/users/monicajianu/following{/other_user}","gists_url":"https://api.github.com/users/monicajianu/gists{/gist_id}","starred_url":"https://api.github.com/users/monicajianu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monicajianu/subscriptions","organizations_url":"https://api.github.com/users/monicajianu/orgs","repos_url":"https://api.github.com/users/monicajianu/repos","events_url":"https://api.github.com/users/monicajianu/events{/privacy}","received_events_url":"https://api.github.com/users/monicajianu/received_events","type":"User","site_admin":false},"body":"Perhaps too funky... 😕 ","created_at":"2018-09-26T08:39:23Z","updated_at":"2018-09-26T08:39:23Z","html_url":"https://github.com/ebi-gene-expression-group/atlas/pull/167#discussion_r220472688","pull_request_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/comments/220472688"},"html":{"href":"https://github.com/ebi-gene-expression-group/atlas/pull/167#discussion_r220472688"},"pull_request":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167"}},"in_reply_to_id":220374809},"pull_request":{"url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167","id":217900405,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3OTAwNDA1","html_url":"https://github.com/ebi-gene-expression-group/atlas/pull/167","diff_url":"https://github.com/ebi-gene-expression-group/atlas/pull/167.diff","patch_url":"https://github.com/ebi-gene-expression-group/atlas/pull/167.patch","issue_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/167","number":167,"state":"open","locked":false,"title":"Bugfix #157046869 - Maintain sdrf column ordering in experiment design","user":{"login":"monicajianu","id":5923538,"node_id":"MDQ6VXNlcjU5MjM1Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/5923538?v=4","gravatar_id":"","url":"https://api.github.com/users/monicajianu","html_url":"https://github.com/monicajianu","followers_url":"https://api.github.com/users/monicajianu/followers","following_url":"https://api.github.com/users/monicajianu/following{/other_user}","gists_url":"https://api.github.com/users/monicajianu/gists{/gist_id}","starred_url":"https://api.github.com/users/monicajianu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monicajianu/subscriptions","organizations_url":"https://api.github.com/users/monicajianu/orgs","repos_url":"https://api.github.com/users/monicajianu/repos","events_url":"https://api.github.com/users/monicajianu/events{/privacy}","received_events_url":"https://api.github.com/users/monicajianu/received_events","type":"User","site_admin":false},"body":"- Added sdrf parser class that can parse the header of the file and retrieve characteristics and factors, preserving the column ordering\r\n- Added additional logic to the condensed sdrf parser to parse the sdrf (when available), in order to provide the ordered characteristics/factors to the ExperimentDesign class\r\n- Added tests\r\n- Converted `CondensedSdrfParserTest` to AssertJ assertions","created_at":"2018-09-25T08:49:46Z","updated_at":"2018-09-26T08:39:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8af4fc468e863ebac5c5f2781c3aa9a87ebed93f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167/commits","review_comments_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167/comments","review_comment_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/167/comments","statuses_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/statuses/df793e7f369094a714f758aa9bc8ce36aa6bfc6e","head":{"label":"ebi-gene-expression-group:bugfix/157046869-maintain-sdrf-column-order","ref":"bugfix/157046869-maintain-sdrf-column-order","sha":"df793e7f369094a714f758aa9bc8ce36aa6bfc6e","user":{"login":"ebi-gene-expression-group","id":37115756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTE1NzU2","avatar_url":"https://avatars3.githubusercontent.com/u/37115756?v=4","gravatar_id":"","url":"https://api.github.com/users/ebi-gene-expression-group","html_url":"https://github.com/ebi-gene-expression-group","followers_url":"https://api.github.com/users/ebi-gene-expression-group/followers","following_url":"https://api.github.com/users/ebi-gene-expression-group/following{/other_user}","gists_url":"https://api.github.com/users/ebi-gene-expression-group/gists{/gist_id}","starred_url":"https://api.github.com/users/ebi-gene-expression-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebi-gene-expression-group/subscriptions","organizations_url":"https://api.github.com/users/ebi-gene-expression-group/orgs","repos_url":"https://api.github.com/users/ebi-gene-expression-group/repos","events_url":"https://api.github.com/users/ebi-gene-expression-group/events{/privacy}","received_events_url":"https://api.github.com/users/ebi-gene-expression-group/received_events","type":"Organization","site_admin":false},"repo":{"id":5426219,"node_id":"MDEwOlJlcG9zaXRvcnk1NDI2MjE5","name":"atlas","full_name":"ebi-gene-expression-group/atlas","private":false,"owner":{"login":"ebi-gene-expression-group","id":37115756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTE1NzU2","avatar_url":"https://avatars3.githubusercontent.com/u/37115756?v=4","gravatar_id":"","url":"https://api.github.com/users/ebi-gene-expression-group","html_url":"https://github.com/ebi-gene-expression-group","followers_url":"https://api.github.com/users/ebi-gene-expression-group/followers","following_url":"https://api.github.com/users/ebi-gene-expression-group/following{/other_user}","gists_url":"https://api.github.com/users/ebi-gene-expression-group/gists{/gist_id}","starred_url":"https://api.github.com/users/ebi-gene-expression-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebi-gene-expression-group/subscriptions","organizations_url":"https://api.github.com/users/ebi-gene-expression-group/orgs","repos_url":"https://api.github.com/users/ebi-gene-expression-group/repos","events_url":"https://api.github.com/users/ebi-gene-expression-group/events{/privacy}","received_events_url":"https://api.github.com/users/ebi-gene-expression-group/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ebi-gene-expression-group/atlas","description":"Expression Atlas","fork":false,"url":"https://api.github.com/repos/ebi-gene-expression-group/atlas","forks_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/forks","keys_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/teams","hooks_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/hooks","issue_events_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/events{/number}","events_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/events","assignees_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/assignees{/user}","branches_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/branches{/branch}","tags_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/tags","blobs_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/refs{/sha}","trees_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/statuses/{sha}","languages_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/languages","stargazers_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/stargazers","contributors_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/contributors","subscribers_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/subscribers","subscription_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/subscription","commits_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/commits{/sha}","git_commits_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/commits{/sha}","comments_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/comments{/number}","issue_comment_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/comments{/number}","contents_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/contents/{+path}","compare_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/merges","archive_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/downloads","issues_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues{/number}","pulls_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls{/number}","milestones_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/milestones{/number}","notifications_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/labels{/name}","releases_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/releases{/id}","deployments_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/deployments","created_at":"2012-08-15T13:18:18Z","updated_at":"2018-09-26T08:38:58Z","pushed_at":"2018-09-26T08:38:47Z","git_url":"git://github.com/ebi-gene-expression-group/atlas.git","ssh_url":"git@github.com:ebi-gene-expression-group/atlas.git","clone_url":"https://github.com/ebi-gene-expression-group/atlas.git","svn_url":"https://github.com/ebi-gene-expression-group/atlas","homepage":"https://www.ebi.ac.uk/gxa","size":851825,"stargazers_count":18,"watchers_count":18,"language":"Roff","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2,"open_issues":7,"watchers":18,"default_branch":"dev"}},"base":{"label":"ebi-gene-expression-group:dev","ref":"dev","sha":"8090477cd0969edb952360aa14fdf1b49de70d00","user":{"login":"ebi-gene-expression-group","id":37115756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTE1NzU2","avatar_url":"https://avatars3.githubusercontent.com/u/37115756?v=4","gravatar_id":"","url":"https://api.github.com/users/ebi-gene-expression-group","html_url":"https://github.com/ebi-gene-expression-group","followers_url":"https://api.github.com/users/ebi-gene-expression-group/followers","following_url":"https://api.github.com/users/ebi-gene-expression-group/following{/other_user}","gists_url":"https://api.github.com/users/ebi-gene-expression-group/gists{/gist_id}","starred_url":"https://api.github.com/users/ebi-gene-expression-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebi-gene-expression-group/subscriptions","organizations_url":"https://api.github.com/users/ebi-gene-expression-group/orgs","repos_url":"https://api.github.com/users/ebi-gene-expression-group/repos","events_url":"https://api.github.com/users/ebi-gene-expression-group/events{/privacy}","received_events_url":"https://api.github.com/users/ebi-gene-expression-group/received_events","type":"Organization","site_admin":false},"repo":{"id":5426219,"node_id":"MDEwOlJlcG9zaXRvcnk1NDI2MjE5","name":"atlas","full_name":"ebi-gene-expression-group/atlas","private":false,"owner":{"login":"ebi-gene-expression-group","id":37115756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTE1NzU2","avatar_url":"https://avatars3.githubusercontent.com/u/37115756?v=4","gravatar_id":"","url":"https://api.github.com/users/ebi-gene-expression-group","html_url":"https://github.com/ebi-gene-expression-group","followers_url":"https://api.github.com/users/ebi-gene-expression-group/followers","following_url":"https://api.github.com/users/ebi-gene-expression-group/following{/other_user}","gists_url":"https://api.github.com/users/ebi-gene-expression-group/gists{/gist_id}","starred_url":"https://api.github.com/users/ebi-gene-expression-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebi-gene-expression-group/subscriptions","organizations_url":"https://api.github.com/users/ebi-gene-expression-group/orgs","repos_url":"https://api.github.com/users/ebi-gene-expression-group/repos","events_url":"https://api.github.com/users/ebi-gene-expression-group/events{/privacy}","received_events_url":"https://api.github.com/users/ebi-gene-expression-group/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ebi-gene-expression-group/atlas","description":"Expression Atlas","fork":false,"url":"https://api.github.com/repos/ebi-gene-expression-group/atlas","forks_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/forks","keys_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/teams","hooks_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/hooks","issue_events_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/events{/number}","events_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/events","assignees_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/assignees{/user}","branches_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/branches{/branch}","tags_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/tags","blobs_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/refs{/sha}","trees_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/statuses/{sha}","languages_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/languages","stargazers_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/stargazers","contributors_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/contributors","subscribers_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/subscribers","subscription_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/subscription","commits_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/commits{/sha}","git_commits_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/git/commits{/sha}","comments_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/comments{/number}","issue_comment_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/comments{/number}","contents_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/contents/{+path}","compare_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/merges","archive_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/downloads","issues_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues{/number}","pulls_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls{/number}","milestones_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/milestones{/number}","notifications_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/labels{/name}","releases_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/releases{/id}","deployments_url":"https://api.github.com/repos/ebi-gene-expression-group/atlas/deployments","created_at":"2012-08-15T13:18:18Z","updated_at":"2018-09-26T08:38:58Z","pushed_at":"2018-09-26T08:38:47Z","git_url":"git://github.com/ebi-gene-expression-group/atlas.git","ssh_url":"git@github.com:ebi-gene-expression-group/atlas.git","clone_url":"https://github.com/ebi-gene-expression-group/atlas.git","svn_url":"https://github.com/ebi-gene-expression-group/atlas","homepage":"https://www.ebi.ac.uk/gxa","size":851825,"stargazers_count":18,"watchers_count":18,"language":"Roff","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2,"open_issues":7,"watchers":18,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167"},"html":{"href":"https://github.com/ebi-gene-expression-group/atlas/pull/167"},"issue":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/167"},"comments":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/issues/167/comments"},"review_comments":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167/comments"},"review_comment":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/pulls/167/commits"},"statuses":{"href":"https://api.github.com/repos/ebi-gene-expression-group/atlas/statuses/df793e7f369094a714f758aa9bc8ce36aa6bfc6e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"monicajianu"}}