{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import urllib" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "url = 'ftp://ftp.ncbi.nlm.nih.gov/genomes/Bacteria/Citrobacter_rodentium_ICC168_uid43089/NC_013716.ffn'" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "('tmp.ffn', )" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "urllib.request.urlretrieve(url, 'tmp.ffn')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "with open('tmp.ffn') as f:\n", " ffn = f.read()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ">gi|283783779|ref|NC_013716.1|:166-231 Citrobacter rodentium ICC168 chromosome, complete genome\n", "ATGA\n" ] } ], "source": [ "print(ffn[:100])" ] }, { "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.3.5" } }, "nbformat": 4, "nbformat_minor": 0 }