{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Wed Apr 27 16:12:57 PDT 2016\r\n" ] } ], "source": [ "!date" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Software:\n", "\n", " System Software Overview:\n", "\n", " System Version: OS X 10.9.5 (13F34)\n", " Kernel Version: Darwin 13.4.0\n", " Boot Volume: Hummingbird\n", " Boot Mode: Normal\n", " Computer Name: hummingbird\n", " User Name: Sam (Sam)\n", " Secure Virtual Memory: Enabled\n", " Time since boot: 9 days 6:19\n", "\n" ] } ], "source": [ "%%bash\n", "system_profiler SPSoftwareDataType" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", " Model Name: Xserve\n", " Model Identifier: Xserve3,1\n", " Processor Name: Quad-Core Intel Xeon\n", " Processor Speed: 2.26 GHz\n", " Number of Processors: 2\n", " Total Number of Cores: 8\n", " L2 Cache (per Core): 256 KB\n", " L3 Cache (per Processor): 8 MB\n", " Memory: 24 GB\n", " Processor Interconnect Speed: 5.86 GT/s\n", " Boot ROM Version: XS31.0081.B06\n", " SMC Version (system): 1.43f4\n", " LOM Revision: 1.1.8\n", "\n" ] } ], "source": [ "%%bash\n", "#Uses grep to exclude lines that display serial number and hardware UUID\n", "system_profiler SPHardwareDataType | grep -v [SH][ea]" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "### Add to md5 checksums file" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\n", "real\t12m58.000s\n", "user\t1m44.985s\n", "sys\t0m28.281s\n" ] } ], "source": [ "%%bash\n", "\n", "#For loop generates a md5 checksum has value for each file\n", "#and appends the output to the checksums.md5 file.\n", "time for file in /Volumes/owl_web/nightingales/O_lurida/20160223_gbs/160123_I132_FCH3YHMBBXX_L4_OYSzenG1AAD96FAAPEI-109_[12].fq.gz\n", " do\n", " md5 \"$file\" >> /Volumes/owl_web/nightingales/O_lurida/20160223_gbs/checksums.md5\n", " done" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Calculate total number of reads generated by this project.\n", "\n", "###Calculate number of reads per file, append filename and corresponding number of reads to readme file." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "160123_I132_FCH3YHMBBXX_L4_OYSzenG1AAD96FAAPEI-109_1.fq.gz\t364261046\n", "\n", "160123_I132_FCH3YHMBBXX_L4_OYSzenG1AAD96FAAPEI-109_2.fq.gz\t364261046\n", "\n", "728522092\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n", "real\t29m40.999s\n", "user\t18m34.488s\n", "sys\t1m58.738s\n" ] } ], "source": [ "%%bash\n", "\n", "#Initializes variable.\n", "totalreads=0\n", "\n", "#For loop counts the lines in each file and divides them by four. This is performed because\n", "#Illumina sequencing files are composed of four lines per read.\n", "#A running total of the total number of reads is generated [totalreads=$((readcount+totalreads))]\n", "#and is printed after the for loop completes.\n", "\n", "#Format the output (printf) to print the filename, followed by a tab, followed by the readcount.\n", "#The command \"tee -a\" is used to both print the output to the screen and append the output to the readme.md file.\n", "time for file in /Volumes/owl_web/nightingales/O_lurida/20160223_gbs/160123_I132_FCH3YHMBBXX_L4_OYSzenG1AAD96FAAPEI-109_[12].fq.gz\n", " do linecount=`gunzip -c \"$file\" | wc -l`\n", " readcount=$((linecount/4))\n", " totalreads=$((readcount+totalreads))\n", " printf \"%s\\t%s\\n\\n\" \"${file##*/}\" \"$readcount\" | tee -a /Volumes/owl_web/nightingales/O_lurida/20160223_gbs/readme.md\n", "done\n", "echo $totalreads\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }