def format_kraken2_report_row(report_node):
    """
    Formats the row that will be output in the kraken 2 style report. Input
    is an instance of ReportNode.
    """
    offset = 2 * report_node.offset * ' '
    name = offset + report_node.name

    if report_node.rank_depth == 0:
        rank_depth = ''
    else:
        rank_depth = str(report_node.rank_depth)

    rank_code = report_node.rank_code + rank_depth
    report_row = '\t'.join([
        str(report_node.ratio),
        str(report_node.hits_at_clade),
        str(report_node.hits_at_node),
        rank_code,
        str(report_node.node_taxid),
        name])

    return report_row