示例#1
0
	def unpack(self):
		BlastDatabase.unpack(self)
		invoke = ConfigSys.gunzip + " -f"
		if (self.flag_debug):
			invoke += " -v"
		invoke += " " + self.downloaded_filemask
		self.invokeCmd(invoke)
示例#2
0
	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)
示例#3
0
	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)
示例#4
0
	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)
示例#5
0
	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()
示例#6
0
	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()
示例#7
0
	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
示例#8
0
	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
示例#9
0
	def download(self):
		BlastDatabase.download(self)
		ftp.getDB(self.name, Config.ncbi_formatted, self.workdir, self.flag_debug)