{"action":"created","comment":{"url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/comments/30489135","id":30489135,"diff_hunk":"@@ -1,92 +1,103 @@\n #!/usr/bin/env perl\n package Bio::RetrieveAssemblies;\n use Moose;\n-use File::Path qw(make_path);\n-# ABSTRACT: Get assemblies for a project accession\n-# PODNAME: retrieve_assemblies\n+use Getopt::Long qw(GetOptionsFromArray);\n+use Bio::RetrieveAssemblies::WGS;\n+use Bio::RetrieveAssemblies::AccessionFile;\n+\n+# ABSTRACT: Download assemblies from GenBank\n \n =head1 SYNOPSIS\n \n-Download assemblies for a project accession\n+Download assemblies from GenBank.\n+All the assemblies are automatically filtered against RefWeak to remove poor quality data.\n \n =cut\n \n-has 'project_accessions'     => ( is => 'rw', isa => 'ArrayRef', required => 1 );\n-has 'output_directory'       => ( is => 'rw', isa => 'Str', default => 'output' );\n-has 'file_type'              => ( is => 'rw', isa => 'Str', default => 'annotation' );\n-has 'organism_type'          => ( is => 'rw', isa => 'Str', default => 'BCT' );\n+has 'search_term'      => ( is => 'rw', isa => 'Str' );\n+has 'output_directory' => ( is => 'rw', isa => 'Str', default => 'downloaded_files' );\n+has 'file_type'        => ( is => 'rw', isa => 'Str', default => 'genbank' );\n+has 'organism_type'    => ( is => 'rw', isa => 'Str', default => 'BCT' );\n+has 'query'            => ( is => 'rw', isa => 'Str',      default  => '*' );\n+has 'args'             => ( is => 'ro', isa => 'ArrayRef', required => 1 );\n+has 'script_name'      => ( is => 'ro', isa => 'Str', required => 1 );\n+\n+sub _setup_inputs {\n+    my ($self) = @_;\n+    my ( $help, $file_type, $output_directory, $organism_type,$query );\n+    GetOptionsFromArray(\n+        $self->args,\n+        'p|organism_type=s'    => \\$organism_type,\n+        'f|file_type=s'        => \\$file_type,\n+        'o|output_directory=s' => \\$output_directory,\n+        'q|query=s'            => \\$query,\n+        'h|help'               => \\$help,\n+    );\n+\n+    if ( $help || @{ $self->args } == 0 ) {\n+        print $self->usage_text();\n+        die;\n+    }\n \n+    $self->output_directory($output_directory) if ($output_directory);\n+    $self->file_type($file_type)               if ($file_type);\n+    $self->organism_type($organism_type)       if ($organism_type);\n+    $self->query($query)                       if ($query);\n \n+    $self->search_term( $self->args->[0] );","path":"lib/Bio/RetrieveAssemblies.pm","position":55,"original_position":55,"commit_id":"0a0865536fb9349db4030f08d5f5a7155deda54a","original_commit_id":"0a0865536fb9349db4030f08d5f5a7155deda54a","user":{"login":"bewt85","id":1088023,"avatar_url":"https://avatars.githubusercontent.com/u/1088023?v=3","gravatar_id":"","url":"https://api.github.com/users/bewt85","html_url":"https://github.com/bewt85","followers_url":"https://api.github.com/users/bewt85/followers","following_url":"https://api.github.com/users/bewt85/following{/other_user}","gists_url":"https://api.github.com/users/bewt85/gists{/gist_id}","starred_url":"https://api.github.com/users/bewt85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bewt85/subscriptions","organizations_url":"https://api.github.com/users/bewt85/orgs","repos_url":"https://api.github.com/users/bewt85/repos","events_url":"https://api.github.com/users/bewt85/events{/privacy}","received_events_url":"https://api.github.com/users/bewt85/received_events","type":"User","site_admin":false},"body":"I might be being silly but for `retrieve_assemblies -f gff Salmonella` isn't `$self->args->[0]` equal to `-f`?","created_at":"2015-05-18T08:33:10Z","updated_at":"2015-05-18T08:33:10Z","html_url":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies/pull/1#discussion_r30489135","pull_request_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/comments/30489135"},"html":{"href":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies/pull/1#discussion_r30489135"},"pull_request":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1","id":35594476,"html_url":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies/pull/1","diff_url":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies/pull/1.diff","patch_url":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies/pull/1.patch","issue_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/issues/1","number":1,"state":"open","locked":false,"title":"Rewrite plus tests","user":{"login":"andrewjpage","id":24151,"avatar_url":"https://avatars.githubusercontent.com/u/24151?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewjpage","html_url":"https://github.com/andrewjpage","followers_url":"https://api.github.com/users/andrewjpage/followers","following_url":"https://api.github.com/users/andrewjpage/following{/other_user}","gists_url":"https://api.github.com/users/andrewjpage/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewjpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewjpage/subscriptions","organizations_url":"https://api.github.com/users/andrewjpage/orgs","repos_url":"https://api.github.com/users/andrewjpage/repos","events_url":"https://api.github.com/users/andrewjpage/events{/privacy}","received_events_url":"https://api.github.com/users/andrewjpage/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-17T22:18:32Z","updated_at":"2015-05-18T08:33:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a81367d9ae96279ae509580aaedb3f87c0c0cbc8","assignee":{"login":"bewt85","id":1088023,"avatar_url":"https://avatars.githubusercontent.com/u/1088023?v=3","gravatar_id":"","url":"https://api.github.com/users/bewt85","html_url":"https://github.com/bewt85","followers_url":"https://api.github.com/users/bewt85/followers","following_url":"https://api.github.com/users/bewt85/following{/other_user}","gists_url":"https://api.github.com/users/bewt85/gists{/gist_id}","starred_url":"https://api.github.com/users/bewt85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bewt85/subscriptions","organizations_url":"https://api.github.com/users/bewt85/orgs","repos_url":"https://api.github.com/users/bewt85/repos","events_url":"https://api.github.com/users/bewt85/events{/privacy}","received_events_url":"https://api.github.com/users/bewt85/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1/commits","review_comments_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1/comments","review_comment_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/issues/1/comments","statuses_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/statuses/0a0865536fb9349db4030f08d5f5a7155deda54a","head":{"label":"andrewjpage:master","ref":"master","sha":"0a0865536fb9349db4030f08d5f5a7155deda54a","user":{"login":"andrewjpage","id":24151,"avatar_url":"https://avatars.githubusercontent.com/u/24151?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewjpage","html_url":"https://github.com/andrewjpage","followers_url":"https://api.github.com/users/andrewjpage/followers","following_url":"https://api.github.com/users/andrewjpage/following{/other_user}","gists_url":"https://api.github.com/users/andrewjpage/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewjpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewjpage/subscriptions","organizations_url":"https://api.github.com/users/andrewjpage/orgs","repos_url":"https://api.github.com/users/andrewjpage/repos","events_url":"https://api.github.com/users/andrewjpage/events{/privacy}","received_events_url":"https://api.github.com/users/andrewjpage/received_events","type":"User","site_admin":false},"repo":{"id":35633819,"name":"Bio-RetrieveAssemblies","full_name":"andrewjpage/Bio-RetrieveAssemblies","owner":{"login":"andrewjpage","id":24151,"avatar_url":"https://avatars.githubusercontent.com/u/24151?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewjpage","html_url":"https://github.com/andrewjpage","followers_url":"https://api.github.com/users/andrewjpage/followers","following_url":"https://api.github.com/users/andrewjpage/following{/other_user}","gists_url":"https://api.github.com/users/andrewjpage/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewjpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewjpage/subscriptions","organizations_url":"https://api.github.com/users/andrewjpage/orgs","repos_url":"https://api.github.com/users/andrewjpage/repos","events_url":"https://api.github.com/users/andrewjpage/events{/privacy}","received_events_url":"https://api.github.com/users/andrewjpage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewjpage/Bio-RetrieveAssemblies","description":"","fork":true,"url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies","forks_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/forks","keys_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/teams","hooks_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/hooks","issue_events_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/issues/events{/number}","events_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/events","assignees_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/assignees{/user}","branches_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/branches{/branch}","tags_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/tags","blobs_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/languages","stargazers_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/stargazers","contributors_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/contributors","subscribers_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/subscribers","subscription_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/subscription","commits_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/contents/{+path}","compare_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/merges","archive_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/downloads","issues_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/issues{/number}","pulls_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/labels{/name}","releases_url":"https://api.github.com/repos/andrewjpage/Bio-RetrieveAssemblies/releases{/id}","created_at":"2015-05-14T20:03:16Z","updated_at":"2015-05-14T20:03:16Z","pushed_at":"2015-05-18T08:13:55Z","git_url":"git://github.com/andrewjpage/Bio-RetrieveAssemblies.git","ssh_url":"git@github.com:andrewjpage/Bio-RetrieveAssemblies.git","clone_url":"https://github.com/andrewjpage/Bio-RetrieveAssemblies.git","svn_url":"https://github.com/andrewjpage/Bio-RetrieveAssemblies","homepage":null,"size":120,"stargazers_count":0,"watchers_count":0,"language":"Perl","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":"sanger-pathogens:master","ref":"master","sha":"bcf0f1231ea753b87cdca861e862f4cc6f67d52f","user":{"login":"sanger-pathogens","id":130803,"avatar_url":"https://avatars.githubusercontent.com/u/130803?v=3","gravatar_id":"","url":"https://api.github.com/users/sanger-pathogens","html_url":"https://github.com/sanger-pathogens","followers_url":"https://api.github.com/users/sanger-pathogens/followers","following_url":"https://api.github.com/users/sanger-pathogens/following{/other_user}","gists_url":"https://api.github.com/users/sanger-pathogens/gists{/gist_id}","starred_url":"https://api.github.com/users/sanger-pathogens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanger-pathogens/subscriptions","organizations_url":"https://api.github.com/users/sanger-pathogens/orgs","repos_url":"https://api.github.com/users/sanger-pathogens/repos","events_url":"https://api.github.com/users/sanger-pathogens/events{/privacy}","received_events_url":"https://api.github.com/users/sanger-pathogens/received_events","type":"Organization","site_admin":false},"repo":{"id":35345093,"name":"Bio-RetrieveAssemblies","full_name":"sanger-pathogens/Bio-RetrieveAssemblies","owner":{"login":"sanger-pathogens","id":130803,"avatar_url":"https://avatars.githubusercontent.com/u/130803?v=3","gravatar_id":"","url":"https://api.github.com/users/sanger-pathogens","html_url":"https://github.com/sanger-pathogens","followers_url":"https://api.github.com/users/sanger-pathogens/followers","following_url":"https://api.github.com/users/sanger-pathogens/following{/other_user}","gists_url":"https://api.github.com/users/sanger-pathogens/gists{/gist_id}","starred_url":"https://api.github.com/users/sanger-pathogens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanger-pathogens/subscriptions","organizations_url":"https://api.github.com/users/sanger-pathogens/orgs","repos_url":"https://api.github.com/users/sanger-pathogens/repos","events_url":"https://api.github.com/users/sanger-pathogens/events{/privacy}","received_events_url":"https://api.github.com/users/sanger-pathogens/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies","description":"","fork":false,"url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies","forks_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/forks","keys_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/teams","hooks_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/hooks","issue_events_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/issues/events{/number}","events_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/events","assignees_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/assignees{/user}","branches_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/branches{/branch}","tags_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/tags","blobs_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/statuses/{sha}","languages_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/languages","stargazers_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/stargazers","contributors_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/contributors","subscribers_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/subscribers","subscription_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/subscription","commits_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/contents/{+path}","compare_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/merges","archive_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/downloads","issues_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/issues{/number}","pulls_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls{/number}","milestones_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/milestones{/number}","notifications_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/labels{/name}","releases_url":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/releases{/id}","created_at":"2015-05-09T20:53:48Z","updated_at":"2015-05-09T20:54:54Z","pushed_at":"2015-05-18T08:13:55Z","git_url":"git://github.com/sanger-pathogens/Bio-RetrieveAssemblies.git","ssh_url":"git@github.com:sanger-pathogens/Bio-RetrieveAssemblies.git","clone_url":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies.git","svn_url":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies","homepage":null,"size":125,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1"},"html":{"href":"https://github.com/sanger-pathogens/Bio-RetrieveAssemblies/pull/1"},"issue":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/issues/1"},"comments":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/sanger-pathogens/Bio-RetrieveAssemblies/statuses/0a0865536fb9349db4030f08d5f5a7155deda54a"}}}}