Exemple #1
0
 def screenshot(self, args_sc):
     lib_dict = {"ft": [], "fn": [], "rt": [], "rn": [], "ff": [], "rf": []}
     f_texs = []
     r_texs = []
     if args_sc.tlibs is not None:
         for lib in args_sc.tlibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 print("Error: Exist a not proper wig files!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     f_texs.append(lib_datas)
                 else:
                     r_texs.append(lib_datas)
         f_texs = sorted(f_texs, key=lambda x: (x[1], x[2], x[3]))
         r_texs = sorted(r_texs, key=lambda x: (x[1], x[2], x[3]))
         self._import_libs(f_texs, "+", lib_dict)
         self._import_libs(r_texs, "-", lib_dict)
     if args_sc.flibs is not None:
         for lib in args_sc.flibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 print("Error: Exist a not proper wig files!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     lib_dict["ff"].append(lib_datas[0])
                 else:
                     lib_dict["rf"].append(lib_datas[0])
     gen_screenshot(args_sc, lib_dict, self.forward_file + ".txt",
                    self.reverse_file + ".txt", self.strain)
     if (args_sc.tlibs is None) and (args_sc.flibs is None):
         print("Error: There are no wig file assigned!")
         sys.exit()
Exemple #2
0
 def screenshot(self, args_sc, log):
     lib_dict = {"ft": [], "fn": [], "rt": [], "rn": [], "ff": [], "rf": []}
     f_texs = []
     r_texs = []
     if args_sc.tlibs is not None:
         for lib in args_sc.tlibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 log.write("Wiggle files should end with .wig.\n")
                 print("Error: Wiggle files should end with .wig!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     f_texs.append(lib_datas)
                 else:
                     r_texs.append(lib_datas)
         f_texs = sorted(f_texs, key=lambda x: (x[1], x[2], x[3]))
         r_texs = sorted(r_texs, key=lambda x: (x[1], x[2], x[3]))
         self._import_libs(f_texs, "+", lib_dict)
         self._import_libs(r_texs, "-", lib_dict)
     if args_sc.flibs is not None:
         for lib in args_sc.flibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 log.write("Wiggle files should end with .wig.\n")
                 print("Error: Wiggle files should end with .wig!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     lib_dict["ff"].append(lib_datas[0])
                 else:
                     lib_dict["rf"].append(lib_datas[0])
     log.write("Running gen_screenshots.py to generate IGV batch script.\n")
     gen_screenshot(args_sc, lib_dict, self.forward_file + ".txt",
                    self.reverse_file + ".txt", self.strain)
     log.write("\t" + self.forward_file + ".txt is generated.\n")
     log.write("\t" + self.reverse_file + ".txt is generated.\n")
     if (args_sc.tlibs is None) and (args_sc.flibs is None):
         log.write("No wig files can be found.\n")
         print("Error: There is no wig file assigned!")
         sys.exit()
Exemple #3
0
 def screenshot(self, args_sc, log):
     lib_dict = {"ft": [], "fn": [], "rt": [], "rn": [], "ff": [], "rf": []}
     f_texs = []
     r_texs = []
     if args_sc.tlibs is not None:
         for lib in args_sc.tlibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 log.write("Wiggle files should end with .wig.\n")
                 print("Error: Wiggle files should end with .wig!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     f_texs.append(lib_datas)
                 else:
                     r_texs.append(lib_datas)
         f_texs = sorted(f_texs, key=lambda x: (x[1], x[2], x[3]))
         r_texs = sorted(r_texs, key=lambda x: (x[1], x[2], x[3]))
         self._import_libs(f_texs, "+", lib_dict)
         self._import_libs(r_texs, "-", lib_dict)
     if args_sc.flibs is not None:
         for lib in args_sc.flibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 log.write("Wiggle files should end with .wig.\n")
                 print("Error: Wiggle files should end with .wig!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     lib_dict["ff"].append(lib_datas[0])
                 else:
                     lib_dict["rf"].append(lib_datas[0])
     log.write("Running gen_screenshots.py to generate IGV batch script.\n")
     gen_screenshot(args_sc, lib_dict, self.forward_file + ".txt",
                    self.reverse_file + ".txt", self.strain)
     log.write("\t" + self.forward_file + ".txt is generated.\n")
     log.write("\t" + self.reverse_file + ".txt is generated.\n")
     if (args_sc.tlibs is None) and (args_sc.flibs is None):
         log.write("No wig files can be found.\n")
         print("Error: There is no wig file assigned!")
         sys.exit()
Exemple #4
0
 def screenshot(self, args_sc):
     lib_dict = {"ft": [], "fn": [], "rt": [], "rn": [], "ff": [], "rf": []}
     f_texs = []
     r_texs = []
     if args_sc.tlibs is not None:
         for lib in args_sc.tlibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 print("Error:Exist a not proper wig files!!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     f_texs.append(lib_datas)
                 else:
                     r_texs.append(lib_datas)
         f_texs = sorted(f_texs, key=lambda x: (x[1], x[2], x[3]))
         r_texs = sorted(r_texs, key=lambda x: (x[1], x[2], x[3]))
         self._import_libs(f_texs, "+", args_sc.tex_wigs, lib_dict)
         self._import_libs(r_texs, "-", args_sc.tex_wigs, lib_dict)
     if args_sc.flibs is not None:
         for lib in args_sc.flibs:
             lib_datas = lib.split(":")
             if not lib_datas[0].endswith(".wig"):
                 print("Error:Exist a not proper wig files!!")
                 sys.exit()
             else:
                 if lib_datas[-1] == "+":
                     lib_dict["ff"].append(os.path.join(
                                    args_sc.frag_wigs, lib_datas[0]))
                 else:
                     lib_dict["rf"].append(os.path.join(
                                    args_sc.frag_wigs, lib_datas[0]))
     gen_screenshot(args_sc, lib_dict, self.forward_file + ".txt",
                    self.reverse_file + ".txt", self.strain)
     if (args_sc.tlibs is None) and (args_sc.flibs is None):
         print("Error: There are no wig file assigned!!!")
         sys.exit()