예제 #1
0
파일: __init__.py 프로젝트: cbirdlab/sap
    def get_column(self, col):
        """Returns a string containing a given column (DEPRECATED).

        This is a method provided for backwards compatibility with the old
        Bio.Align.Generic.Alignment object. Please use the slice notation
        instead, since get_column is likely to be removed in a future release
        of Biopython..
        """
        import warnings
        import Bio
        warnings.warn("This method is deprecated and is provided for backwards compatibility with the old Bio.Align.Generic.Alignment object. Please use the slice notation instead, as get_column is likely to be removed in a future release of Biopython.", Bio.BiopythonDeprecationWarning)
        return _Alignment.get_column(self, col)
예제 #2
0
파일: __init__.py 프로젝트: kaspermunch/sap
    def get_column(self, col):
        """Returns a string containing a given column (DEPRECATED).

        This is a method provided for backwards compatibility with the old
        Bio.Align.Generic.Alignment object. Please use the slice notation
        instead, since get_column is likely to be removed in a future release
        of Biopython..
        """
        import warnings
        import Bio

        warnings.warn(
            "This method is deprecated and is provided for backwards compatibility with the old Bio.Align.Generic.Alignment object. Please use the slice notation instead, as get_column is likely to be removed in a future release of Biopython.",
            Bio.BiopythonDeprecationWarning,
        )
        return _Alignment.get_column(self, col)
예제 #3
0
    print(consensus)
    consensus = summary.gap_consensus(ambiguous="N")
    print(consensus)
    print("")
    print(summary.pos_specific_score_matrix(chars_to_ignore=['-'],
                                            axis_seq=consensus))
    print("")
    #Have a generic alphabet, without a declared gap char, so must tell
    #provide the frequencies and chars to ignore explicitly.
    print(summary.information_content(e_freq_table=expected,
                                      chars_to_ignore=['-']))
    print("")
    print("Trying a protein sequence with gaps and stops")

    alpha = Alphabet.HasStopCodon(Alphabet.Gapped(Alphabet.generic_protein, "-"), "*")
    a = Alignment(alpha)
    a.add_sequence("ID001", "MHQAIFIYQIGYP*LKSGYIQSIRSPEYDNW-")
    a.add_sequence("ID002", "MH--IFIYQIGYAYLKSGYIQSIRSPEY-NW*")
    a.add_sequence("ID003", "MHQAIFIYQIGYPYLKSGYIQSIRSPEYDNW*")
    print(a)
    print("="*a.get_alignment_length())

    s = SummaryInfo(a)
    c = s.dumb_consensus(ambiguous="X")
    print(c)
    c = s.gap_consensus(ambiguous="X")
    print(c)
    print("")
    print(s.pos_specific_score_matrix(chars_to_ignore=['-', '*'], axis_seq=c))

    print(s.information_content(chars_to_ignore=['-', '*']))
예제 #4
0
파일: AlignInfo.py 프로젝트: cbirdlab/sap
    print("")
    print(
        summary.pos_specific_score_matrix(chars_to_ignore=['-'],
                                          axis_seq=consensus))
    print("")
    #Have a generic alphabet, without a declared gap char, so must tell
    #provide the frequencies and chars to ignore explicitly.
    print(
        summary.information_content(e_freq_table=expected,
                                    chars_to_ignore=['-']))
    print("")
    print("Trying a protein sequence with gaps and stops")

    alpha = Alphabet.HasStopCodon(
        Alphabet.Gapped(Alphabet.generic_protein, "-"), "*")
    a = Alignment(alpha)
    a.add_sequence("ID001", "MHQAIFIYQIGYP*LKSGYIQSIRSPEYDNW-")
    a.add_sequence("ID002", "MH--IFIYQIGYAYLKSGYIQSIRSPEY-NW*")
    a.add_sequence("ID003", "MHQAIFIYQIGYPYLKSGYIQSIRSPEYDNW*")
    print(a)
    print("=" * a.get_alignment_length())

    s = SummaryInfo(a)
    c = s.dumb_consensus(ambiguous="X")
    print(c)
    c = s.gap_consensus(ambiguous="X")
    print(c)
    print("")
    print(s.pos_specific_score_matrix(chars_to_ignore=['-', '*'], axis_seq=c))

    print(s.information_content(chars_to_ignore=['-', '*']))