Multiple input
Merge request reports
Activity
added 1 commit
- be181ccf - linter
By Charlotte Mauvezin on 2021-12-22T13:54:18 (imported from GitLab)
added 1 commit
- 0aca621a - linter
By Charlotte Mauvezin on 2021-12-22T13:57:16 (imported from GitLab)
533 538 return scores 534 539 535 540 541 def run_multiple(file_csv, annot_folder, predict_folder, threshold): 542 """Run the program for multiple file (correlation indicated in the csv file)""" changed this line in version 4 of the diff
By Charlotte Mauvezin on 2021-12-23T11:27:53 (imported from GitLab)
564 602 default=THRESHOLD, 565 603 type=threshold_float_type, 566 604 ) 605 parser.add_argument( 606 "-c", 607 "--csv", 608 help="csv with the correlation between the annotation bio file and the predict bio file", changed this line in version 4 of the diff
By Charlotte Mauvezin on 2021-12-23T11:27:53 (imported from GitLab)
81 84 try: 82 85 word, label = line.split() 83 86 except ValueError: 87 print(index) 88 print(line) 84 89 raise (Exception(f"The file {path} given in input is not in BIO format.")) changed this line in version 4 of the diff
By Charlotte Mauvezin on 2021-12-23T11:27:53 (imported from GitLab)
535 540 541 def run_multiple(file_csv, annot_folder, predict_folder, threshold): 542 """Run the program for multiple file (correlation indicated in the csv file)""" 543 # Read the csv in a dataframe 544 df_cor = pd.read_csv(file_csv) 545 546 # Check if the variable given are folder 547 if os.path.isdir(annot_folder) and os.path.isdir(predict_folder): 548 list_bio_annot = glob.glob(annot_folder + "/**/*.bio", recursive=True) 549 list_bio_predict = glob.glob(predict_folder + "/**/*.bio", recursive=True) 550 551 for index, row in df_cor.iterrows(): 552 annot = None 553 predict = None 554 555 # Check if the file exist changed this line in version 4 of the diff
By Charlotte Mauvezin on 2021-12-23T11:27:53 (imported from GitLab)
565 603 type=threshold_float_type, 566 604 ) 605 parser.add_argument( 606 "-c", 607 "--csv", 608 help="csv with the correlation between the annotation bio file and the predict bio file", 609 required=False, 610 type=Path, 611 ) 567 612 args = parser.parse_args() 568 613 569 run(args.annot, args.predict, args.threshold) 614 if args.csv: 615 run_multiple(args.csv, args.annot, args.predict, args.threshold) 616 else: 617 run(args.annot, args.predict, args.threshold) - Comment on lines +555 to +617
Est-ce que l'utilisation ne serait pas plus pratique avec un seul répertoire "bio_files" plutôt que deux séparés ? Avec un nouvel argument en paramètres uniquement pour ça, et en vérifiant la cohérence des arguments en les parsant.
Dans tous les cas, pas besoin de dédoubler les fichiers de test dans la demo. Même en gardant deux paramètres, tu peux juste passer le répertoire
demo
en argument.By Blanche Miret on 2021-12-23T09:10:41 (imported from GitLab)
changed this line in version 7 of the diff
By Charlotte Mauvezin on 2022-01-03T10:34:28 (imported from GitLab)
556 for file_annot in list_bio_annot: 557 if row["annot"] == os.path.basename(file_annot): 558 annot = file_annot 559 for file_predict in list_bio_predict: 560 if row["predict"] == os.path.basename(file_predict): 561 predict = file_predict 562 563 # Apply the evaluation 564 if annot and predict: 565 run(annot, predict, threshold) 566 print("") 567 else: 568 print(f"No file found for row {index}") 569 570 else: 571 print("Error this is no folder") changed this line in version 4 of the diff
By Charlotte Mauvezin on 2021-12-23T11:27:54 (imported from GitLab)
551 for index, row in df_cor.iterrows(): 552 annot = None 553 predict = None 554 555 # Check if the file exist 556 for file_annot in list_bio_annot: 557 if row["annot"] == os.path.basename(file_annot): 558 annot = file_annot 559 for file_predict in list_bio_predict: 560 if row["predict"] == os.path.basename(file_predict): 561 predict = file_predict 562 563 # Apply the evaluation 564 if annot and predict: 565 run(annot, predict, threshold) 566 print("") changed this line in version 4 of the diff
By Charlotte Mauvezin on 2021-12-23T11:27:54 (imported from GitLab)
added 1 commit
- 71a3e8c0 - Correctif
By Charlotte Mauvezin on 2021-12-23T11:27:54 (imported from GitLab)
533 540 return scores 534 541 535 542 543 def run_multiple(file_csv, folder, threshold): 544 """Run the program for multiple files (correlation indicated in the csv file)""" 545 # Read the csv in a dataframe 546 df_cor = pd.read_csv(file_csv) ne pas ajouter une dépendance sur pandas juste pour lire un csv -> utiliser https://docs.python.org/3/library/csv.html
pouquoi ?
- pandas fait beaucoup plus que lire un csv, autant utiliser une librairie que ne fait que ca
- pandas ajoute une multitude de dépendances, ce qui prend plus de place et nécessite une maintenance plus complexe pour maintenir à jour la librairie
changed this line in version 5 of the diff
By Charlotte Mauvezin on 2021-12-24T12:38:25 (imported from GitLab)
- demo/cor.csv 0 → 100644
1 annot,predict changed this line in version 5 of the diff
By Charlotte Mauvezin on 2021-12-24T12:38:25 (imported from GitLab)
added 1 commit
- 282c3151 - Correction Chistopher
By Charlotte Mauvezin on 2021-12-24T12:38:25 (imported from GitLab)
added 1 commit
- 1eed43c8 - Modifying .isort.cfg
By Charlotte Mauvezin on 2021-12-24T12:40:00 (imported from GitLab)
560 562 predict = file 561 563 562 564 if annot and predict: 565 print(os.path.basename(predict)) 563 566 run(annot, predict, threshold) 564 567 print() 565 568 else: 566 raise f"No file found for row {index}" 567 569 raise f"No file found for files {annot}, {predict}" 568 570 else: 569 571 raise "This is no folder" changed this line in version 7 of the diff
By Charlotte Mauvezin on 2022-01-03T10:34:28 (imported from GitLab)
560 562 predict = file 561 563 562 564 if annot and predict: 565 print(os.path.basename(predict)) 563 566 run(annot, predict, threshold) 564 567 print() 565 568 else: 566 raise f"No file found for row {index}"