biopython format_alignment gives incorrect output when submit job to the cluster
0
0
Entering edit mode
4.9 years ago

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!

sequence software error snp alignment • 1.1k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

👍 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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1619 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6