Пример #1
0
    def test_remove_gap_matrix(self):
        raw_matrix = ["aaa--a", "bbbcac"]
        fileterd_matrix = ["aaa", "bbb"]

        self.assertEqual(fileterd_matrix, dh.remove_gaps_matrix(raw_matrix))
    def test_remove_gap_matrix(self):
        raw_matrix = ["aaa--a", "bbbcac"]
        fileterd_matrix = ["aaa", "bbb"]

        self.assertEqual(fileterd_matrix, dh.remove_gaps_matrix(raw_matrix))
Пример #3
0
    current_dir = os.path.abspath(os.curdir)
    os.chdir(path_aln_file)
    species_list = check_gene_order_in_alignments(path_aln_file)
    inputfile_header = [">%s" % species_name for species_name in species_list]
    matrix_sequence = ["" for species_name in species_list]

    aln_files = [single_file for single_file in os.listdir(path_aln_file)
                 if ".aln" == os.path.splitext(single_file)[-1]]

    for single_aln_file in aln_files:
        # single file operation
        # rejection : 1. length not enough 2 two many  gaps
        try:
<<<<<<< HEAD
            matrix_sequence = paste_matrix(matrix_sequence,DH.remove_gaps_matrix(extract_TIR_single_file(single_aln_file, length_of_TIR, start_point)))
=======

            if remove_gap:
                gene_seq_matrix_addition = DH.remove_gaps_matrix(extract_TIR_single_file(single_aln_file, length_of_TIR, start_point))
            else:
                gene_seq_matrix_addition = extract_TIR_single_file(single_aln_file, length_of_TIR, start_point)

            matrix_sequence = paste_matrix(matrix_sequence, gene_seq_matrix_addition)
>>>>>>> f0acd743d1106c96b88083b2df2cb3526b388aec

        except SequenceTooShort:
            print "Too short in %s" % single_aln_file
            continue
        except DimNotSame:
            print "Error of Dimisions %s" % single_aln_file