{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from IPython.display import display\n", "class Fasta:\n", " def __init__(self, data):\n", " self.data = data\n", " def _ipython_display_(self):\n", " bundle = {\n", " 'application/vnd.fasta.fasta': self.data,\n", " 'text/plain': self.data\n", " }\n", " display(bundle, raw=True)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "with open('../data/zika_assembled_genomes.fasta') as f:\n", " data = f.read()\n", "Fasta(data)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }