Skip to content

Commit 088ddde

Browse files
fixing missing AA and adding set_up script
1 parent a87fcf8 commit 088ddde

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

scripts/color_peptides51mer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def set_underline(peptide_sequence, mutant_peptide_pos):
116116
classI_position = 0
117117

118118
if '-' in mutant_peptide_pos:
119+
119120
positions = mutant_peptide_pos.split("-")
120121

121122
start_position = int(positions[0])
@@ -197,6 +198,7 @@ def create_stylized_sequence(peptide_sequence):
197198
if nucleotide.open_tag or nucleotide.close_tag:
198199
if nucleotide.close_tag:
199200
new_string += '</span>'
201+
200202

201203
if nucleotide.open_tag:
202204

@@ -225,9 +227,11 @@ def create_stylized_sequence(peptide_sequence):
225227
elif nucleotide.bold and not nucleotide.color and nucleotide.underline:
226228
new_string += '<span style="font-weight:bold;text-decoration:underline;">'
227229
new_string += nucleotide.nucleotide
230+
231+
if not nucleotide.large and not nucleotide.bold and not nucleotide.color and not nucleotide.underline:
232+
new_string += nucleotide.nucleotide
228233
else:
229234
new_string += nucleotide.nucleotide
230-
231235
return(new_string)
232236

233237
def main():
@@ -330,7 +334,7 @@ def main():
330334
modified_html = peptides_51mer_soup.prettify(formatter=None)
331335

332336
else:
333-
print("Search string not found.")
337+
print("\nSearch string: ", search_string, " not found.\n")
334338

335339
with open(args.o, "w", encoding = 'utf-8') as file:
336340
file.write(modified_html)

scripts/setup_review.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import argparse
2+
import subprocess
3+
4+
# Define the command-line arguments
5+
parser = argparse.ArgumentParser(description='Sets up manuel review files')
6+
7+
parser.add_argument('-a', help='Path to ITB Reviewed Candidates')
8+
parser.add_argument('-c', help='Path to annotated_filtered.vcf-pass-51mer.fa.manufacturability.tsv')
9+
parser.add_argument('-samp', help='Name of the sample')
10+
parser.add_argument('-f', "--fin_results", help='Name of the final results folder')
11+
12+
parser.add_argument('-classI', help='Path to classI all_epitopes.aggregated.tsv', required=True)
13+
parser.add_argument('-classII', help='Path to classII all_epitopes.aggregated.tsv', required=True)
14+
parser.add_argument('-o', help='The name of the html in which the coloring will be printed', required=True)
15+
16+
17+
18+
# Parse the command-line arguments
19+
args = parser.parse_args()
20+
21+
# Check if the required arguments are provided
22+
if not args.classI or not args.classII or not args.o:
23+
parser.error("Missing required arguments. Please provide -p, -classI, -classII, and -o.")
24+
25+
26+
27+
command1 = f"python scripts/generate_reviews_files.py -a {args.a} -c {args.c} -samp {args.samp}"
28+
command2 = f"python scripts/color_peptides51mer.py -p {args.samp}_Peptides_51-mer.xlsx -classI {args.classI} -classII {args.classII} -o {args.o}"
29+
30+
31+
# Execute the first script
32+
print("Generating Review Files...")
33+
subprocess.run(command1, shell=True)
34+
35+
# Execute the second script
36+
print("Coloring Peptide Sequeces...")
37+
subprocess.run(command2, shell=True)
38+
39+
print("Scripts have been executed successfully.")

0 commit comments

Comments
 (0)