# Troubles importing FASTA file

**URL:** https://forum.qiime2.org/t/troubles-importing-fasta-file/2546
**Category:** User Support
**Tags:** fasta, import
**Created:** [January 11, 2018, 8:40pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546 "2018-01-11T20:40:01Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![aeriel.belk](https://forum.qiime2.org/user_avatar/forum.qiime2.org/aeriel.belk/32/762_2.png) [@aeriel.belk](https://forum.qiime2.org/u/aeriel.belk)
#### Post date: [January 11, 2018, 8:40pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/1 "2018-01-11T20:40:01Z")

</div>

Hello!

I am having the same problem as @Pseudomonas84 importing my seqs.fna file into qiime2. I tried following your suggestion of including the source format parameter, so my command looked like this:

qiime tools import   
--input-path reference-hit.seqs.fa \   
--output-path PMI3\_spring\_rep-seqs.qza   
--source-format QIIME1DemuxFormat   
--type SampleData[Sequences]

I also received the error: reference-hit.seqs.fa is not a(n) QIIME1DemuxFormat file

Here is the head of my file:  
head reference-hit.seqs.fa

```auto
>TACAGAGGTCTCAAGCGTTGTTCGGATTCATTGGGCGTAAAGGGTGCGTAGGCGGCGCGGTAAGTCGGGTGTGAAATCTCGGAGCTTAACTCCGAAACTG
TACAGAGGTCTCAAGCGTTGTTCGGATTCATTGGGCGTAAAGGGTGCGTAGGCGGCGCGGTAAGTCGGGTGTGAAATCTCGGAGCTTAACTCCGAAACTG
>TACGGAGGATCCAAGCGTTATCCGGAATCATTGGGTTTAAAGGGTCCGTAGGCGGTTTAGTAAGTCAGTGGTGAAAGCCCATCGCTCAACGGTGGAACGG
TACGGAGGATCCAAGCGTTATCCGGAATCATTGGGTTTAAAGGGTCCGTAGGCGGTTTAGTAAGTCAGTGGTGAAAGCCCATCGCTCAACGGTGGAACGG
>TACAGAGGTCTCAAGCGTTGTTCGGATTCATTGGGCGTAAAGGGTGCGTAGGTGGTGATGCAAGTCTGGTGTGAAATCTCGGAGCTCAACTCCGAAATTG
TACAGAGGTCTCAAGCGTTGTTCGGATTCATTGGGCGTAAAGGGTGCGTAGGTGGTGATGCAAGTCTGGTGTGAAATCTCGGAGCTCAACTCCGAAATTG
>TACGAAGGGGGCTAGCGTTGCTCGGAATCACTGGGCGTAAAGCGCACGTAGGCGGATTGCTAAGTCAGGGGTGAAATCCTGGAGCTCAACTCCAGAACTG
TACGAAGGGGGCTAGCGTTGCTCGGAATCACTGGGCGTAAAGCGCACGTAGGCGGATTGCTAAGTCAGGGGTGAAATCCTGGAGCTCAACTCCAGAACTG
>TACGAAGGGGGCTAGCGTTGCTCGGAATCACTGGGCGTAAAGGGTGCGTAGGCGGGTCTTTAAGTCAGGGGTGAAATCCTGGAGCTCAACTCCAGAACTG
TACGAAGGGGGCTAGCGTTGCTCGGAATCACTGGGCGTAAAGGGTGCGTAGGCGGGTCTTTAAGTCAGGGGTGAAATCCTGGAGCTCAACTCCAGAACTG

```

My file does not appear to have any lowercase letters, however I noticed that the ID line is the same as my sequence, and I'm wondering if that is the problem. Is there a way to fix that, or do you have another suggestion as to what the problem might be?

Thanks!  
Aeriel 😄

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [January 11, 2018, 8:52pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/2 "2018-01-11T20:52:03Z")

</div>

Hi @aeriel.belk,  
your sequences are in standard fasta format, not a QIIME1DemuxFormat file. You can follow [this tutorial example](https://docs.qiime2.org/2017.12/tutorials/importing/#id22) to import to a `FeatureData[Sequence]` file.

I hope that helps!

---

<div class="post-metadata">

### Author: ![aeriel.belk](https://forum.qiime2.org/user_avatar/forum.qiime2.org/aeriel.belk/32/762_2.png) [@aeriel.belk](https://forum.qiime2.org/u/aeriel.belk)
#### Post date: [January 11, 2018, 9:03pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/3 "2018-01-11T21:03:32Z")

</div>

Thanks for your quick reply!

Unfortunately, when I run the command as described in the tutorial I am given the error: reference-hit.seqs.fa is not a(n) DNAFASTAFormat file

This is why I tried using the other method originally, I guess I am unsure what format my file is then, if it isn't either of these.

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [January 12, 2018, 1:23pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/5 "2018-01-12T13:23:41Z")

</div>

Hi @aeriel.belk, sorry to hear things aren't going well ☹ . I just created a file (`seqs.fna`) using the output from the `head` command you listed [above](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546), and imported using the following command (this is what @Nicholas_Bokulich linked to [above](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/2)):

```bash
$ qiime tools import \
  --input-path seqs.fna \
  --output-path sequences.qza \
  --type 'FeatureData[Sequence]'

```

The sequences imported without raising an error. This is noteworthy, because[the code that performs the validation](https://github.com/qiime2/q2-types/blob/master/q2_types/feature_data/_format.py#L134-L150) of this format only reads the first 5 records to make its assessment --- so even if your file has more records in it, the error you mentioned seeing above would've been caused by using just the first 5 records, which means I should have seen that error in my test (this isn't entirely true - the sniffer could detect issues in other lines of the file).

Some requests:

- Can you please double check that your import command is importing the file you want?
- Can you please copy-and-paste the exact import command you are running?
- Can you please copy-and-paste the complete error you are seeing?

Thanks! 🦖

---

<div class="post-metadata">

### Author: ![aeriel.belk](https://forum.qiime2.org/user_avatar/forum.qiime2.org/aeriel.belk/32/762_2.png) [@aeriel.belk](https://forum.qiime2.org/u/aeriel.belk)
#### Post date: [January 12, 2018, 3:21pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/7 "2018-01-12T15:21:18Z")

</div>

Thanks @thermokarst!

I tried again, I am certain that I am using the correct fasta file in this command:

qiime tools import   
--input-path reference-hit.seqs.fa   
--output-path sequences.qza   
--type 'FeatureData[Sequence]'

There was a problem importing reference-hit.seqs.fa:

reference-hit.seqs.fa is not a(n) DNAFASTAFormat file

Thanks!

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [January 12, 2018, 3:35pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/8 "2018-01-12T15:35:14Z")

</div>

Hi @aeriel.belk,  
If your file is small enough, could you please post it here and we could attempt to debug?

what version of QIIME2 are you running?

---

<div class="post-metadata">

### Author: ![aeriel.belk](https://forum.qiime2.org/user_avatar/forum.qiime2.org/aeriel.belk/32/762_2.png) [@aeriel.belk](https://forum.qiime2.org/u/aeriel.belk)
#### Post date: [January 12, 2018, 3:38pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/9 "2018-01-12T15:38:18Z")

</div>

It is attached below. I am currently running QIIME2-2017.12, but I had the same issue in 2017.11 and 2017.10

[reference-hit.seqs.fa.zip](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/2/242cba67d7f6677ef08456ccf9e8f334e992724c.zip) (261.7 KB)

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [January 12, 2018, 3:56pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/10 "2018-01-12T15:56:23Z")

</div>

Hi @aeriel.belk,  
It looks like the issue is that a number of sequences contain lower-case characters. use the following to convert your file before importing:

`tr 'acgt' 'ACGT' < reference-hit.seqs.fa > seqs.fna`

That will do the trick!

---

<div class="post-metadata">

### Author: ![aeriel.belk](https://forum.qiime2.org/user_avatar/forum.qiime2.org/aeriel.belk/32/762_2.png) [@aeriel.belk](https://forum.qiime2.org/u/aeriel.belk)
#### Post date: [January 12, 2018, 4:15pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/11 "2018-01-12T16:15:15Z")

</div>

That worked, thanks!

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [February 12, 2018, 10:15pm UTC](https://forum.qiime2.org/t/troubles-importing-fasta-file/2546/12 "2018-02-12T22:15:18Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
