{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "try:\n", " from pydna.dseqrecord import Dseqrecord\n", "except ImportError:\n", " import sys, os\n", "\n", " sys.path.append(os.pardir)\n", " from pydna.dseqrecord import Dseqrecord" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import os\n", "import glob" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "try:\n", " os.remove(\"file_written_from_notebook.gb\")\n", "except OSError:\n", " pass" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "a = Dseqrecord(\"aaa\")\n", "b = Dseqrecord(\"aat\")\n", "c = Dseqrecord(\"gatc\", circular=True)\n", "d = Dseqrecord(\"cgat\", circular=True)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/html": [ "file_written_from_notebook.gb
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "a.write(\"file_written_from_notebook.gb\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "file_written_from_notebook.gb
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "a.write(\"file_written_from_notebook.gb\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Sequence change
Filenamefile_written_from_notebook.gbfile_written_from_notebook_OLD_1655289561651489.gb
Saved2022-06-15T11:39:21.6529172022-06-15T11:39:21.632917
Length33
uSEGUIDzoN2ivDc-BPzP5i2HQsz8Nuzei4YG7G6b2Kj_KtFOX63j8mRHHoIlE
cSEGUIDnana
\n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# NBVAL_IGNORE_OUTPUT\n", "b.write(\"file_written_from_notebook.gb\")" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Sequence change
Filenamefile_written_from_notebook.gbfile_written_from_notebook_OLD_1655289561672325.gb
Saved2022-06-15T11:39:21.6769172022-06-15T11:39:21.652917
Length43
uSEGUIDdYoa6Z6T6WtPxu5msRTifUobfm0zoN2ivDc-BPzP5i2HQsz8Nuzei4
cSEGUIDPFiExZ1FSAgzedZCcdwM-HLe4MQna
\n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# NBVAL_IGNORE_OUTPUT\n", "c.write(\"file_written_from_notebook.gb\")" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Sequence change
Filenamefile_written_from_notebook.gbfile_written_from_notebook_OLD_1655289561695830.gb
Saved2022-06-15T11:39:21.6929172022-06-15T11:39:21.676917
Length44
uSEGUIDXG3mGK1SDpsldBH9UzYLxPUQmTEdYoa6Z6T6WtPxu5msRTifUobfm0
cSEGUIDPFiExZ1FSAgzedZCcdwM-HLe4MQPFiExZ1FSAgzedZCcdwM-HLe4MQ
\n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# NBVAL_IGNORE_OUTPUT\n", "d.write(\"file_written_from_notebook.gb\")" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "os.remove(\"file_written_from_notebook.gb\")" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "for filePath in glob.glob(\"file_written_from_notebook_OLD_*\", recursive=False):\n", " try:\n", " os.remove(filePath)\n", " except OSError:\n", " print(\"Error while deleting file\")" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [conda env:bjorn38]", "language": "python", "name": "conda-env-bjorn38-py" }, "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.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }