phylogenetics/tools/df_editor.py
def trim_sequence(df,uid,start=0,end=None):
    """
    Trim a sequence at specified indexes.

    uid: unique phylopandas identifier for sequence.
    start: slice start
    end: slice end

    returns: copy of dataframe with trimmed sequence replacing current
             sequence
    """

    _check_uid(df,uid)

    new_df = df.copy()

    new_sequence = new_df[new_df.uid == uid].sequence.tolist()[0][start:end]
    i = new_df[new_df.uid == uid].index[0]
    new_df.at[i,"sequence"] = new_sequence

    return new_df

    Trim a sequence at specified indexes.

    uid: unique phylopandas identifier for sequence.
    start: slice start
    end: slice end

    returns: copy of dataframe with trimmed sequence replacing current
             sequence
    
Trim a sequence at specified indexes.
uid: unique phylopandas identifier for sequence.
start: slice start
end: slice end

copy of dataframe with trimmed sequence replacing current
sequence
Trim a sequence at specified indexes . uid : unique phylopandas identifier for sequence . start : slice start end : slice end copy of dataframe with trimmed sequence replacing current sequence
def trim_sequence(df,uid,start=0,end=None):
    _check_uid(df,uid)
    new_df = df.copy()
    new_sequence = new_df[new_df.uid == uid].sequence.tolist()[0][start:end]
    i = new_df[new_df.uid == uid].index[0]
    new_df.at[i,"sequence"] = new_sequence
    return new_df
def trim_sequence ( df , uid , start = 0 , end = None ) : _check_uid ( df , uid ) new_df = df . copy ( ) new_sequence = new_df [ new_df . uid == uid ] . sequence . tolist ( ) [ 0 ] [ start : end ] i = new_df [ new_df . uid == uid ] . index [ 0 ] new_df . at [ i , "sequence" ] = new_sequence return new_df
Trim a sequence at specified indexes.
Trim a sequence at specified indexes .
"""
    Trim a sequence at specified indexes.

    uid: unique phylopandas identifier for sequence.
    start: slice start
    end: slice end

    returns: copy of dataframe with trimmed sequence replacing current
             sequence
    """
df
uid
start
end