Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

How do I create a regulatory adaptor?

Daniel Zerbino edited this page May 11, 2018 · 4 revisions

In lib/postgap/Reg.py add an adaptor object at the second to last line, following the model below:

class My_Regulatory_Adaptor_Class(Reg_source):
	display_name = "My new source of Regulatory Data"
	def run(self, ld_snps, tissues):
		"""
			Extract Regulome score at snps of interest
			Args:
			* [ SNP ]
			* [ string ]
			Returntype: [ Regulatory_Evidence ]
		"""
		# Connect to DB, filter, etc...
		return [Regulatory_Evidence(
				snp = XXX, # SNP object, from the ld_snps list
				source = self.display_name,
				score = XXX, # Float, between 0 and 1
				study XXX, # String
				tissue = XXX, # String
				info = XXX # Hash
			)] #This is a list, you can have as many as you want