VisiData is a terminal application for exploring and analyzing tabular data. It is a powerful tool for data manipulation and visualization

visidata

VisiData is handy as it let us quickly check some tabular data without needing to download the file.

Genomad Output

This tutorial will guide you through using VisiData (vd) to analyze the output of genomad, which is a TSV file with the following columns:

  • seq_name,
  • length,
  • topology,
  • coordinates,
  • n_genes,
  • genetic_code,
  • virus_score,
  • fdr,
  • n_hallmarks,
  • marker_enrichment,
  • taxonomy

Getting Started

  1. Open your terminal and navigate to the directory containing your genomad output file.
  2. Launch VisiData by typing: vd FILENAME

example:

vd ~/genomad-out/human_gut_assembly_summary/human_gut_assembly_virus_summary.tsv

Basic Navigation

  • Use arrow keys to move around the spreadsheet.
  • You can use your mouse!
  • Press q to quit VisiData (you’ll be prompted to confirm).
  • When opening a different view, press Esc to go back or undo an action

Setting Column Types and sorting

  1. Move to the “length” column.
  2. Press # to set it as an integer type.
  3. Move to the “virus_score” column.
  4. Press % to set it as a float type.
  5. Now you can sort these columns using [ and ]

Frequency Analysis

  1. Move to the “topology” column.
  2. Press Shift+F to show frequency.
  3. This will create a new sheet showing the frequency of each unique value in the topology column.
  4. Use Esc to return to the main sheet.

Selecting Columns by Pattern

Let’s select rows in the “coordinates” column with “NA” as a value and remove them:

  1. Move to the “coordinates” column.
  2. Press | (pipe character) to open the select menu.
  3. Type NA and press Enter. This selects all rows where “coordinates” is “NA”.
  4. Press d to delete the selected rows.
  5. Press Enter to confirm the deletion.

Tips

  • Use Shift+? to open the help menu for a full list of commands.
  • Press Ctrl+Q to quit without saving changes, or Shift+S to save your work.

Remember, Esc is your friend! Use it whenever you want to go back or undo an action.


Next submodule: