# How to get location of sequence in GenomicAnnotations

**URL:** <https://discourse.julialang.org/t/how-to-get-location-of-sequence-in-genomicannotations/106731>\
**Category:** Biology, Health, and Medicine\
**Tags:** question\
**Created:** [November 26, 2023, 3:59am UTC](https://discourse.julialang.org/t/how-to-get-location-of-sequence-in-genomicannotations/106731 "2023-11-26T03:59:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michikazjp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michikazjp/32/204415_2.png) [@michikazjp](https://discourse.julialang.org/u/michikazjp)\
**Post date:** [November 26, 2023, 3:59am UTC](https://discourse.julialang.org/t/how-to-get-location-of-sequence-in-genomicannotations/106731/1 "2023-11-26T03:59:19Z")

</div>

Hello  
I am newcomer in BioJulia and getting interested in it. Now I am starting to use GenomicAnnotations package. For example, I open a genbank file of E. coli K12 as

using GenomicAnnotations  
K12 = readgbk(“K12.gbff”)  
K12v = []  
for record in K12  
K12v = [K12v; record]  
end  
println(K12v[1].genes[2])

and obtain  
gene 190…255  
/db\_xref=“ASAP:ABE-0000006”  
/db\_xref=“ECOCYC:EG11277”  
/db\_xref=“GeneID:944742”  
/gene=“thrL”  
/locus\_tag=“b0001”  
/gene\_synonym=“ECK0001”

I can see that the location is from 190 to 255.  
But, how can I get this location in the code as a vector, for example?

Version of Julia : 1.8.5  
Version of GenomicAnnotations : 0.3.3

Thank you.

---

<div class="post-metadata">

**Author:** ![camilogarciabotero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/camilogarciabotero/32/35000_2.png) [@camilogarciabotero](https://discourse.julialang.org/u/camilogarciabotero)\
**Post date:** [January 2, 2024, 10:19pm UTC](https://discourse.julialang.org/t/how-to-get-location-of-sequence-in-genomicannotations/106731/2 "2024-01-02T22:19:13Z")

</div>

This is a little bit late, but take a look at this issue:

> <https://github.com/BioJulia/GenomicAnnotations.jl/issues/11>
>
> Hi all
> 
> This package is so great! I was wondering if there is any way to fetch… the \`location\` out of the \`gbk.genes\` field. Currently we can get all the fields that start with the \`/\` in the record:
> 
> \`\`\`
> gbk.genes\[end\]
> 
> CDS 47738..47944
> /db\_xref="GeneID:2703534"
> /locus\_tag="lambdap79"
> /codon\_start=1
> /transl\_table=11
> /product="hypothetical protein"
> /protein\_id="NP\_597782.1"
> /translation="MNKEQSADDPSVDLIRVKNMLNSTISMSYPDVVIACIEHKVSLE
> AFRAIEAALVKHDNNMKDYSLVVD"
> /note="Predicted by GeneMark"
> \`\`\`
> 
> I want to be able to get the location qualifier \`47738..47944\` encoded later as a \`UnitRange{Int64}\` --\> \`47738:47944\`. Is this a feature we can have in \`GenomicAnnotations\` (or already have)? 
> 
> Best.

---

<div class="post-metadata">

**Author:** ![michikazjp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michikazjp/32/204415_2.png) [@michikazjp](https://discourse.julialang.org/u/michikazjp)\
**Post date:** [January 3, 2024, 3:02am UTC](https://discourse.julialang.org/t/how-to-get-location-of-sequence-in-genomicannotations/106731/3 "2024-01-03T03:02:54Z")

</div>

That is just what I have wanted!  
Thank you very much.
