Chapter 15. Seqmagique: Creating and Formatting Reports
Often in bioinformatics projects, youâll find yourself staring at a directory full of sequence files, probably in FASTA or FASTQ format. Youâll probably want to start by getting an idea of the distribution of sequences in the files, such as how many are in each file and the average, minimum, and maximum lengths of the sequences. You need to know if any files are corruptedâmaybe they didnât transfer completely from your sequencing centerâor if any samples have far fewer reads, perhaps indicating a bad sequencing run that needs to be redone. In this chapter, Iâll introduce some techniques for checking your sequence files using hashes and the Seqmagick tool. Then Iâll write a small utility to mimic part of Seqmagick to illustrate how to create formatted text tables. This program serves as a template for any program that needs to process all the records in a given set of files and produce a table of summary statistics.
You will learn:
How to install the
How to use MD5 hashes
How to use
argparseto constrain arguments
How to use the
How to mock a filehandle
How to use the
richmodules to format output tables
Using Seqmagick to Analyze Sequence Files
seqmagick is a useful command-line utility for handling sequence files.
This should have been installed along with the other Python modules if you followed the setup instructions in the Preface. If not, ...
Get Mastering Python for Bioinformatics now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.