Supplementary data 2. Selection of strobilated-related orthogroups. Script used to select the orthogroups with sequences from all 5 assessed cestode species, but without at least one of the assessed trematode species. #Filter 2: Selects orthogroups files that have all 5 species of cestodes but not all species of trematodes. #Input: files in fasta format from Platyhelminthes folder; #Output: writes the fasta files in AllCestodes folder. from numpy import * import os, sys from os.path import join as pjoin def read_FASTA (filename): with open (filename) as file: return file.read()[0:] def TremTest(names) resp = True if ‘>Csi’ in names: if ‘>Ovi’ in names: if ‘>Sha’ in names: if ‘>Sma’ in names: if ‘>Sja’ in names: resp = False return resp file_names = os.listdir('/home/Platyhelminthes') for f in range (file_names): data = read_FASTA(f) data_names = [] for x in (data): if (x != ’’): if (x[0] == ’>’): data_names = data_names + [x] if ‘>Egr’ in data_names: if ‘>Emu’ in data_names: if ‘>Tso’ in data_names: if ‘>Hmi’ in data_names: if ‘>Mco’ in data_names: if (TremTest(data_names)): new = raw_input(f) filepath = '/home/AllCestodes' file = open(filepath, “w”) file.write(data) file.close