Exemplo n.º 1
0
	def saveUCLA_id_ls(self,UCLA_id_ls,exist_action):
		fname = os.path.join(self.projectDir,'UCLA_ids.tsv')
		if exist_action=='check':
			if os.path.isfile(fname):
				return True
			else:
				return False
		elif exist_action=='p':
			if os.path.isfile(fname):
				pass
			else:
				with open(fname, 'w') as f:
					writ=csv.writer(f, delimiter='\t')
					writ.writerow(UCLA_id_ls)
					del writ		
		elif exist_action=='w':
			with open(fname, 'w') as f:
				writ=csv.writer(f, delimiter='\t')
				writ.writerow(UCLA_id_ls)
				del writ
		else:
			raise hs.hsError('variable existAction must be w (overwrite) or p (pass) or check')
Exemplo n.º 2
0
	def saveVCFfilename_ls(self,VCFfilename_ls,contig_ls,genotypeMethodID,exist_action):
		fname = os.path.join(self.projectDir,'VCF_filename_ls_Meth'+str(genotypeMethodID)+'.tsv')
		if exist_action=='check':
			if os.path.isfile(fname):
				return True
			else:
				return False
		elif exist_action=='p':
			if os.path.isfile(fname):
				pass
			else:
				with open(fname, 'w') as f:
					writer=csv.writer(f, delimiter='\t')
					writer.writerow(VCFfilename_ls)
					writer.writerow(contig_ls)
					del writer		
		elif exist_action=='w':
			with open(fname, 'w') as f:
				writer=csv.writer(f, delimiter='\t')
				writer.writerow(VCFfilename_ls)
				writer.writerow(contig_ls)
				del writer	
		else:
			raise hs.hsError('variable existAction must be w (overwrite) or p (pass) or check')
Exemplo n.º 3
0
	def saveVCFInd(self,VCF_index_ls,genotype_method_id,exist_action):
		"""
		exist_action...
		'w'... overwrite existing file
		'p'... pass if the file exists
		
		description_str... string describing the aim of this analysis, with trailing \n
		"""
		fname = os.path.join(self.projectDir,'VCF_indices_Meth'+str(genotype_method_id)+'.tsv')		
		if exist_action=='p':
			if os.path.isfile(fname):
				pass
			else:
				with open(fname, 'w') as f:
					writ=csv.writer(f, delimiter='\t')
					writ.writerow(VCF_index_ls)
					del writ		
		elif exist_action=='w':
			with open(fname, 'w') as f:
				writ=csv.writer(f, delimiter='\t')
				writ.writerow(VCF_index_ls)
				del writ
		else:
			raise hs.hsError('variable existAction must be w (overwrite) or p (pass)')