1
$\begingroup$

I would like to know what would be the best way to generate a full-length consensus sequence?

I want to obtain a single representative sequence from a relatively gappy multiple sequence alignment of peptides.

See example below.

So far I have attempted Consensus.py from https://github.com/jrjhealey/bioinfo-tools but it just gives me gaps, even with a threshold close to zero.

>HX5_33766:7:1222:1022:72139
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------SEEL---SLSLYYRKGRGPLF-------SLSKVTSVDSIGVAYLAFKDKVYFNVT--------------------------------------------
>HX5_33766:7:1211:6319:29841
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMKVQDNSIIINCDGY------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1222:1022:72139.2
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------SEEL---SLSLYYRKGRGPLF-------SLSKVTSVDSIGVAYLAFKDKVYFNVT--------------------------------------------
>HX5_33766:7:1219:12723:20928.1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------T-ISTSYKDIQVNGGELILIHQNPGGFCAY--------------
>HX5_33766:7:1119:11069:37612
----------------------------------------------------------------------------------------------------------------------------------------VLLGAAIIQGLGLLLC--F----------------------TYI----------------------CLHFYASQ-V----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1219:12723:20928
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------T-ISTSYKDIQVNGGELILIHQNPGGFCAY--------------
>HX5_33766:7:1211:6319:29841.2
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMKVQDNSIIINCDGY------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1219:12723:20928.2
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------T-ISTSYKDIQVNGGELILIHQNPGGFCAY--------------
>HX5_33766:7:1107:2564:39757
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------VFSLKGYFSEEL---SLSLYYRKGRGPLF-------SLSKVTSVDSIGVAYLAFK----------------------------------------------------
>HX5_33766:7:1211:6319:29841.1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMKVQDNSIIINCDGY------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1212:30371:5686
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMKVQDNSIXLGCN--------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1119:11069:37612.2
----------------------------------------------------------------------------------------------------------------------------------------VLLGAAIIQGLGLLLC--F----------------------TYI----------------------CLHFYASQ-V----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1212:30371:5686.2
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMKVQDNSIXLGCN--------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1221:10013:25165
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMK-------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1221:10013:25165.2
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMK-------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1106:31832:24286
----------------------------------------------------------------------SVYLRL--IVFP-PSPPLWRRG---QSP------SGLLPFATV-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1117:3691:48881
-------------------------------------------------------------------------------VFP-PSPPLWRRG---QSP------SGLLPFATV-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1221:9364:63314
-------------------------------GKFRLVTKKFPRLPAEAAVLKLRECVLLFQLPLISAPGTSVYLR---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1221:10013:25165.1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMK-------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1221:9364:63314.2
-------------------------------GKFRLVTKKFPRLPAEAAVLKLRECVLLFQLPLISAPGTSVYLR---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1212:30371:5686.1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CENEKGCIITSPSKDETMKVQDNSIXLGCN--------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1221:9364:63314.1
-------------------------------GKFRLVTKKFPRLPAEAAVLKLRECVLLFQLPLISAPGTSVYLR---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1119:11069:37612.1
----------------------------------------------------------------------------------------------------------------------------------------VLLGAAIIQGLGLLLC--F----------------------TYI----------------------CLHFYASQ-V----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1107:2564:39757.1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------VFSLKGYFSEEL---SLSLYYRKGRGPLF-------SLSKVTSVDSIGVAYLAFK----------------------------------------------------
>HX5_33766:7:1106:31832:24286.1
----------------------------------------------------------------------SVYLRL--IVFP-PSPPLWRRG---QSP------SGLLPFATV-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1117:3691:48881.1
-------------------------------------------------------------------------------VFP-PSPPLWRRG---QSP------SGLLPFATV-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1222:1022:72139.1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------SEEL---SLSLYYRKGRGPLF-------SLSKVTSVDSIGVAYLAFKDKVYFNVT--------------------------------------------
>HX5_33766:7:1107:2564:39757.2
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------VFSLKGYFSEEL---SLSLYYRKGRGPLF-------SLSKVTSVDSIGVAYLAFK----------------------------------------------------
>HX5_33766:7:1106:31832:24286.2
----------------------------------------------------------------------SVYLRL--IVFP-PSPPLWRRG---QSP------SGLLPFATV-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1117:3691:48881.2
-------------------------------------------------------------------------------VFP-PSPPLWRRG---QSP------SGLLPFATV-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1121:4320:48213
MTVISQSLKSELECHKNNSLLAQ-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1121:4320:48213.1
MTVISQSLKSELECHKNNSLLAQ-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1121:4320:48213.2
MTVISQSLKSELECHKNNSLLAQ-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1214:16701:50287
----------------------------------------------------------------------------------------------------------------------------------------------R--KQR--EXPKIEQLSAFTRSRSPESAFSNNHSVTYFHTLWGD------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>HX5_33766:7:1220:24545:3085
------------------------------------------------------------------------------------------------------------------------------------------------------------------RSRSPESAFSNNHSVTYFHTLWGD-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------R
$\endgroup$
0

2 Answers 2

1
$\begingroup$

Given the alignment you've presented, there are obvious groups of sequence similarity, but I'm seeing a lot of different peptide sequences in this (e.g. CENEKGCIITSPSKDETMKVQDNSIXLGCN and GKFRLVTKKFPRLPAEAAVLKLRECVLLFQLPLISAPGTSVYLR as two obviously different peptides). Have you done a pre-filter for similarity to make sure you're looking at the same proteins for alignment?

Multiple alignment will not work properly with peptides that are very different from each other. You need to group proteins based on similarity first (e.g. with Linclust), then carry out multiple alignments within the groups.

$\endgroup$
0
$\begingroup$
from Bio import AlignIO
from pathlib import Path
from Bio.Align import AlignInfo

path = '/my/path/'
test1 = 'testset.fa'
mypath = Path(path,test1)

myalign = AlignIO.read(mypath, "fasta")
summary = AlignInfo.SummaryInfo(myalign)
consensus = summary.dumb_consensus()
print (consensus)

This will give a single consensus and 'X' low prevalence ambiguity. Easy to check whether its what is required because the code is ready to go.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.