Permalink
Browse files

Adds error-check in miga ncbi_get

  • Loading branch information...
lmrodriguezr committed Feb 8, 2019
1 parent 4d416c9 commit 67a5d554d87a724052190b12721d76c9f2860e89
Showing with 3 additions and 0 deletions.
  1. +3 −0 actions/ncbi_get.rb
@@ -86,6 +86,7 @@ def get_list(taxon, status)
$stderr.puts 'Downloading reference genomes' unless o[:q]
lineno = 0
get_list(nil, :reference).each_line do |ln|
raise "NCBI servers error: #{ln}" if ln =~ /^ERROR: /
next if (lineno+=1)==1
r = ln.chomp.split("\t")
next if r[3].nil? or r[3].empty?
@@ -105,6 +106,7 @@ def get_list(taxon, status)
$stderr.puts 'Downloading complete/chromosome genomes' unless o[:q]
lineno = 0
get_list(o[:taxon], status).each_line do |ln|
raise "NCBI servers error: #{ln}" if ln =~ /^ERROR: /
next if (lineno+=1)==1
r = ln.chomp.split("\t")
next if r[10].nil? or r[10].empty?
@@ -123,6 +125,7 @@ def get_list(taxon, status)
$stderr.puts "Downloading scaffold/contig genomes" unless o[:q]
lineno = 0
get_list(o[:taxon], status).each_line do |ln|
raise "NCBI servers error: #{ln}" if ln =~ /^ERROR: /
next if (lineno+=1)==1
r = ln.chomp.split("\t")
next if r[7].nil? or r[7].empty?

0 comments on commit 67a5d55

Please sign in to comment.