Skip to content

Commit 4c23bbe

Browse files
committed
added project structure
1 parent 0642841 commit 4c23bbe

10 files changed

+81931
-91018
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__pycache__/

__pycache__/tools.cpython-310.pyc

-1.94 KB
Binary file not shown.

main.py create_mutation_df.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
#getting a list of all mutations from the file
66
voc_mutation_list = []
7-
mutation_list = pd.read_csv("all_mut.csv")["Mutation"]
7+
mutation_list = pd.read_csv("./data/all_mut.csv")["Mutation"]
88

9-
with open("voc_mutation.txt", "r") as f:
9+
with open("./data/voc_mutation.txt", "r") as f:
1010
lines = f.readlines()
1111

1212
for line in lines:
@@ -25,20 +25,18 @@
2525
for mut in mutation_list:
2626
if("-" in mut):
2727
continue
28-
mut_pos = int(mut[1:-1])
28+
mut_pos = int(mut[1:-1])
2929
new_aa = mut[-1]
3030
start_pos = int(peptide[1])
3131
end_pos = int(peptide[2])
32-
if(mut_pos >= start_pos and end_pos >= mut_pos):
33-
relative_index = mut_pos-start_pos-1
32+
if(mut_pos >= start_pos and end_pos > mut_pos):
33+
relative_index = mut_pos-start_pos
3434
new_peptide = peptide[0]
3535
new_peptide = list(new_peptide)
3636
new_peptide[relative_index] = new_aa
3737
new_peptide = "".join(new_peptide)
3838
rows.append([mut_pos, new_aa, start_pos, end_pos, peptide[0], new_peptide, is_vocs(mut, voc_mutation_list)])
3939

4040
df = pd.DataFrame(rows, columns=cols)
41-
df.to_csv("mutation_peptide_df.csv")
42-
#------------------------------------------------------------------------------------------------------------------
43-
44-
41+
df.to_csv("./data/mutation_peptide_df.csv")
42+
#------------------------------------------------------------------------------------------------------------------

all_mut.csv data/all_mut.csv

File renamed without changes.

0 commit comments

Comments
 (0)