Skip to content

Commit dfba4c0

Browse files
setup review and updates to coloring
1 parent 088ddde commit dfba4c0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

scripts/color_peptides51mer.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,25 @@ def annotate_every_nucleotide(sequence, classI_peptide, classII_peptide):
110110

111111
return(peptide_sequence)
112112

113-
def set_underline(peptide_sequence, mutant_peptide_pos):
113+
def set_underline(peptide_sequence, mutant_peptide_pos, row_ID):
114114

115115
frameshift = False
116116
classI_position = 0
117117

118+
print(row_ID)
118119
if '-' in mutant_peptide_pos:
119-
120120
positions = mutant_peptide_pos.split("-")
121-
122121
start_position = int(positions[0])
123122
end_position = int(positions[1])
124123

125124
frameshift = True
125+
126126

127127
else:
128128
mutant_peptide_pos = int(mutant_peptide_pos)
129129

130+
131+
130132
if frameshift:
131133

132134
continue_underline = False
@@ -249,8 +251,10 @@ def main():
249251
# Create a universal ID by editing the peptide 51mer ID
250252
peptides_51mer.rename(columns={'ID': 'full ID'}, inplace=True)
251253
peptides_51mer['ID'] = peptides_51mer['full ID']
254+
print()
252255

253256
peptides_51mer['ID'] = peptides_51mer['ID'].apply(lambda x: '.'.join(x.split('.')[1:])) # Removing before first period, periods will be removed
257+
254258
peptides_51mer['ID'] = peptides_51mer['ID'].apply(lambda x: '.'.join(x.split('.')[1:])) # Removing before second period
255259
peptides_51mer['ID'] = peptides_51mer['ID'].apply(lambda x: '.'.join(x.split('.')[:3]) + '.' + '.'.join(x.split('.')[4:]))
256260

@@ -323,7 +327,9 @@ def main():
323327
# actaully lets break class I and classII into two steps and handle the mutated nucleotide in class I function
324328
# it should be basically like at that position in the class I set
325329

326-
set_underline(peptide_sequence, mutant_peptide_pos)
330+
print(row['full ID'])
331+
print(mutant_peptide_pos)
332+
set_underline(peptide_sequence, mutant_peptide_pos, row['full ID'])
327333

328334
set_span_tags(peptide_sequence) # pass by reference
329335

0 commit comments

Comments
 (0)