You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+99Lines changed: 99 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -267,6 +267,78 @@ for key in feature:
267
267
print(key, feature[key])
268
268
```
269
269
270
+
### Working with Amino Acid Sequences
271
+
272
+
The `Py_AASequence` wrapper provides a Pythonic interface to amino acid sequences with support for common operations like sequence reversal and shuffling for decoy generation. All operations delegate to pyOpenMS functionality to minimize reimplementation.
273
+
274
+
```python
275
+
from openms_python import Py_AASequence
276
+
277
+
# Create a sequence from string
278
+
seq = Py_AASequence.from_string("PEPTIDERK")
279
+
280
+
# Access properties
281
+
print(f"Sequence: {seq.sequence}") # PEPTIDERK
282
+
print(f"Length: {len(seq)}") # 9
283
+
print(f"Mono weight: {seq.mono_weight:.2f} Da") # 1083.56 Da
284
+
print(f"Formula: {seq.formula}") # C46H77N13O17
285
+
286
+
# Iterate over amino acids
287
+
for aa in seq:
288
+
print(aa) # P, E, P, T, I, D, E, R, K
289
+
290
+
# Generate decoy sequences
291
+
reversed_seq = seq.reverse()
292
+
print(reversed_seq.sequence) # KREDITPEP
293
+
294
+
# Reverse with enzyme constraint (preserves cleavage sites)
0 commit comments