def unpack(self): BlastDatabase.unpack(self) invoke = ConfigSys.gunzip + " -f" if (self.flag_debug): invoke += " -v" invoke += " " + self.downloaded_filemask self.invokeCmd(invoke)
def download(self): BlastDatabase.download(self) # wget chokes on files >2GB # invoke = ConfigSys.wget + " -nc" # -nc to overwrite existing file with same name invoke = ConfigSys.curl + " -O -s " if (not self.flag_debug): invoke += " -nv" invoke += " " + self.url + "/" + self.downloaded_filemask self.invokeCmd(invoke)
def unpack(self): BlastDatabase.unpack(self) files = self.myglob(self.downloaded_filemask, self.workdir) for i in files: invoke = ConfigSys.tar + " zxf" if (self.flag_debug): invoke += "v" invoke += " " + i self.invokeCmd(invoke)
def download(self): BlastDatabase.download(self) invoke = ConfigSys.cp + " " + self.script_cwd + "/update_blastdb.pl ." self.invokeCmd(invoke) # use the --force flag, update_blastdb.pl isn't clever enough to detect # incomplete downloads invoke = ConfigSys.perl + " update_blastdb.pl --force" if (self.flag_debug): pass # invoke += " --verbose" # do nothing, this debug is too detailed invoke += " " + self.name self.invokeCmd(invoke)
def formatDb(self): BlastDatabase.formatDb(self) invoke = ConfigSys.loadmpi + "; " invoke += ConfigSys.mpiformatdb + " -N " + str(self.segments) invoke += " --config-file " + self.conf_file invoke += " -i " + self.name if (self.flag_skipreorder): invoke += " --skip-reorder" # declare protein or nucleotide (not necessary to specify but why not) if self.protein: invoke += " -p T" else: invoke += " -p F" self.invokeCmd(invoke) self.resetDbFormatPath()
def formatDb(self): invoke = "" if (self.flag_skipreorder): invoke += self.getCombinedFormatString(self.name) else: self.dumpToFasta(self.name) invoke += self.getSingleFormatString(self.name) # declare protein or nucleotide # only necessary when piping from fastacmd to mpiformatdb, but # making it a general requirement for consistency if self.protein: invoke += " -p T" else: invoke += " -p F" BlastDatabase.formatDb(self) self.invokeCmd(invoke) self.resetDbFormatPath()
def __init__(self, name, segments, protein=False, flags=None, url=None): BlastDatabase.__init__(self, name, segments, protein, flags) self.downloaded_filemask = name + ".gz" self.unpacked_filemask = name self.delete_filemask = None # don't delete any files self.url = url
def __init__(self, name, segments, flags=None, protein=False): BlastDatabase.__init__(self, name, segments, protein, flags) self.downloaded_filemask = name + "*.tar.gz" self.unpacked_filemask = name + "*.[p,n]??" self.delete_filemask = self.downloaded_filemask
def download(self): BlastDatabase.download(self) ftp.getDB(self.name, Config.ncbi_formatted, self.workdir, self.flag_debug)