Beispiel #1
0
    def run(self):
        from compile_externals import compile_all
        if not os.path.exists(self.build_tools_dir):
            os.mkdir(self.build_tools_dir)

        # Try to compile everything
        compile_all()

        # Copy everything that has been compiled
        for bin in MOTIF_BINS.values():
            if os.path.exists(bin):
                shutil.copy(bin, self.build_tools_dir)

        # Copy seqlogo
        if os.path.exists("src/weblogo"):
            dlog.info("building seqlogo")
            patterns = [
                "src/weblogo/logo.*", "src/weblogo/template.*",
                "src/weblogo/seqlogo"
            ]
            for p in patterns:
                for file in glob(p):
                    shutil.copy(file, self.build_tools_dir)

        # Copy trawler
        if os.path.exists("src/trawler_standalone-1.2"):
            dlog.info("building trawler")
            if os.path.exists(os.path.join(self.build_tools_dir, "trawler")):
                shutil.rmtree(os.path.join(self.build_tools_dir, "trawler"))
            shutil.copytree("src/trawler_standalone-1.2",
                            os.path.join(self.build_tools_dir, "trawler"))

        # Copy MotifSampler & Improbizer (ameme)
        if self.machine == "x86_64":
            if os.path.exists("src/MotifSampler"):
                dlog.info("copying MotifSampler 64bit")
                shutil.copy("src/MotifSampler/MotifSampler_x86_64",
                            os.path.join(self.build_tools_dir, "MotifSampler"))
                shutil.copy(
                    "src/MotifSampler/CreateBackgroundModel_x86_64",
                    os.path.join(self.build_tools_dir,
                                 "CreateBackgroundModel"))
            if os.path.exists("src/Improbizer"):
                dlog.info("copying Improbizer (ameme) 64bit")
                shutil.copy("src/Improbizer/ameme_x86_64",
                            os.path.join(self.build_tools_dir, "ameme"))
        else:
            if os.path.exists("src/MotifSampler"):
                dlog.info("copying MotifSampler 32bit")
                shutil.copy("src/MotifSampler/MotifSampler_i386",
                            os.path.join(self.build_tools_dir, "MotifSampler"))
                shutil.copy(
                    "src/MotifSampler/CreateBackgroundModel_i386",
                    os.path.join(self.build_tools_dir,
                                 "CreateBackgroundModel"))
            if os.path.exists("src/Improbizer"):
                dlog.info("copying Improbizer (ameme) 32bit")
                shutil.copy("src/Improbizer/ameme_i386",
                            os.path.join(self.build_tools_dir, "ameme"))
Beispiel #2
0
	def run(self):
		from compile_externals import compile_all
		if not os.path.exists(self.build_tools_dir):
			os.mkdir(self.build_tools_dir)

		# Try to compile everything
		compile_all()

		# Copy everything that has been compiled
		for bin in MOTIF_BINS.values():
			if os.path.exists(bin):
				shutil.copy(bin, self.build_tools_dir)

		# Copy seqlogo
		if os.path.exists("src/weblogo"):
			dlog.info("building seqlogo")
			patterns = ["src/weblogo/logo.*", "src/weblogo/template.*", "src/weblogo/seqlogo"]
			for p in patterns:
				for file in glob(p):
					shutil.copy(file, self.build_tools_dir)

		# Copy trawler
		if os.path.exists("src/trawler_standalone-1.2"):
			dlog.info("building trawler")
			if os.path.exists(os.path.join(self.build_tools_dir, "trawler")):
				shutil.rmtree(os.path.join(self.build_tools_dir, "trawler"))
			shutil.copytree("src/trawler_standalone-1.2", os.path.join(self.build_tools_dir, "trawler"))

		# Copy MotifSampler & Improbizer (ameme)
		if self.machine == "x86_64":
			if os.path.exists("src/MotifSampler"):
				dlog.info("copying MotifSampler 64bit")
				shutil.copy("src/MotifSampler/MotifSampler_x86_64", os.path.join(self.build_tools_dir, "MotifSampler"))
				shutil.copy("src/MotifSampler/CreateBackgroundModel_x86_64", os.path.join(self.build_tools_dir, "CreateBackgroundModel"))
			if os.path.exists("src/Improbizer"):
				dlog.info("copying Improbizer (ameme) 64bit")
				shutil.copy("src/Improbizer/ameme_x86_64", os.path.join(self.build_tools_dir, "ameme"))
		else: 
			if os.path.exists("src/MotifSampler"):
				dlog.info("copying MotifSampler 32bit")
				shutil.copy("src/MotifSampler/MotifSampler_i386", os.path.join(self.build_tools_dir, "MotifSampler"))
				shutil.copy("src/MotifSampler/CreateBackgroundModel_i386", os.path.join(self.build_tools_dir, "CreateBackgroundModel"))
			if os.path.exists("src/Improbizer"):
				dlog.info("copying Improbizer (ameme) 32bit")
				shutil.copy("src/Improbizer/ameme_i386", os.path.join(self.build_tools_dir, "ameme"))
Beispiel #3
0
    def run(self): 
        if not self.dry_run:
            src_dir = os.path.join(self.build_base, "src")
            target_dir = os.path.join(self.build_lib, 'gimmemotifs/included_tools')
        #package_data={'gimmemotifs.data':['data/cfg/*']},
            
            self.copy_tree("src/", src_dir)
            # mkpath is a distutils helper to create directories
            self.mkpath(target_dir)
            
            compile_all(src_dir=src_dir)

            for exes in MOTIF_BINS.values():
                for exe in exes:
                    if os.path.exists(exe):
                        self.copy_file(exe, target_dir)
                    exe = os.path.join(self.build_base, exe)
                    if os.path.exists(exe):
                        self.copy_file(exe, target_dir)
            
            self.copy_tree(
                    os.path.join(src_dir,  "ChIPMunk"), 
                    os.path.join(target_dir, "ChIPMunk"))
            self.copy_tree(
                    os.path.join(src_dir,"HMS"), 
                    os.path.join(target_dir, "HMS"))
            self.copy_file(
                    os.path.join(src_dir,"MotifSampler/MotifSampler_x86_64"), 
                    os.path.join(target_dir, "MotifSampler"))
            self.copy_file(
                    os.path.join(src_dir,"MotifSampler/CreateBackgroundModel_x86_64"), 
                    os.path.join(target_dir, "CreateBackgroundModel"))
            self.copy_file(
                    os.path.join(src_dir,"Improbizer/ameme_x86_64"), 
                    os.path.join(target_dir, "ameme"))
       
            if os.path.exists("src/weblogo"):
                self.copy_tree("src/weblogo", 
                        os.path.join(target_dir, "weblogo"))

        my_build_py.run(self)
Beispiel #4
0
    def run(self):
        from compile_externals import compile_all
        prefix = distutils.sysconfig.get_config_var("prefix")

        if not os.path.exists(self.build_tools_dir):
            os.mkdir(self.build_tools_dir)

        # Try to compile everything
        compile_all(os.path.join(prefix, "share/gimmemotifs"))

        # Copy everything that has been compiled
        for bin in MOTIF_BINS.values():
            if os.path.exists(bin):
                shutil.copy(bin, self.build_tools_dir)

        # Copy seqlogo
        if os.path.exists("src/weblogo"):
            dlog.info("building seqlogo")
            patterns = [
                "src/weblogo/logo.*", "src/weblogo/template.*",
                "src/weblogo/seqlogo"
            ]
            for p in patterns:
                for file in glob(p):
                    shutil.copy(file, self.build_tools_dir)

        # Copy posmo deps
        if os.path.exists("src/posmo"):
            shutil.copy("src/posmo/clusterwd", self.build_tools_dir)

        # Copy ChIPMunk
        if os.path.exists("src/ChIPMunk"):
            if os.path.exists(os.path.join(self.build_tools_dir, "ChIPMunk")):
                shutil.rmtree(os.path.join(self.build_tools_dir, "ChIPMunk"))
            shutil.copytree("src/ChIPMunk",
                            os.path.join(self.build_tools_dir, "ChIPMunk"))
        # Copy HMS
        if os.path.exists("src/HMS"):
            if os.path.exists(os.path.join(self.build_tools_dir, "HMS")):
                shutil.rmtree(os.path.join(self.build_tools_dir, "HMS"))
            shutil.copytree("src/HMS", os.path.join(self.build_tools_dir,
                                                    "HMS"))

        if self.machine == "x86_64":
            post_fix = "_x86_64"
        else:
            post_fix = "_i386"

        # Copy MotifSampler
        if not conda_build and os.path.exists("src/MotifSampler"):
            dlog.info("copying MotifSampler")
            shutil.copy("src/MotifSampler/MotifSampler{}".format(post_fix),
                        os.path.join(self.build_tools_dir, "MotifSampler"))
            shutil.copy(
                "src/MotifSampler/CreateBackgroundModel{}".format(post_fix),
                os.path.join(self.build_tools_dir, "CreateBackgroundModel"))

        # Copy Improbizer (ameme)
        if os.path.exists("src/Improbizer"):
            dlog.info("copying Improbizer (ameme)")
            shutil.copy("src/Improbizer/ameme{}".format(post_fix),
                        os.path.join(self.build_tools_dir, "ameme"))
Beispiel #5
0
    def run(self):
        from compile_externals import compile_all
        prefix = distutils.sysconfig.get_config_var("prefix")
        
        if not os.path.exists(self.build_tools_dir):
            os.mkdir(self.build_tools_dir)

        # Try to compile everything
        compile_all(os.path.join(prefix, "share/gimmemotifs"))

        # Copy everything that has been compiled
        for bin in MOTIF_BINS.values():
            if os.path.exists(bin):
                shutil.copy(bin, self.build_tools_dir)

        # Copy seqlogo
        if os.path.exists("src/weblogo"):
            dlog.info("building seqlogo")
            patterns = ["src/weblogo/logo.*", "src/weblogo/template.*", "src/weblogo/seqlogo"]
            for p in patterns:
                for file in glob(p):
                    shutil.copy(file, self.build_tools_dir)

        # Copy posmo deps
        if os.path.exists("src/posmo"):
            shutil.copy("src/posmo/clusterwd", self.build_tools_dir)
        
        # Copy ChIPMunk
        if os.path.exists("src/ChIPMunk"):
            if os.path.exists(os.path.join(self.build_tools_dir, "ChIPMunk")):
                shutil.rmtree(os.path.join(self.build_tools_dir, "ChIPMunk"))
            shutil.copytree("src/ChIPMunk", os.path.join(self.build_tools_dir, "ChIPMunk"))
        # Copy HMS
        if os.path.exists("src/HMS"):
            if os.path.exists(os.path.join(self.build_tools_dir, "HMS")):
                shutil.rmtree(os.path.join(self.build_tools_dir, "HMS"))
            shutil.copytree("src/HMS", os.path.join(self.build_tools_dir, "HMS"))

        # Copy trawler
        if os.path.exists("src/trawler_standalone-1.2"):
            dlog.info("building trawler")
            if os.path.exists(os.path.join(self.build_tools_dir, "trawler")):
                shutil.rmtree(os.path.join(self.build_tools_dir, "trawler"))
            shutil.copytree("src/trawler_standalone-1.2", os.path.join(self.build_tools_dir, "trawler"))

        if self.machine == "x86_64":
            post_fix = "_x86_64"
        else:
            post_fix = "_i386"
        
        # Copy MotifSampler
        if not conda_build and os.path.exists("src/MotifSampler"):
            dlog.info("copying MotifSampler")
            shutil.copy(
                "src/MotifSampler/MotifSampler{}".format(post_fix), 
                    os.path.join(
                        self.build_tools_dir, 
                        "MotifSampler")
                    )
            shutil.copy(
                "src/MotifSampler/CreateBackgroundModel{}".format(post_fix), 
                    os.path.join(
                        self.build_tools_dir, 
                        "CreateBackgroundModel")
                    )
        
        # Copy Improbizer (ameme)
        if os.path.exists("src/Improbizer"):
            dlog.info("copying Improbizer (ameme)")
            shutil.copy("src/Improbizer/ameme{}".format(post_fix), 
                    os.path.join(self.build_tools_dir, "ameme"))