Skip to content

Instantly share code, notes, and snippets.

@Ken-Kuroki
Created August 2, 2018 09:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ken-Kuroki/e36264ebd7c59f8810cbee2236e23dfb to your computer and use it in GitHub Desktop.
Save Ken-Kuroki/e36264ebd7c59f8810cbee2236e23dfb to your computer and use it in GitHub Desktop.
Read a BLAST output and generate a pandas dataframe
import pandas as pd
def read_blast_output(output):
"""Reads BLAST output (outfmt 6) and returns a pandas dataframe."""
return pd.read_csv(output,
sep="\t",
names=["qseqid", "sseqid", "pident", "length", "mismatch", "gapopen", "qstart", "qend", "sstart", "send", "evalue", "bitscore"],
index_col="qseqid")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment