This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Sequence similarity networks with python

How to build sequence similarity networks within python? Pythoscape seems no longer available and biopython pairwise does not seem the most suitable for thousands of sequences. Any ideas? Thank you

sequence networks similarity

1 answer

There are lots of algorithms out there for aligning sequences, both pairwise alignments and multiple sequence alignments. These calculations are relatively slow, and you generally wouldn’t want to write such an algorithm in Python. Instead, you can use Biopython to invoke a command line tool on your behalf.

From Biopython-readthedocks.

Thank you, somehow I didn't find that page before or didn't understand how useful it is to my problem.

Nevertheless, in the meantime, I did a blastp pairwise alignment and I leave the steps here as it might be useful to someone. It is a half baked solution as it seems to duplicate the workload (the same sequence pairs are calculated twice) and it automatically chooses only sequences that produce significant alignments (not all sequences you provide)

1 - prepare a database of all desired sequences

makeblastdb -in All_seqs.fasta -dbtype prot -out my_prot_blast_db

2 - pairwise alignment

blastp -db my_prot_blast_db -query All_seqs.fasta -out all-vs-all.tsv -num_threads 8

I will now try Biopython’s command line wrapper for EMBOSS

Log in to answer this question.