Ejemplo n.º 1
0
def get_response_content(fs):
    headers, sequences = Phylip.decode(fs.phylip.splitlines())
    if fs.name not in headers:
        raise ValueError('the name was not found')
    new_pairs = [(h, s) for h, s in zip(headers, sequences) if h != fs.name]
    new_headers, new_sequences = zip(*new_pairs)
    return Phylip.encode(new_headers, new_sequences) + '\n'
Ejemplo n.º 2
0
def get_response_content(fs):
    headers, sequences = Phylip.decode(fs.phylip.splitlines())
    if fs.name not in headers:
        raise ValueError('the name was not found')
    new_pairs = [(h, s) for h, s in zip(headers, sequences) if h != fs.name]
    new_headers, new_sequences = zip(*new_pairs)
    return Phylip.encode(new_headers, new_sequences) + '\n'
Ejemplo n.º 3
0
def process(fs, raw_lines):
    headers, sequences = Phylip.decode(raw_lines)
    binary_rows = Carbone.get_binary_rows(sequences)
    if fs.hud:
        return hud.encode(headers, binary_rows) + '\n'
    elif fs.phy:
        binary_seqs = [''.join(str(x) for x in row) for row in binary_rows]
        return Phylip.encode(headers, binary_seqs) + '\n'
Ejemplo n.º 4
0
def get_response_content(fs):
    headers, sequences = Phylip.decode(fs.phylip.splitlines())
    new_pairs = sorted(zip(headers, sequences))
    new_headers, new_sequences = zip(*new_pairs)
    return Phylip.encode(new_headers, new_sequences) + '\n'
Ejemplo n.º 5
0
def get_response_content(fs):
    headers, sequences = Phylip.decode(fs.phylip.splitlines())
    new_pairs = sorted(zip(headers, sequences))
    new_headers, new_sequences = zip(*new_pairs)
    return Phylip.encode(new_headers, new_sequences) + '\n'
Ejemplo n.º 6
0
def get_response_content(fs):
    headers, data_rows = hud.decode(fs.table.splitlines())
    sequences = [''.join(str(x) for x in row) for row in data_rows]
    return Phylip.encode(headers, sequences)
Ejemplo n.º 7
0
def get_response_content(fs):
    headers, data_rows = hud.decode(fs.table.splitlines())
    sequences = [''.join(str(x) for x in row) for row in data_rows]
    return Phylip.encode(headers, sequences)