# How to retrieve indices from bioalignments?

**URL:** <https://discourse.julialang.org/t/how-to-retrieve-indices-from-bioalignments/47002>\
**Category:** General Usage\
**Tags:** biology\
**Created:** [September 21, 2020, 12:20pm UTC](https://discourse.julialang.org/t/how-to-retrieve-indices-from-bioalignments/47002 "2020-09-21T12:20:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Entangler](https://avatars.discourse-cdn.com/v4/letter/e/49beb7/32.png) [@Entangler](https://discourse.julialang.org/u/Entangler)\
**Post date:** [September 21, 2020, 12:20pm UTC](https://discourse.julialang.org/t/how-to-retrieve-indices-from-bioalignments/47002/1 "2020-09-21T12:20:36Z")

</div>

I am wondering how I can get sequence indices from a BioAlignments.jl alignment. The pairalign function returns an object from which I can get the sequences of the aligned region and the score. And while the function prints out the starting indices of the aligned region, I don’t know how to access those values.

```julia
using BioAlignments
using BioSequences
scoremodel = AffineGapScoreModel(EDNAFULL, gap_open=-5, gap_extend=-1);
my_alignment = pairalign(LocalAlignment(),dna"ATATTAGGTATTGATTATTGTACGCGGCCCGGC" , dna"TTGATTATTGT", scoremodel)
alignment(my_alignment)

```

---

<div class="post-metadata">

**Author:** ![Entangler](https://avatars.discourse-cdn.com/v4/letter/e/49beb7/32.png) [@Entangler](https://discourse.julialang.org/u/Entangler)\
**Post date:** [September 21, 2020, 1:12pm UTC](https://discourse.julialang.org/t/how-to-retrieve-indices-from-bioalignments/47002/2 "2020-09-21T13:12:15Z")

</div>

Got an answer via stack overflow thanks to Przemyslaw Szufel

[https://stackoverflow.com/questions/63991548/how-do-i-retrieve-the-sequence-indices-of-an-aligned-region-from-a-bioalignments](https://stackoverflow.com/questions/63991548/how-do-i-retrieve-the-sequence-indices-of-an-aligned-region-from-a-bioalignments)
