diff retrieve_fasta_from_NCBI.py @ 10:2c5375809c03 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/fetch_fasta_from_ncbi commit e0a1114b735bf1af257456174f64e5ef8d205754-dirty
author drosofff
date Wed, 28 Oct 2015 11:24:45 -0400
parents cc43a7a11324
children 0bec3cba5c56
line wrap: on
line diff
--- a/retrieve_fasta_from_NCBI.py	Mon Jun 08 16:59:52 2015 -0400
+++ b/retrieve_fasta_from_NCBI.py	Wed Oct 28 11:24:45 2015 -0400
@@ -166,7 +166,7 @@
             try:
                 response = urllib2.urlopen(req)
                 fasta = response.read()
-                if "Resource temporarily unavailable" in fasta:
+                if ("Resource temporarily unavailable" in fasta) or (not fasta.startswith(">") ):
                     serverTransaction = False
                 else:
                     serverTransaction = True
@@ -176,8 +176,6 @@
             except httplib.IncompleteRead as e:
                 serverTransaction = False
                 self.logger.info("IncompleteRead error:  %s" % ( e.partial ) )
-        if self.dbname != "pubmed":
-            assert fasta.startswith(">"), fasta
         fasta = self.sanitiser(self.dbname, fasta) #
         time.sleep(1)
         return fasta