Skip to content
Snippets Groups Projects
Commit 26bffa3f authored by Schneider Leo's avatar Schneider Leo
Browse files

empty line fix

parent 56dc4e78
No related branches found
No related tags found
No related merge requests found
......@@ -8,15 +8,16 @@ def fasta_like_to_data(path):
file = open(path, "r")
content = file.readlines()
file.close()
return content
res = []
for l in content :
if l!='\n':
res.append(l)
return res
def strip_lines(s):
s = s.strip('\n')
try :
s = s.split(' ')[1]
return s
except:
return 'unidentifid seq error'
s = s.split(' ')[1]
return s
def main(input_data_path):
print('Reading file')
......@@ -80,9 +81,9 @@ def main(input_data_path):
'Predicted class':label_multi})
print('Saving output')
result.to_csv(input_data_path.strip('.txt')+'_detectability.csv',index=False) #Output du model dans le fichier 'prediction_detectability.csv'
result.to_csv(input_data_path.strip('.txt')+'t_detectability.csv',index=False) #Output du model dans le fichier 'prediction_detectability.csv'
new_file = open(input_data_path.strip('.txt')+'_filtered.txt','w')
new_file = open(input_data_path.strip('.txt')+'t_filtered.txt','w')
print('Writting final file')
i,j=0,1
......@@ -96,8 +97,9 @@ def main(input_data_path):
i+=1
j+=1
else :
print(l)
i+=1
new_file.close()
if __name__ == '__main__':
main('250107_FASTA_RP_GroEL_GroES_Tuf_5pct_assemble_peptides_list.txt')
\ No newline at end of file
main('250107_FASTA_RP_GroEL_GroES_Tuf_5pct_assemble_peptides_list.txt')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment