Skip to content

Instantly share code, notes, and snippets.

@idolawoye
Last active December 7, 2022 20:08
Show Gist options
  • Select an option

  • Save idolawoye/bc483e81480c9b7e9be812e4d8075986 to your computer and use it in GitHub Desktop.

Select an option

Save idolawoye/bc483e81480c9b7e9be812e4d8075986 to your computer and use it in GitHub Desktop.
One liner to print out percentage of reads from a Kraken report file
grep -w -F -f taxon.txt *report.txt | awk 'BEGIN{OFS="\t"}{ print $1,$2}' > tb.txt
# taxon.txt is a file containing the Taxon name you want to summarize, e.g: Mycobacterium tuberculosis complex
# *.report.txt is the wildcard for selecting multiple Kraken report files
# tb.txt is the output TSV file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment