diff --git a/image_ref/main.py b/image_ref/main.py index 57135d19f796a58946796f687025a0069b220e7c..d72f097c762668b76f4fe041b50ce7b24332694e 100644 --- a/image_ref/main.py +++ b/image_ref/main.py @@ -77,7 +77,7 @@ def val_duo(model, data_test, loss_function, epoch, wandb): losses = losses / (label.shape[0] * len(data_test.dataset)) acc = acc / (len(data_test.dataset)) acc_contrastive = acc_contrastive / (label.shape[0] * len(data_test.dataset)) - print('Test epoch {}, loss : {:.3f} acc : {:.3f} acc contrastive : {:.3f}'.format(epoch, losses, acc, + print('Test epoch {}, loss : {:.3f} acc : {:.3f} acc contrastive : {:.3f}'.format(epoch, losses, acc, acc_contrastive)) if wandb is not None: diff --git a/image_ref/main_ray.py b/image_ref/main_ray.py index 123286fb88f6da44e8218d68de1786baad4f09ae..bd3aa6a4cdaac12564cf65891d533859f2620e82 100644 --- a/image_ref/main_ray.py +++ b/image_ref/main_ray.py @@ -213,9 +213,9 @@ def test_model(best_result, args): def main(args, gpus_per_trial=1): config = { "lr": tune.loguniform(1e-4, 1e-2), - "noise": tune.loguniform(1, 1000), + "noise": tune.loguniform(1, 10000), "p_prop": tune.uniform(5, 95), - "optimizer": tune.choice(['Adam', 'SGD']), + "optimizer": tune.choice(['Adam', 'SGD']), #adam plus efficace ? "sampler": tune.choice(['random', 'balanced']), } scheduler = ASHAScheduler( diff --git a/image_ref/utils.py b/image_ref/utils.py index f9a326908d872723d607f8b3ce97cf4fd4f58f7a..2809748a63cfcd75ccfd4450e07bd46ef8444da3 100644 --- a/image_ref/utils.py +++ b/image_ref/utils.py @@ -173,7 +173,7 @@ if __name__ == '__main__': # print(pep) # f.write(pep+'\n') # - # df_count = compute_common_peptide("dataset_species_ref_peptides.csv", SPECIES) + df_count = compute_common_peptide("dataset_species_ref_peptides.csv", SPECIES) # # Create ref img @@ -181,15 +181,16 @@ if __name__ == '__main__': 'fasta/full proteom/steigerwaltii variants/uniparc_proteome_UP000033376_2025_03_14.predicted.parquet') min_rt = df_full['RT'].min() max_rt = df_full['RT'].max() - + # df = pd.read_csv("dataset_species_ref_peptides.csv") - + # for spe in SPECIES: print(spe) df_spe = df[df['Specie'] == spe] + df_spec_no_common = df_spe[df_spe['Sequence'].isin(df_count[df_count['Count']<5]['Sequence'])] im = build_ref_image_from_diann_global( - 'fasta/global_peptide_list.parquet', target_seq=df_spe['Sequence'].to_list(), ms1_end_mz=1250, + 'fasta/global_peptide_list.parquet', target_seq=df_spec_no_common['Sequence'].to_list(), ms1_end_mz=1250, ms1_start_mz=350, bin_mz=1, max_cycle=663, min_rt=min_rt, max_rt=max_rt) plt.clf() - mpimg.imsave('img_ref/' + spe + '.png', im) - np.save('img_ref/' + spe + '.npy', im) + mpimg.imsave('img_ref_common_th_5/' + spe + '.png', im) + np.save('img_ref_common_th_5/' + spe + '.npy', im)