Skip to Content
Bioinformatics with Python Cookbook
book

Bioinformatics with Python Cookbook

by Tiago Antao
June 2015
Intermediate to advanced
306 pages
6h 50m
English
Packt Publishing
Content preview from Bioinformatics with Python Cookbook

Thinking with generators

Writing generator functions is quite easy, but more importantly, they allow you to write different dialects of code that are more expressive and easier to change. Here, we will compute the GC skew of the first 1000 records of a FASTQ file with and without generators discussed in the preceding recipe. We will then change the code to add a filter (the median nucleotide quality has to be 40 or higher). This allows you to see the extra code writing style that generators allow you in the presence code changes.

Getting ready

You should get the data as in the previous recipe, but in this case, you only need the first file called SRR003265_1.filt.fastq.gz.

As usual, this is available in the 08_Advanced/Generators.ipynb notebook. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Bioinformatics with Python Cookbook - Second Edition

Bioinformatics with Python Cookbook - Second Edition

Tiago Antao
Machine Learning Using TensorFlow Cookbook

Machine Learning Using TensorFlow Cookbook

Alexia Audevart, Konrad Banachewicz, Luca Massaron

Publisher Resources

ISBN: 9781782175117