# Extract a subsequence from the whole genome assembly?

**URL:** <https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162>\
**Category:** usegalaxy.eu support\
**Tags:** custom-genome, data-manager\
**Created:** [June 9, 2021, 7:42pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162 "2021-06-09T19:42:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![daikez](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@daikez](https://help.galaxyproject.org/u/daikez)\
**Post date:** [June 9, 2021, 7:43pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/1 "2021-06-09T19:43:00Z")

</div>

I have managed to map my interested gene region against my home built whole genome assembly. So I saw the results has returned a best matched scaffold id. So if it is possible to extract the target scaffold sequence out of the assembly and study it closer?

---

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/david/32/7031_2.png) [@David](https://help.galaxyproject.org/u/David)\
**Post date:** [June 9, 2021, 7:53pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/2 "2021-06-09T19:53:15Z")

</div>

@daikez,  
There are some ways to extract it, but just to be clear, can you tell us which files/formats are you talking about?

---

<div class="post-metadata">

**Author:** ![daikez](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@daikez](https://help.galaxyproject.org/u/daikez)\
**Post date:** [June 9, 2021, 8:24pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/3 "2021-06-09T20:24:26Z")

</div>

OK, I have a whole genome assembly in fasta format which includes many contigs and scaffolds. If I want to extract out one of the scaffold or contig, let’s say scaffold\_100 or contig\_50. How should I do it?

---

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/david/32/7031_2.png) [@David](https://help.galaxyproject.org/u/David)\
**Post date:** [June 9, 2021, 10:05pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/4 "2021-06-09T22:05:55Z")

</div>

You can use the `Filter sequences by ID` tool.

---

<div class="post-metadata">

**Author:** ![daikez](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@daikez](https://help.galaxyproject.org/u/daikez)\
**Post date:** [June 9, 2021, 10:56pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/5 "2021-06-09T22:56:09Z")

</div>

Thank you very much, David! It is working!

---

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/david/32/7031_2.png) [@David](https://help.galaxyproject.org/u/David)\
**Post date:** [June 9, 2021, 11:07pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/6 "2021-06-09T23:07:16Z")

</div>

You’re welcome!

---

<div class="post-metadata">

**Author:** ![daikez](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@daikez](https://help.galaxyproject.org/u/daikez)\
**Post date:** [June 10, 2021, 7:48am UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/7 "2021-06-10T07:48:52Z")

</div>

There is a new problem. The scaffold file I retrieved out is too large for NCBI blaster to do alignment between two sequences. Is there any way to compare a mRNA sequence against a bigger scaffold sequence? Thanks again!

---

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/david/32/7031_2.png) [@David](https://help.galaxyproject.org/u/David)\
**Post date:** [June 10, 2021, 3:00pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/8 "2021-06-10T15:00:42Z")

</div>

@daikez, Too large? This seems odd. How are you doing it?

---

<div class="post-metadata">

**Author:** ![daikez](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@daikez](https://help.galaxyproject.org/u/daikez)\
**Post date:** [June 10, 2021, 5:05pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/9 "2021-06-10T17:05:03Z")

</div>

Yes, the scaffold I extracted out is 33.5Mb. And when I tried to Blaster my interested gene sequence agaisnst this scaffold, NCBI webside showed it won’t accept file larger than 10Mb. I had to devide the scaffold into several smaller parts. Is there any tools at Galaxy which can directly align GenBank entry against the saved dataset?

---

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/david/32/7031_2.png) [@David](https://help.galaxyproject.org/u/David)\
**Post date:** [June 10, 2021, 5:27pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/10 "2021-06-10T17:27:00Z")

</div>

Ok. That’s the problem.  
Why are you using blast at NCBI, instead of Galaxy? The NCBI web version of blast has many known limitations.

I suggest you take a substantial amount of time to check some [Galaxy Training](https://training.galaxyproject.org/training-material/) material.

---

<div class="post-metadata">

**Author:** ![daikez](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@daikez](https://help.galaxyproject.org/u/daikez)\
**Post date:** [June 11, 2021, 6:27am UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/11 "2021-06-11T06:27:15Z")

</div>

If there is possibility to direct fetch NCBI entry into Galaxy and align with the saved dataset, it will be perfect! Any suggestions?

---

<div class="post-metadata">

**Author:** ![David](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/david/32/7031_2.png) [@David](https://help.galaxyproject.org/u/David)\
**Post date:** [June 11, 2021, 2:19pm UTC](https://help.galaxyproject.org/t/extract-a-subsequence-from-the-whole-genome-assembly/6162/12 "2021-06-11T14:19:11Z")

</div>

It is possible.

You’ll find what you need to fetch databases entries in the `Get Data` section of tools panel (left of galaxy page), while Blast tools are in the `NCBI BLAST+` section.

Remember to read some Galaxy Training so you’ll get acquainted to Galaxy.
