Spaces:
Sleeping
Sleeping
fatmacankara
commited on
Commit
·
22626ae
1
Parent(s):
514bca8
Update code/add_alignment.py
Browse files- code/add_alignment.py +0 -14
code/add_alignment.py
CHANGED
@@ -42,10 +42,6 @@ def do_alignment(identifier, uniprotSequence, pdbSequence, alignment_path):
|
|
42 |
alignment = (str(alignment).strip().split('\n'))
|
43 |
alignment = [''.join(['.' if m == ' ' else m for m in x]) for x in alignment]
|
44 |
alignment_list.append(alignment)
|
45 |
-
print('alignments')
|
46 |
-
print(alignments)
|
47 |
-
print('ALIGNMENT LIST')
|
48 |
-
print(alignment_list)
|
49 |
return alignment_list
|
50 |
|
51 |
|
@@ -113,12 +109,6 @@ def mutation_position_on_pdb(alignment_list, pos):
|
|
113 |
else:
|
114 |
pdb_alignStatus = 'not_aligned'
|
115 |
mutationPositionOnPDB = 'nan'
|
116 |
-
print()
|
117 |
-
print('-----')
|
118 |
-
print('ALIGNMENT STATUS')
|
119 |
-
print(pdb_alignStatus, mutationPositionOnPDB, startGap, alignment_list[which_alignment_to_go - 1])
|
120 |
-
print('-----')
|
121 |
-
print()
|
122 |
return (pdb_alignStatus, mutationPositionOnPDB, startGap, alignment_list[which_alignment_to_go - 1])
|
123 |
|
124 |
|
@@ -332,9 +322,7 @@ def annotation_pos_on_pdb(annot_positions, startGap, alignment_to_use, identifie
|
|
332 |
|
333 |
def final_stage(df, annotation_list, alignment_path):
|
334 |
for i in df.index:
|
335 |
-
print('i',i)
|
336 |
identifier = df.at[i, 'uniprotID'] + '_' + df.at[i, 'pdbID'] + '_' + df.at[i, 'chain'] + '_'
|
337 |
-
print('i',identifier)
|
338 |
alignment_list = do_alignment(identifier, df.at[i, 'uniprotSequence'], df.at[i, 'pdbSequence'], alignment_path)
|
339 |
df.at[i, 'pdb_alignStatus'] = mutation_position_on_pdb(alignment_list, df.at[i, 'pos'])[0]
|
340 |
df.at[i, 'mutationPositionOnPDB'] = mutation_position_on_pdb(alignment_list, df.at[i, 'pos'])[1]
|
@@ -353,8 +341,6 @@ def final_stage(df, annotation_list, alignment_path):
|
|
353 |
str(df.at[i, 'domStart']) != '-1.0' or str(df.at[i, 'domEnd']) != '-1.0':
|
354 |
df.at[i, 'domainStartonPDB'] = 'nan'
|
355 |
df.at[i, 'domainEndonPDB'] = 'nan'
|
356 |
-
print('Final Stage')
|
357 |
-
print(df.to_string())
|
358 |
return df
|
359 |
|
360 |
def alignment(dataframe_to_align, annotation_list, alignment_path):
|
|
|
42 |
alignment = (str(alignment).strip().split('\n'))
|
43 |
alignment = [''.join(['.' if m == ' ' else m for m in x]) for x in alignment]
|
44 |
alignment_list.append(alignment)
|
|
|
|
|
|
|
|
|
45 |
return alignment_list
|
46 |
|
47 |
|
|
|
109 |
else:
|
110 |
pdb_alignStatus = 'not_aligned'
|
111 |
mutationPositionOnPDB = 'nan'
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
return (pdb_alignStatus, mutationPositionOnPDB, startGap, alignment_list[which_alignment_to_go - 1])
|
113 |
|
114 |
|
|
|
322 |
|
323 |
def final_stage(df, annotation_list, alignment_path):
|
324 |
for i in df.index:
|
|
|
325 |
identifier = df.at[i, 'uniprotID'] + '_' + df.at[i, 'pdbID'] + '_' + df.at[i, 'chain'] + '_'
|
|
|
326 |
alignment_list = do_alignment(identifier, df.at[i, 'uniprotSequence'], df.at[i, 'pdbSequence'], alignment_path)
|
327 |
df.at[i, 'pdb_alignStatus'] = mutation_position_on_pdb(alignment_list, df.at[i, 'pos'])[0]
|
328 |
df.at[i, 'mutationPositionOnPDB'] = mutation_position_on_pdb(alignment_list, df.at[i, 'pos'])[1]
|
|
|
341 |
str(df.at[i, 'domStart']) != '-1.0' or str(df.at[i, 'domEnd']) != '-1.0':
|
342 |
df.at[i, 'domainStartonPDB'] = 'nan'
|
343 |
df.at[i, 'domainEndonPDB'] = 'nan'
|
|
|
|
|
344 |
return df
|
345 |
|
346 |
def alignment(dataframe_to_align, annotation_list, alignment_path):
|