# How to get % similarity between strains and mutation files

I’m very new to python, and having some difficulty getting hang of some more complicated things

I have multiple files which look like so:

hCoV-19/Singapore/4/2020|EPI_ISL_410535|2020-02-03

hCoV-19/USA/WA13-UW9/2020|EPI_ISL_413601|2020-03-02

hCoV-19/USA/WA-UW142/2020|EPI_ISL_416680|2020-03-11

Please be aware that the lines above are meant to be one file

I want to extract the EPI_ISL_000000 for an easy comparison among files.

1. A programme to extract this data into new files (There’s many lines in each file - 1000+)

2. A programme to then give a % comparison between two or more files - comparing all lines in one file against all lines in a second+ file

• Anyway I get it, the first part is reg-ex, either via Python's re module, sed or a perl onliner. The second part, is easier to do in MEGA X.
– M__
Oct 13, 2020 at 17:15
• I have now figured this out, thank you! Oct 14, 2020 at 20:40
• If you have figured it out please answer your own question and accept it. thank you. Dec 1, 2020 at 10:34
• I didn't study this subject... however, the percentage between two organisms may depend heavily on local protein aligniments and the same other active genetic material (because not active rna or not protein make rna has to have weight 0) Dec 2, 2020 at 7:26
• compile proteins of virus1 compile proteins of virus2 search % equality of proteins of the 2 viruses... or align the genome of 2 viruses and find uguagliance i don't know what number is more significative Dec 11, 2020 at 18:10

   left_lineagelist = [x.split('_')[-1].split('|')[0]

for line in lines: