Example #1
0
	def _outsource_tasks(self, task_q):
		with open(self.config, 'r') as fCONFIG:
			blastskip = -1
			cutadaptskip = -1
			decontamskip = -1
			for line in fCONFIG:
				if not line.startswith('#') or not line.strip():		# skip comments
					if line.startswith('['):
						lib = line.strip().lstrip('[').rstrip(']')
					elif line.startswith("dir"):
						dir = line.split('=')[1].strip()
					elif line.startswith('fastq'):
						fq1 = os.path.join(dir, line.split('=')[1].strip().split(',')[0])
						fq2 = os.path.join(dir, line.split('=')[1].strip().split(',')[1])
						check_if_files_exist("Preqc", fq1, fq2)
					elif line.startswith('decontamskip'):
						decontamskip = int(line.split('=')[1].strip())
					elif line.startswith('blastskip'):
						blastskip = int(line.split('=')[1].strip())
					elif line.startswith('cutadaptskip'):
						cutadaptskip = int(line.split('=')[1].strip())
					elif line.startswith('adapter'):
						a1 = line.split('=')[1].strip().split(',')[0]
						a2 = line.split('=')[1].strip().split(',')[1]
						if blastskip == -1:
							blastskip = 0
						if cutadaptskip == -1:
							cutadaptskip = 0
						if decontamskip == -1:
							decontamskip = 0
						task_q.put((lib, fq1, fq2, blastskip, decontamskip, cutadaptskip, a1, a2))
						blastskip = -1
						cutadaptskip = -1
						decontamskip = -1
Example #2
0
	def __init__(self, args):
		self.target = os.path.realpath(args.target)
		make_dir_if_necessary(self.target)
		self.nproc = args.nproc
		self.nthread = args.nthread
		self.keep = args.keep
		self.db = args.db
		self.min_eval = args.min_eval
		self.config = args.config
		if self.db is not None:
			check_if_files_exist("Preqc", self.config, self.db)
		else:
			check_if_files_exist("Preqc", self.config)
		self.min_overlap = args.min_overlap
		self.min_readlen = args.min_readlen