コード例 #1
0
    def write_in_pe_format(self, filename):
        check_dir(filename)

        with open(filename, 'w') as f:
            f.write(f"sequence={self.sequence}\n"
                    f"consensus={self.consensus}\n")
            f.write("F3_5pos=-1\nF3_3pos=-1\nF2_5pos=-1\nF2_3pos=-1\nF1c_5pos=-1\nF1c_3pos=-1\nB3_5pos=-1\nB3_3pos=-1\n"
                    "B2_5pos=-1\nB2_3pos=-1\nB1c_5pos=-1\nB1c_3pos=-1\ntarget_range_type=0\ntarget_range_from=\n"
                    "target_range_to=")
コード例 #2
0
    def __run_gram_align(filename, outfile):
        # checking directory of filename
        check_dir(filename)

        if ga_path:
            program = ga_path
        else:
            program = "GramAlign"
        command = program + " -i " + filename + " -o " + outfile + " -f 2"
        print(command)
        os.system(command)
コード例 #3
0
    def __run_muscle(filename, outfile):
        # checking directory of filename
        check_dir(filename)

        if clustalo_path:
            program = muscle_path
        else:
            program = "muscle"
        command = program + " -in " + filename + " -out " + outfile
        print(command)
        os.system(command)
コード例 #4
0
    def __run_clustalo(filename, outfile):
        # checking directory of filename
        check_dir(filename)

        if clustalo_path:
            program = clustalo_path
        else:
            program = "clustalo"
        command = program + " -i " + filename + " -o " + outfile
        print(command)
        os.system(command)
コード例 #5
0
 def __write_seqrec_to(self, filename, ignore_gaps=False, ignore_level=0.9):
     """
     Private function for writing Seq consensus
     :param filename: filename to write
     :param coloring: 'c' or 'd'. First for coloring confidence, second for coloring deeps
     :param ignore_gaps: boolean, True or False. Ignoring gaps with high level of confidence
     (with confidence >= ignore_level)
     :param ignore_level: float, level of ignoring gaps
     """
     seq = self.__get_seq_consensus(ignore_gaps, ignore_level)
     seq_rec = SeqRecord(seq)
     check_dir(filename)
     SeqIO.write(seq_rec, filename, "fasta")
コード例 #6
0
    def __write_html_to(self,
                        filename,
                        coloring="c",
                        ignore_gaps=False,
                        ignore_level=0.9):
        """
        Private function for writing html consensus
        :param filename: filename to write
        :param coloring: 'c' or 'd'. First for coloring confidence, second for coloring deeps
        :param ignore_gaps: boolean, True or False. Ignoring gaps with high level of confidence
        (with confidence >= ignore_level)
        :param ignore_level: float, level of ignoring gaps
        """
        html_header = Extractor.extract_html_header(coloring)
        html_body = self.__get_html_body(coloring, ignore_gaps, ignore_level)

        check_dir(filename)

        with open(filename, "w") as f:
            f.write(html_header + html_body)
コード例 #7
0
 def write_to(self, filename):
     check_dir(filename)
     SeqIO.write(self.records, filename, "fasta")