comparison PDAUG_TSVtoFASTA/PDAUG_TSVtoFASTA.py @ 2:bc6aef6ec2d4 draft

"planemo upload for repository https://github.com/jaidevjoshi83/pdaug commit 8b18552f6d2b2261efebe1075ff4c18a295b94dd"
author jay
date Tue, 29 Dec 2020 18:38:48 +0000
parents 9b5e990a0ebb
children b2a7b957cd52
comparison
equal deleted inserted replaced
1:9b5e990a0ebb 2:bc6aef6ec2d4
19 19
20 for line in lines[1:]: 20 for line in lines[1:]:
21 l.append(line.split('\t')[1].strip('\n').strip('\r')) 21 l.append(line.split('\t')[1].strip('\n').strip('\r'))
22 l = list(set(l)) 22 l = list(set(l))
23 23
24 print(l)
25
24 for line in lines: 26 for line in lines:
25 27
26 if l[0] in line.split('\t')[1].strip('\n').strip('\r'): 28 if l[1] in line.split('\t')[1].strip('\n').strip('\r'):
27 n= n+1 29 n= n+1
28 of1.write('>peptide_'+str(n)+'_'+str(l[0])+'\n') 30 of1.write('>peptide_'+str(n)+'_'+str(l[0])+'\n')
29 of1.write(line.split('\t')[0]+'\n') 31 of1.write(line.split('\t')[0]+'\n')
30 32
31 if l[1] in line.split('\t')[1].strip('\n').strip('\r'): 33 if l[0] in line.split('\t')[1].strip('\n').strip('\r'):
32 m= m+1 34 m= m+1
33 of2.write('>peptide_'+str(m)+'_'+str(l[1])+'\n') 35 of2.write('>peptide_'+str(m)+'_'+str(l[1])+'\n')
34 of2.write(line.split('\t')[0]+'\n') 36 of2.write(line.split('\t')[0]+'\n')
35 37
36 elif Method == 'NoClassLabel': 38 elif Method == 'NoClassLabel':