Skip to content

Commit

Permalink
Merge pull request #34 from IBM/code-dev
Browse files Browse the repository at this point in the history
🛠️🪲📝: Improvements to `prediction` mode
  • Loading branch information
RaulFD-creator authored Dec 6, 2024
2 parents a2b2281 + a4ec298 commit c827b64
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ autopeptideml dataset.csv
autopeptideml dataset.csv --val_method graph-part --val_threshold 0.3 --val_alignment needle
```

For running predictions

```bash

autopeptideml-predict peptides.csv --ensemble AB_1/ensemble
```



License <a name="license"></a>
Expand Down
4 changes: 4 additions & 0 deletions autopeptideml/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def parse_cli_predict():
parser.add_argument('--plm', type=str, default='esm2-8m',
help='PLM for computing peptide representations. Check GitHub Repository for available options.')
parser.add_argument('--plm_batch_size', type=int, default=12)
parser.add_argument('--device', type=str, default=None,
help='Device where the representations should be computed.')
return parser.parse_args()


Expand Down Expand Up @@ -154,6 +156,8 @@ def predict():
args = parse_cli_predict()

re = RepresentationEngine(args.plm, args.plm_batch_size)
if args.device is not None:
re.move_to_device(args.device)
apml = AutoPeptideML(args.verbose, args.threads, 1)
df = apml.curate_dataset(args.dataset, args.outputdir)
apml.predict(df, re, args.ensemble, args.outputdir)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
entry_points={
'console_scripts': [
'autopeptideml=autopeptideml.main:main',
'autopeptdeml-predict=autopeptideml.main:predict',
'autopeptideml-predict=autopeptideml.main:predict',
'autopeptideml-setup=autopeptideml.data.preprocess_db:main'
],
},
Expand Down

0 comments on commit c827b64

Please sign in to comment.