diff --git a/main.py b/main.py index 54f2c2858492c768b5aecf714b58782fc963d15c..cc98a857178b0f22f45c9ca4de80b592976130e0 100644 --- a/main.py +++ b/main.py @@ -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')