<p>Perhaps,removing introns (if it is a higher eukaryote)</p>

<pre><code>extractfeat tembl:x65921 -type CDS -join 
</code></pre>

<p>It is difficult to know without knowing the gene. </p>

<p>BTW NCBI's Entrez "efetch" will do essentially the same thing, but its more complicated</p>

CC BY-SA 4.0
2019-06-23T16:22:12.747Z
I tried that syntax with the -join at the end which didn't work either

If it matters, I am currently testing it on a Histone H1 gene of C. elegans
I'd prefer If I could get the CDS by processing the sequence file in my bash script. Since I'm using efetch to download the sequence anyway, I don't mind trying that out if it's not too complicated.
KA97
CC BY-SA 4.0
2019-06-23T19:45:29.080Z
Okay, the syntax you are using is correct, but you don't need to specify the output file
M__
CC BY-SA 4.0
2019-06-24T16:06:42.373Z
I managed to fix it. I was accidentally using FASTA format files instead of Genbank flat file format which seemed to be the problem.
KA97
CC BY-SA 4.0
2019-06-24T16:46:32.693Z
That's good: fasta format has no features for extractfeat to extract, so it would have no chance. The error trapping in the code is clearly absent and it might be worth reporting the bug to the Emboss team.
M__
CC BY-SA 4.0
2019-06-23T12:59:26.487Z
2019-06-23T16:07:47.540Z
2019-06-23T16:07:47.540Z
M__
<p>I am working on a script on bash linux to get the CDS (coding sequence) of a gene using extractfeat by EMBOSS. It gives me the error: Warning: No sequences written to output file</p>

<p>I am unsure if my syntax is right, but this is what I have: </p>

<pre><code>extractfeat inputFile outputFile -type CDS
</code></pre>

CC BY-SA 4.0
2019-06-22T18:41:00.917Z
Hi, KA97, what is the error? If you can include it, this will help establish what the problem is.
M__
CC BY-SA 4.0
2019-06-23T09:54:07.873Z
. The error is :   Warning: No sequences written to output file 
    It produces a blank output file with no sequence in.
KA97
<sequence-analysis><bash><emboss>
How to use extractfeat?
# How to use extractfeat?

(Asked by: username_0 on 2019-06-22)

I am working on a script on bash linux to get the CDS (coding sequence) of a gene using extractfeat by EMBOSS. It gives me the error: Warning: No sequences written to output file
I am unsure if my syntax is right, but this is what I have: 
extractfeat inputFile outputFile -type CDS

**Tags:** sequence-analysis, bash, emboss
> **Comments:**
> **username_1**: Hi, KA97, what is the error? If you can include it, this will help establish what the problem is.  
> **username_0**: . The error is :   Warning: No sequences written to output file      It produces a blank output file with no sequence in.  

---

## 1 answers

### Answer by username_1 on 2019-06-23. Score: 0

Perhaps,removing introns (if it is a higher eukaryote)
extractfeat tembl:x65921 -type CDS -join 

It is difficult to know without knowing the gene. 
BTW NCBI's Entrez "efetch" will do essentially the same thing, but its more complicated

> **Comments:**
> **username_0**: I tried that syntax with the -join at the end which didn't work either  If it matters, I am currently testing it on a Histone H1 gene of C. elegans I'd prefer If I could get the CDS by processing the sequence file in my bash script. Since I'm using efetch to download the sequence anyway, I don't mind trying that out if it's not too complicated.  
> **username_1**: Okay, the syntax you are using is correct, but you don't need to specify the output file  
> **username_0**: I managed to fix it. I was accidentally using FASTA format files instead of Genbank flat file format which seemed to be the problem.  
> **username_1**: That's good: fasta format has no features for extractfeat to extract, so it would have no chance. The error trapping in the code is clearly absent and it might be worth reporting the bug to the Emboss team.  

---

