Skip to content

Commit 1514326

Browse files
fixed addition of extra AA, added a function to AminoAcid class for testing
1 parent 5faf97a commit 1514326

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

scripts/color_peptides51mer.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ def __init__(self, nucleotide, bold, color, underline, large, position, open_tag
1717
self.open_tag = open_tag
1818
self.close_tag = close_tag
1919

20+
def view(self):
21+
print("Nucleotide: ", self.nucleotide)
22+
print("Open Tag: ", self.open_tag)
23+
print("Close Tag: ", self.close_tag)
24+
print("Bold: ", self.bold)
25+
print("Color: ",self.color)
26+
print("Underline: ", self.underline)
27+
print("Large: ", self.large)
28+
2029
# ---- PARSE ARGUMENTS -------------------------------------------------------
2130
# Parses command line arguments
2231
# Enables user help
@@ -178,7 +187,7 @@ def set_span_tags(peptide_sequence):
178187
nucleotide.open_tag = True
179188

180189
if inside_span:
181-
nucleotide.close_tag = True # only if its isnide a span tag
190+
nucleotide.close_tag = True # only if its inside a span tag
182191
else:
183192
nucleotide.close_tag = False
184193

@@ -202,9 +211,7 @@ def create_stylized_sequence(peptide_sequence):
202211
if nucleotide.close_tag:
203212
new_string += '</span>'
204213

205-
206214
if nucleotide.open_tag:
207-
208215
new_string += '<span style="'
209216
if nucleotide.bold:
210217
new_string += 'font-weight:bold;'
@@ -216,9 +223,6 @@ def create_stylized_sequence(peptide_sequence):
216223
new_string += 'font-size:105%;'
217224
new_string += '">'
218225
new_string += nucleotide.nucleotide
219-
220-
if not nucleotide.large and not nucleotide.bold and not nucleotide.color and not nucleotide.underline:
221-
new_string += nucleotide.nucleotide
222226
else:
223227
new_string += nucleotide.nucleotide
224228
return(new_string)
@@ -305,6 +309,7 @@ def main():
305309

306310
set_span_tags(peptide_sequence) # pass by reference
307311

312+
print(row['51mer ID'])
308313
new_string = create_stylized_sequence(peptide_sequence)
309314

310315
next_td_tags[2].string = new_string

0 commit comments

Comments
 (0)