<p>In your sequence header you will see:</p>
<pre><code>[location=complement(940023..940580)]
</code></pre>
<p>It's a reverse strand gene. Reverse complement the sequence, then search the genome sequence.</p>

CC BY-SA 4.0
2021-06-09T10:22:45.963Z
Thank you very much for the answer but it is still not working . I do not understand why. I used [this](https://www.bioinformatics.org/sms/rev_comp.html) software to make the reverse complement, copied and searched in the complete genome sequence but I still do not find it.
HelpNeederStudent
CC BY-SA 4.0
2021-06-09T10:00:56.080Z
2021-06-09T10:00:56.080Z
Emily_Ensembl
<p>I would just <a href="https://anaconda.org/bioconda/blast" rel="nofollow noreferrer">blast</a> it. When blasting locally, you need to first make a database from your genome, so assuming you got the command-line version of blast installed you can do something like</p>
<pre><code>makeblastdb -in my_study_genome.fa -dbtype nucl
blastn -max_target_seqs 10 -db my_study_genome.fa -evalue 1e-10 -outfmt 6 -query my_downloaded_gene_of_interest.fasta -out gene_in_my_study_genome.blast
</code></pre>
<p>blast search for anything that is &quot;similar enough&quot; and also considers both strands, so for example, if there is an SNP in the middle of the gene. Hence even if the searched gene and the reference genome are from different sequencing runs / individuals, blast will still find it. Blast will also handle linebreaks for you (in fasta files the nucleotide sequence is quite often wrapped by 60 or 100 characters a line). Long story short, there is not much that can go wrong with blast (while with full text search you can easily shoot yourself in foot).</p>
<p>-- edit 2 --</p>
<p>As @terdon suggested, potentially if you would locating a transcript sequence (excluding introns), you would do better with software like <a href="https://www.ebi.ac.uk/about/vertebrate-genomics/software/exonerate-user-guide" rel="nofollow noreferrer">exonerate</a> or <a href="https://www.ebi.ac.uk/Tools/psa/genewise/" rel="nofollow noreferrer">genewise</a>, because they model exon/intron boundaries. However, even in those cases blast will give you an approximate position of the gene.</p>

CC BY-SA 4.0
2021-06-09T12:38:33.703Z
@Manuela this really should be done using a tool that models genes (try [exonerate](https://www.ebi.ac.uk/about/vertebrate-genomics/software/exonerate-user-guide) or [genewise](https://www.ebi.ac.uk/Tools/psa/genewise/)). Blast is great but will not be able to model introns correctly if your species has splicing.
terdon
CC BY-SA 4.0
2021-06-09T10:34:44.593Z
2021-06-09T15:51:14.787Z
2021-06-09T15:51:14.787Z
Kamil S Jaron
<p>I need to identify the sequence of a gene in the complete genome sequence . I thought it was simple, instead it is not a straightforward task !</p>
<p>My method was the following: I downloaded the FASTA format file of the complete genome sequence of the archaea organism that I am studying, that is <a href="https://www.ncbi.nlm.nih.gov/nuccore/CP003685.1?report=fasta" rel="nofollow noreferrer">CP003685</a>, and then I downloaded the CDS file from NCBI by clicking on &quot;&gt;Send to&gt;Coding Sequencing&gt;FASTA Nucleotide&gt;Create File&quot;. In this way I have a txt file (always FASTA format file) in which I find a sequence for each gene (if I am not wrong).</p>
<p>So for example, I should find, in the complete genome sequence, the sequences of the CDS file (the last that I downloaded), right?</p>
<p>For example, if I consider:</p>
<pre><code>&gt;lcl|CP003685.1_cds_AFN03983.1_1007 [locus_tag=PFC_05180] [protein=DNA protection protein DPS] [protein_id=AFN03983.1] [location=complement(940023..940580)] [gbkey=CDS]
ATGCCAGAGCATAATAGGAGATTAGTTGAAAGGACAGGAATAGATGTAGAGAAGCTGTTGGAACTTCTCA
TTAAAGCGGCTGCAGCAGAGTTCACAACGTATTATTACTACACTATACTTAGAAACCATGCAACAGGTCT
GGAAGGAGAAGCAATTAAGGAGATTATCGAAGATGCTAGACTTGAGGACAGAAACCATTTTGAAGCCCTC
GTGCCAAGAATATACGAGCTTGGAGGAGAATTACCAAGGGATATTCGGGAATTTGCAGATCTAGCTTCTT
GTAGAGATGCCTACCTACCAGAAGAGCCCACTATAGAGAACATTCTAAAAGTCCTACTCGAAGCTGAGAG
ATGTGCAGTTGGAGTCTATACAGAAATATGCAACTACACTTTTGGAAAGGATCCAAGGACTTATGATTTG
GCCCTTGCCATATTACATGAAGAGATAGAGCATGAAGCATGGTTTGAAGAGCTCTTGACTGGAAAGCCGA
GTGGTCACTTTAGAAGAGGAAAGCCTGGGGAAAGTCCATATGTCTCAAAGTTTTTGAAAACTAGATAG
</code></pre>
<p>I should find in the complete genome sequence, this sequence, right ? But this is not. Why?</p>
<p>I suspect that I miss very important passages.</p>
<p>Thank you in advance.</p>

CC BY-SA 4.0
2021-06-09T10:58:45.500Z
See [How to identify genes from a genome assembly of C. Elegans?](https://bioinformatics.stackexchange.com/a/15440). Exonerate and wise2 should be able to do this.
terdon
CC BY-SA 4.0
2021-06-09T11:48:33.583Z
I simply copy the sequence of the gene (like the one I have written in the post) and in the file with the complete genome sequence ([CP003685](https://www.ncbi.nlm.nih.gov/nuccore/CP003685.1?report=fasta)) I click ctrl+F and paste the reverse complement of the sequence of the gene and search it. But it does not find it. Sorry if I did not really specified this very crude way to do it :') . For the introns I have no idea...
HelpNeederStudent
CC BY-SA 4.0
2021-06-09T11:56:56.123Z
It is a non-professional way but I do not understand why it does not work since the two sequences should be the same... the two files I am considering (as said below) are only two different ways to represent the genome DNA sequence, right ?
HelpNeederStudent
CC BY-SA 4.0
2021-06-09T12:11:20.777Z
Well yes, kinda, but you have line breaks. You will never find the entire thing unless you convert it to a one-line format first. Try searching for a smaller section, say ~10 nucleotides and if the first one doesn't work try some others. You need to find a sequence that appears in a _single_ line otherwise you won't find a match.
terdon
CC BY-SA 4.0
2021-06-09T12:31:53.830Z
Thank you very much @terdon. I did not know this and now it seems to be finally clear putting all pieces together !
HelpNeederStudent
<fasta><genome><sequence-analysis><phylogenetics>
How to identify the DNA sequence of a gene in the complete genome sequence FASTA format file?
# How to identify the DNA sequence of a gene in the complete genome sequence FASTA format file?

(Asked by: username_0 on 2021-06-09)

I need to identify the sequence of a gene in the complete genome sequence . I thought it was simple, instead it is not a straightforward task !
My method was the following: I downloaded the FASTA format file of the complete genome sequence of the archaea organism that I am studying, that is CP003685, and then I downloaded the CDS file from NCBI by clicking on ">Send to>Coding Sequencing>FASTA Nucleotide>Create File". In this way I have a txt file (always FASTA format file) in which I find a sequence for each gene (if I am not wrong).
So for example, I should find, in the complete genome sequence, the sequences of the CDS file (the last that I downloaded), right?
For example, if I consider:
>lcl|CP003685.1_cds_AFN03983.1_1007 [locus_tag=PFC_05180] [protein=DNA protection protein DPS] [protein_id=AFN03983.1] [location=complement(940023..940580)] [gbkey=CDS]
ATGCCAGAGCATAATAGGAGATTAGTTGAAAGGACAGGAATAGATGTAGAGAAGCTGTTGGAACTTCTCA
TTAAAGCGGCTGCAGCAGAGTTCACAACGTATTATTACTACACTATACTTAGAAACCATGCAACAGGTCT
GGAAGGAGAAGCAATTAAGGAGATTATCGAAGATGCTAGACTTGAGGACAGAAACCATTTTGAAGCCCTC
GTGCCAAGAATATACGAGCTTGGAGGAGAATTACCAAGGGATATTCGGGAATTTGCAGATCTAGCTTCTT
GTAGAGATGCCTACCTACCAGAAGAGCCCACTATAGAGAACATTCTAAAAGTCCTACTCGAAGCTGAGAG
ATGTGCAGTTGGAGTCTATACAGAAATATGCAACTACACTTTTGGAAAGGATCCAAGGACTTATGATTTG
GCCCTTGCCATATTACATGAAGAGATAGAGCATGAAGCATGGTTTGAAGAGCTCTTGACTGGAAAGCCGA
GTGGTCACTTTAGAAGAGGAAAGCCTGGGGAAAGTCCATATGTCTCAAAGTTTTTGAAAACTAGATAG

I should find in the complete genome sequence, this sequence, right ? But this is not. Why?
I suspect that I miss very important passages.
Thank you in advance.

**Tags:** fasta, genome, sequence-analysis, phylogenetics
> **Comments:**
> **username_1**: See [How to identify genes from a genome assembly of C. Elegans?](https://bioinformatics.stackexchange.com/a/15440). Exonerate and wise2 should be able to do this.  
> **username_0**: I simply copy the sequence of the gene (like the one I have written in the post) and in the file with the complete genome sequence ([CP003685](https://www.ncbi.nlm.nih.gov/nuccore/CP003685.1?report=fasta)) I click ctrl+F and paste the reverse complement of the sequence of the gene and search it. But it does not find it. Sorry if I did not really specified this very crude way to do it :') . For the introns I have no idea...  
> **username_0**: It is a non-professional way but I do not understand why it does not work since the two sequences should be the same... the two files I am considering (as said below) are only two different ways to represent the genome DNA sequence, right ?  
> **username_1**: Well yes, kinda, but you have line breaks. You will never find the entire thing unless you convert it to a one-line format first. Try searching for a smaller section, say ~10 nucleotides and if the first one doesn't work try some others. You need to find a sequence that appears in a _single_ line otherwise you won't find a match.  
> **username_0**: Thank you very much @terdon. I did not know this and now it seems to be finally clear putting all pieces together !  

---

## 2 answers

### Answer by username_3 on 2021-06-09. Score: 6

I would just blast it. When blasting locally, you need to first make a database from your genome, so assuming you got the command-line version of blast installed you can do something like
makeblastdb -in my_study_genome.fa -dbtype nucl
blastn -max_target_seqs 10 -db my_study_genome.fa -evalue 1e-10 -outfmt 6 -query my_downloaded_gene_of_interest.fasta -out gene_in_my_study_genome.blast

blast search for anything that is "similar enough" and also considers both strands, so for example, if there is an SNP in the middle of the gene. Hence even if the searched gene and the reference genome are from different sequencing runs / individuals, blast will still find it. Blast will also handle linebreaks for you (in fasta files the nucleotide sequence is quite often wrapped by 60 or 100 characters a line). Long story short, there is not much that can go wrong with blast (while with full text search you can easily shoot yourself in foot).
-- edit 2 --
As @terdon suggested, potentially if you would locating a transcript sequence (excluding introns), you would do better with software like exonerate or genewise, because they model exon/intron boundaries. However, even in those cases blast will give you an approximate position of the gene.

> **Comments:**
> **username_1**: @Manuela this really should be done using a tool that models genes (try [exonerate](https://www.ebi.ac.uk/about/vertebrate-genomics/software/exonerate-user-guide) or [genewise](https://www.ebi.ac.uk/Tools/psa/genewise/)). Blast is great but will not be able to model introns correctly if your species has splicing.  

---

### Answer by username_2 on 2021-06-09. Score: 5

In your sequence header you will see:
[location=complement(940023..940580)]

It's a reverse strand gene. Reverse complement the sequence, then search the genome sequence.

> **Comments:**
> **username_0**: Thank you very much for the answer but it is still not working . I do not understand why. I used [this](https://www.bioinformatics.org/sms/rev_comp.html) software to make the reverse complement, copied and searched in the complete genome sequence but I still do not find it.  

---

