# Get fasta sequence for a given interval

**URL:** <https://discuss.hail.is/t/get-fasta-sequence-for-a-given-interval/1186>\
**Category:** Hail Query & hailctl\
**Created:** [November 26, 2019, 1:22am UTC](https://discuss.hail.is/t/get-fasta-sequence-for-a-given-interval/1186 "2019-11-26T01:22:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Barbosa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/pedro_barbosa/32/266_2.png) [@Pedro\_Barbosa](https://discuss.hail.is/u/Pedro_Barbosa)\
**Post date:** [November 26, 2019, 1:22am UTC](https://discuss.hail.is/t/get-fasta-sequence-for-a-given-interval/1186/1 "2019-11-26T01:22:20Z")

</div>

Hi Hail team,

I would like to know if hail has any method to extract reference nucleotides given an Interval obtained from import\_bed.

Best,  
Pedro

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [November 26, 2019, 1:30am UTC](https://discuss.hail.is/t/get-fasta-sequence-for-a-given-interval/1186/2 "2019-11-26T01:30:27Z")

</div>

yes, see here:

[https://hail.is/docs/0.2/hail.expr.LocusExpression.html#hail.expr.LocusExpression.sequence\_context](https://hail.is/docs/0.2/hail.expr.LocusExpression.html#hail.expr.LocusExpression.sequence_context)

We should expose a function that lets you look up a contig, start, end. You can make this using the above function, it’ll just look a bit hacky.

---

<div class="post-metadata">

**Author:** ![Pedro\_Barbosa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/pedro_barbosa/32/266_2.png) [@Pedro\_Barbosa](https://discuss.hail.is/u/Pedro_Barbosa)\
**Post date:** [November 26, 2019, 1:42am UTC](https://discuss.hail.is/t/get-fasta-sequence-for-a-given-interval/1186/3 "2019-11-26T01:42:16Z")

</div>

Perfect!! Thank you @tpoterba
