Question: biopython format_alignment gives incorrect output when submit job to the cluster
0
gravatar for wangyunfeng0317
18 months ago by
wangyunfeng03170 wrote:

Dear all, I try to call mutations comparing one contig to the reference sequence using pairwise alignment. Biopython provides a perfect package which is called pairwise2 and format_alignment. When I run my script everything goes fine and it gives an output like this

ACCCCACGCCC
|||||.|||||  
ACCCCCCGCCC
Score=46

But when I submit my script to the cluster which uses the PBS system, the output seems kind of incorrect as follows.

ACCCCACGCCC
|||||||||||  
ACCCCCCGCCC
Score=46

There are no error messages at all. And I have no idea why the output changes when I submit it to the cluster. I guess this might be a bug of the function format_alignment. It's really hard for me to find the SNP with my own eyes using a result like this.

Can anyone help me to solve this problem? Many thanks!

ADD COMMENTlink modified 18 months ago by Joe18k • written 18 months ago by wangyunfeng03170

Hi wangyunfeng0317,

Try to explicitly use python 3 in the script which you submitted to the PBS system.

When using python 3, the following results:

A-CCCCACGCCC
| |||| |||||
ACCCCC-CGCCC
  Score=10

ACCCCACGCCC
|||||.|||||
ACCCCCCGCCC
  Score=10

Will become these using python 2:

A-CCCCACGCCC
||||||||||||
ACCCCC-CGCCC
  Score=10

ACCCCACGCCC
|||||||||||
ACCCCCCGCCC
  Score=10
ADD REPLYlink modified 18 months ago • written 18 months ago by AK1.9k

I think it's more likely that the system python (which may happen to be Py2) is looking at an out of date BioPython library. pairwise2 was rewritten in 1.68 I believe.

Can you please let us know what versions you're using 'locally' and what versions the scheduler picks when it launches the script/program?

ADD REPLYlink written 18 months ago by Joe18k

👍 Indeed, from 3 April 2018: Biopython 1.71:

The output of function format_alignment in Bio.pairwise2 for displaying a pairwise sequence alignment as text now indicates gaps and mis-matches.

ADD REPLYlink written 18 months ago by AK1.9k

Dear jrj.healey, thanks for your quick answer. My local python version is 3.7.3. And this time I specify the absolute path of my python3 in the script to be submitted and everything goes fine!! So I guess you're right. The python will try to look at an out of date library if I do not specify the full path.

ADD REPLYlink written 18 months ago by wangyunfeng03170
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1205 users visited in the last hour