Exemplo n.º 1
0
 def finish(self):
     # Once executed, alignment is converted into relaxed
     # interleaved phylip format.
     alg = SeqGroup(os.path.join(self.jobs[0].jobdir, "alg.fasta"))
     fasta = alg.write(format="fasta")
     phylip = alg.write(format="iphylip_relaxed")
     AlgTask.store_data(self, fasta, phylip)
Exemplo n.º 2
0
 def finish(self):
     # Once executed, alignment is converted into relaxed
     # interleaved phylip format.
     alg = SeqGroup(os.path.join(self.jobs[0].jobdir, "alg.fasta"))
     fasta = alg.write(format="fasta")
     phylip = alg.write(format="iphylip_relaxed")
     AlgTask.store_data(self, fasta, phylip)
Exemplo n.º 3
0
    def finish(self):
        # Once executed, alignment is converted into relaxed
        # interleaved phylip format. Both files, fasta and phylip,
        # remain accessible.

        # Set Task specific attributes
        main_job = self.jobs[0]
        fasta_path = pjoin(main_job.jobdir, "clean.alg.fasta")
        alg = SeqGroup(fasta_path)
        if len(alg) != self.size:
            log.warning(
                "Trimming was to aggressive and it tried"
                " to remove one or more sequences."
                " Alignment trimming will be disabled for this dataset.")
            self.clean_alg_fasta_file = db.register_task_data(
                self.taskid, DATATYPES.clean_alg_fasta, self.alg_fasta_file)
            self.clean_alg_phylip_file = db.register_task_data(
                self.taskid, DATATYPES.clean_alg_phylip, self.alg_phylip_file)
        else:
            for line in open(self.jobs[0].stdout_file):
                line = line.strip()
                if line.startswith("#ColumnsMap"):
                    kept_columns = list(
                        map(int,
                            line.split("\t")[1].split(",")))
            fasta = alg.write(format="fasta")
            phylip = alg.write(format="iphylip_relaxed")
            AlgCleanerTask.store_data(self, fasta, phylip, kept_columns)
Exemplo n.º 4
0
 def finish(self):
     # Once executed, alignment is converted into relaxed
     # interleaved phylip format.
     final_job = self.jobs[2]
     alg = SeqGroup(os.path.join(final_job.jobdir, "alg.fasta"))
     alg.write(outfile=self.alg_fasta_file, format="fasta")
     alg.write(outfile=self.alg_phylip_file, format="iphylip_relaxed")
     AlgTask.finish(self)
Exemplo n.º 5
0
 def finish(self):
     # Once executed, alignment is converted into relaxed
     # interleaved phylip format.
     final_job = self.jobs[2]
     alg = SeqGroup(os.path.join(final_job.jobdir, "alg.fasta"))
     alg.write(outfile=self.alg_fasta_file, format="fasta")
     alg.write(outfile=self.alg_phylip_file, format="iphylip_relaxed")
     AlgTask.finish(self)
Exemplo n.º 6
0
    def finish(self):
        # Once executed, alignment is converted into relaxed
        # interleaved phylip format.
        alg = SeqGroup(os.path.join(self.jobs[0].jobdir, "mcoffee.fasta"))
        fasta = alg.write(format="fasta")
        phylip = alg.write(format="iphylip_relaxed")

        alg_list_string = '\n'.join([pjoin(GLOBALS["input_dir"],
                                           aname) for aname in self.all_alg_files])
        db.add_task_data(self.taskid, DATATYPES.alg_list, alg_list_string)

        AlgTask.store_data(self, fasta, phylip)
Exemplo n.º 7
0
 def finish(self):
     if self.conf[self.confname]["_alg_trimming"]:
         # If trimming happened after mcoffee, let's save the
         # resulting output
         trim_job = self.jobs[-1]
         alg = SeqGroup(pjoin(trim_job.jobdir, trim_job.alg_fasta_file))
         fasta = alg.write(format="fasta")
         phylip = alg.write(format="iphylip_relaxed")
         AlgTask.store_data(self, fasta, phylip)
     else:
         # If no post trimming, output is just what Mcoffee
         # produced, so we can recycle its data ids.
         mc_task = self.jobs[-1]
         fasta_id = db.get_dataid(mc_task.taskid, DATATYPES.alg_fasta)
         phylip_id = db.get_dataid(mc_task.taskid, DATATYPES.alg_phylip)
         db.register_task_data(self.taskid, DATATYPES.alg_fasta, fasta_id)
         db.register_task_data(self.taskid, DATATYPES.alg_phylip, phylip_id)
Exemplo n.º 8
0
    def finish(self):
        # Once executed, alignment is converted into relaxed
        # interleaved phylip format. Both files, fasta and phylip,
        # remain accessible.

        # Set Task specific attributes
        main_job = self.jobs[0]
        fasta_path = pjoin(main_job.jobdir, "clean.alg.fasta")
        alg = SeqGroup(fasta_path)
        if len(alg) != self.size:
            log.warning("Trimming was to aggressive and it tried"
                        " to remove one or more sequences."
                        " Alignment trimming will be disabled for this dataset."
                        )
            self.clean_alg_fasta_file = db.register_task_data(self.taskid, DATATYPES.clean_alg_fasta, self.alg_fasta_file)
            self.clean_alg_phylip_file = db.register_task_data(self.taskid, DATATYPES.clean_alg_phylip, self.alg_phylip_file)
        else:
            for line in open(self.jobs[0].stdout_file):
                line = line.strip()
                if line.startswith("#ColumnsMap"):
                    kept_columns = list(map(int, line.split("\t")[1].split(",")))
            fasta = alg.write(format="fasta")
            phylip = alg.write(format="iphylip_relaxed")
            AlgCleanerTask.store_data(self, fasta, phylip, kept_columns)
Exemplo n.º 9
0
 def finish(self):
     alg = SeqGroup(os.path.join(self.jobs[0].jobdir, "alg.fasta"))
     fasta = alg.write(format="fasta")
     phylip = alg.write(format="iphylip_relaxed")
     AlgTask.store_data(self, fasta, phylip)
Exemplo n.º 10
0
 def finish(self):
     alg = SeqGroup(os.path.join(self.jobs[0].jobdir, "alg.fasta"))
     fasta = alg.write(format="fasta")
     phylip = alg.write(format="iphylip_relaxed")
     AlgTask.store_data(self, fasta, phylip)