# -*- coding: utf-8 -*- """ Created on Wed Nov 13 13:12:14 2019 @author: ASUS """ #program converts FASTA file format[uni"\t"seq] to lowercase n uppercase according to g d s l properites n will make 15 different combinations of gdsl g=['E','I','K','L','M','P','Q','R','T','V'] d=['C','H','K','N','Q','R','S','T','W','Y'] s=['A','C','D','G','I','M','N','S','T','V'] l=['A','D','E','F','H','K','M','P','S','W','Y'] gd=['K','Q','R','T'] gs=['I','M','T','V'] gl=['E','K','M','P'] ds=['C','N','S','T'] dl=['H','K','S','W','Y'] ls=['A','D','M','S'] gds=['T'] dsl=['S'] lgd=['K'] slg=['M'] gdsl=[''] newstring1="" newstring2="" newstring3="" newstring4="" newstring5="" newstring6="" newstring7="" newstring8="" newstring9="" newstring10="" newstring11="" newstring12="" newstring13="" newstring14="" newstring15="" fo1=open(r'G.fasta','w+') fo2=open(r'D.fasta','w+') fo3=open(r'S.fasta','w+') fo4=open(r'L.fasta','w+') fp1=open( r'file') for line in fp1: row = line.rstrip('\n').split('\t') uni = row[0] for aa in row[1]: if aa in g: newstring1+=aa else: newstring1+=(aa.lower()) fo1.write(row[0]+"\n"+str(newstring1)+"\n") fo1.read() newstring1="" fp2=open( r'file') for line in fp2: row = line.rstrip('\n').split('\t') for aa in row[1]: if aa in d: newstring2+=aa else: newstring2+=(aa.lower()) fo2.write(row[0]+"\n"+str(newstring2)+"\n") newstring2="" fp3=open( r'file') for line in fp3: row = line.rstrip('\n').split('\t') for aa in row[1]: if aa in s: newstring3+=aa else: newstring3+=(aa.lower()) fo3.write(row[0]+"\n"+str(newstring3)+"\n") newstring3="" fp4=open( r'file') for line in fp4: row = line.rstrip('\n').split('\t') for aa in row[1]: if aa in l: newstring4+=aa else: newstring4+=(aa.lower()) fo4.write(row[0]+"\n"+str(newstring4)+"\n") newstring4=""