Exemplo n.º 1
0
    def set_defaults(self):
        """Set default values to run programs

        For LTR,
        min_dist: minimum distance(bp) between LTRs.
        max_dist: maximum distance(bp) between LTRS
        min_len_ltr: minimum length(bp) of LTR.
        max_len_ltr: maximum length(bp) of LTR.
        ltr_sim_condition: minimum similarity(%) for LTRs in an element.
        cluster_sim_condition: minimum similarity(%) for LTRs in a cluster
        len_condition: minimum length(bp) for LTRs aligned in local alignment.
        """

        if self.data_dir:
            self.data_dir = utils.create_directory(self.data_dir, False)
        else:
            self.data_dir = \
            utils.create_directory(utils.get_abspath(self.default_output_path))

        self.hmmerv = 3
        self.min_dist = 2000
        self.max_dist = 20000
        self.min_len_ltr = 130
        self.max_len_ltr = 2000
        self.ltr_sim_condition = 70
        self.cluster_sim_condition = 70
        self.len_condition = 70

        self.sw_rm = "No"  # or Yes
        self.scaffold = ""  # or directory
Exemplo n.º 2
0
    def set_defaults(self):
        """Set default values to run programs

        For LTR,
        min_dist: minimum distance(bp) between LTRs.
        max_dist: maximum distance(bp) between LTRS
        min_len_ltr: minimum length(bp) of LTR.
        max_len_ltr: maximum length(bp) of LTR.
        ltr_sim_condition: minimum similarity(%) for LTRs in an element.
        cluster_sim_condition: minimum similarity(%) for LTRs in a cluster
        len_condition: minimum length(bp) for LTRs aligned in local alignment.
        """

        if self.data_dir:
            self.data_dir = utils.create_directory(self.data_dir, False)
        else:
            self.data_dir = \
            utils.create_directory(utils.get_abspath(self.default_output_path))

        self.hmmerv = 3
        self.min_dist = 2000
        self.max_dist = 20000
        self.min_len_ltr = 130
        self.max_len_ltr = 2000
        self.ltr_sim_condition = 70
        self.cluster_sim_condition = 70
        self.len_condition = 70

        self.sw_rm = "No" # or Yes
        self.scaffold = "" # or directory
Exemplo n.º 3
0
 def reverse_complement(self, directory):
     mypath = self.genome_path
     for (dirpath, dirnames, filenames) in os.walk(mypath):
         break
     utils.create_directory(directory, False)
     for name in filenames:
         file_path = utils.get_abspath(dirpath + "/" + name)
         reverse_complement_fasta(file_path, directory)
Exemplo n.º 4
0
 def reverse_complement(self, directory):
     mypath = self.genome_path
     for (dirpath, dirnames, filenames) in os.walk(mypath):
         break
     utils.create_directory(directory, False)
     for name in filenames:
         file_path = utils.get_abspath(dirpath + "/" + name)
         reverse_complement_fasta(file_path, directory)
Exemplo n.º 5
0
    def split_files(self, dirpath=None, output_path=None):

        if not dirpath:
            dirpath = self.input_file
        if not output_path:
            output_path = self.result_path

        utils.create_directory(output_path,False)

        onlyfiles = [ f for f in listdir(dirpath) if isfile(join(dirpath,f)) ]
        for file in onlyfiles:
            self.split_file(dirpath + "/" + file, output_path)
Exemplo n.º 6
0
 def forward(self):
     utils.create_directory(self.output_path, False)
     if self.nmpi:
         #cmd = self._padding("mpirun", self.p_np, self.p_mpi_option,
         cmd = self._padding("mpirun", "-n " + str(int(math.ceil(1.0*int(self.nmpi)/2))), self.p_mpi_option,
                 self.p_mgescan_mpi_cmd, self.p_prg, self.p_genome_f,
                 self.p_data_f, self.p_hmmerv)
         self.run_cmd(cmd)
     else:
        mypath = self.genome_path
        for f in os.listdir(mypath):
            fpath = os.path.join(mypath, f)
            if os.path.isfile(fpath):
                #p = Process(target=self.run_hmm, args=("forward", fpath,))
                #p.start()
                self.run_hmm("forward", fpath)
Exemplo n.º 7
0
 def forward(self):
     utils.create_directory(self.output_path, False)
     if self.nmpi:
         #cmd = self._padding("mpirun", self.p_np, self.p_mpi_option,
         cmd = self._padding(
             "mpirun",
             "-n " + str(int(math.ceil(1.0 * int(self.nmpi) / 2))),
             self.p_mpi_option, self.p_mgescan_mpi_cmd, self.p_prg,
             self.p_genome_f, self.p_data_f, self.p_hmmerv)
         self.run_cmd(cmd)
     else:
         mypath = self.genome_path
         for f in os.listdir(mypath):
             fpath = os.path.join(mypath, f)
             if os.path.isfile(fpath):
                 #p = Process(target=self.run_hmm, args=("forward", fpath,))
                 #p.start()
                 self.run_hmm("forward", fpath)
Exemplo n.º 8
0
 def set_defaults(self):
     """Set default values to run programs"""
     if self.result_path:
         self.result_path = utils.create_directory(self.result_path, False)
     else:
         self.result_path = utils.create_directory(self.default_output)