Esempio n. 1
0
def convertMali2Mali(mali):
    """convert a mali to a profile."""

    new_mali = alignlib_lite.py_makeMultipleAlignment()
    for id in mali.getIdentifiers():
        s = alignlib_lite.py_makeAlignatumFromString(mali[id])
        s.thisown = 0
        new_mali.addAlignatum(s)

    return new_mali
Esempio n. 2
0
def convertMali2Mali(mali):
    """convert a mali to a profile."""

    new_mali = alignlib_lite.py_makeMultipleAlignment()
    for id in mali.getIdentifiers():
        s = alignlib_lite.py_makeAlignatumFromString(mali[id])
        s.thisown = 0
        new_mali.addAlignatum(s)

    return new_mali
Esempio n. 3
0
def convertMali2Alignlib(mali):
    '''convert a multiple alignment of type :class:`Mali`
    into an alignlib_lite.py_multiple alignment object.
    '''

    import alignlib_lite
    m = alignlib_lite.py_makeMultipleAlignment()
    for identifier in mali.getIdentifiers():
        a = alignlib_lite.py_makeAlignatum(mali[identifier])
        m.add(a)
    return m
Esempio n. 4
0
def convertMali2Alignlib(mali):
    '''convert a multiple alignment of type :class:`Mali`
    into an alignlib_lite.py_multiple alignment object.
    '''

    import alignlib_lite
    m = alignlib_lite.py_makeMultipleAlignment()
    for identifier in mali.getIdentifiers():
        a = alignlib_lite.py_makeAlignatum(mali[identifier])
        m.add(a)
    return m
Esempio n. 5
0
def readPicasso(infile):
    """read alignment in the non-defined picasso format.
    """

    mali = alignlib_lite.py_makeMultipleAlignment()

    while 1:
        line = infile.readline()
        if not line: break

        x = re.search("\d+\s+([A-Z\-\.]*)\s+\d+", line)
        if x:
            s = x.groups()[0]
            a = alignlib_lite.py_makeAlignatumFromString(s)
            a.thisown = 0
            mali.addAlignatum(a)

    return mali
Esempio n. 6
0
def readPicasso( infile ):
    """read alignment in the non-defined picasso format.
    """

    mali = alignlib_lite.py_makeMultipleAlignment()

    while 1:
        line = infile.readline()
        if not line: break

        x = re.search( "\d+\s+([A-Z\-\.]*)\s+\d+", line)
        if x:
            s = x.groups()[0]
            a = alignlib_lite.py_makeAlignatumFromString(s)
            a.thisown = 0
            mali.addAlignatum( a )
            
    return mali