Skip to Content
Bioinformatics with Python Cookbook - Second Edition
book

Bioinformatics with Python Cookbook - Second Edition

by Tiago Antao
November 2018
Intermediate to advanced
360 pages
9h 36m
English
Packt Publishing
Content preview from Bioinformatics with Python Cookbook - Second Edition

How to do it...

Take a look at the following steps:

  1. We will now run MAFFT to align the genomes, as shown in the following code. This task is CPU-intensive and memory-intensive, and will take quite some time:
from Bio.Align.Applications import MafftCommandlinemafft_cline = MafftCommandline(input='sample.fasta', ep=0.123, reorder=True, maxiterate=1000, localpair=True)print(mafft_cline)stdout, stderr = mafft_cline()with open('align.fasta', 'w') as w:    w.write(stdout)

The parameters are the same as the ones specified in the supplementary material of the paper. We will use the Biopython interface to call MAFFT.

  1. Let's use trimAl to trim sequences, as follows:
os.system('trimal -automated1 -in align.fasta -out trim.fasta -fasta')

Here, we just ...

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

Bioinformatics with Python Cookbook

Tiago Antao

Publisher Resources

ISBN: 9781789344691Supplemental Content