# QIIME1DemuxFormat is not compatible with FASTQ files

**URL:** <https://forum.qiime2.org/t/qiime1demuxformat-is-not-compatible-with-fastq-files/1603>\
**Category:** User Support\
**Tags:** pending-development, qiime1, demux, import, fastq\
**Created:** [October 24, 2017, 4:28pm UTC](https://forum.qiime2.org/t/qiime1demuxformat-is-not-compatible-with-fastq-files/1603 "2017-10-24T16:28:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![firasmidani](https://forum.qiime2.org/user_avatar/forum.qiime2.org/firasmidani/32/609_2.png) [@firasmidani](https://forum.qiime2.org/u/firasmidani)\
**Post date:** [October 24, 2017, 4:28pm UTC](https://forum.qiime2.org/t/qiime1demuxformat-is-not-compatible-with-fastq-files/1603/1 "2017-10-24T16:28:15Z")

</div>

With the addition of `QIIME1DemuxFormat` as a source-format, Qiime2 can now import Qiime1-demultiplexed fasta files (i.e. `seqs.fna` by `split_libraries_fastq.py`). However, this does not seem to work for the equivalent fastq files (i.e. `seqs.fastq`)

To illustrate, this works when the input is a FASTA file (no quality scores),

```bash
qiime tools import \
    --type SampleData[Sequences] \
    --input-path seqs.fna \
    --output-path demux.qza \
    --source-format QIIME1DemuxFormat

```

but not when the input is a FASTQ file (with quality scores),

```bash
qiime tools import \
    --type SampleData[SequencesWithQuality] \
    --input-path seqs.fastq \
    --output-path demux.qza \
    --source-format QIIME1DemuxFormat

```

for which it yields the following error

```plaintext
An unexpected error has occured:

  No transformation from <class
  'q2_types.per_sample_sequences._format.QIIME1DemuxFormat'> to <class '
  q2_types.per_sample_sequences._format.SingleLanePerSampleSingleEndFast
  qDirFmt'>

See above for debug info.

```

Is my import command correct? If yes, is the error due to the lack of a transformation that enables sourcing a `QIIME1DemuxFormat` into `SampleData[SequencesWithQuality]`? Would it be possible to code such a transformation in upcoming releases?

There are two related discussions regarding this issue.

1. One [user](https://forum.qiime2.org/t/import-r1-and-r2-fastq-files-demultiplexed-by-qiime1/1408) suggested the manifest file approach for importing data. However, this assumes that the library of sequences is demultiplexed into multiple files, one for each sample. This is not always the case for files previously demultiplexed in Qiime1 where usually a single file contains all demultiplexed samples.
2. Another user has created a [clever way](https://forum.qiime2.org/t/importing-demultiplexed-sequence-data-from-qiime-1-9-1/320) to circumvent this problem but this somewhat unnecessarily requires splitting the files via Qiime1 and creating a manifest file.

Thanks again for your work on on Qiime! It has been really nice to witness your progress in the newest release.

---

<div class="post-metadata">

**Author:** ![wasade](https://forum.qiime2.org/user_avatar/forum.qiime2.org/wasade/32/2317_2.png) [@wasade](https://forum.qiime2.org/u/wasade)\
**Post date:** [October 24, 2017, 11:21pm UTC](https://forum.qiime2.org/t/qiime1demuxformat-is-not-compatible-with-fastq-files/1603/3 "2017-10-24T23:21:06Z")

</div>

@firasmidani, the method I had proposed as workaround was to use QIIME 1.9.1's `split_sequence_file_on_sample_ids` to split the result of `split_libraries_fastq.py` into per sample files. I think that approach should still work as a ducttape solution, but I have not verified that it works on the latest release of QIIME2.

Best,  
Daniel

---

<div class="post-metadata">

**Author:** ![jairideout](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jairideout/32/9_2.png) [@jairideout](https://forum.qiime2.org/u/jairideout)\
**Post date:** [October 24, 2017, 11:34pm UTC](https://forum.qiime2.org/t/qiime1demuxformat-is-not-compatible-with-fastq-files/1603/4 "2017-10-24T23:34:49Z")

</div>

Hi @firasmidani!

> [@firasmidani](#):
>
> Is my import command correct? If yes, is the error due to the lack of a transformation that enables sourcing a QIIME1DemuxFormat into SampleData[SequencesWithQuality]? Would it be possible to code such a transformation in upcoming releases?

We don't currently support importing QIIME 1 demultiplexed FASTQ files. We have [an open issue](https://github.com/qiime2/q2-types/issues/39) tracking this feature and will follow up here when it's available in a release!

> [@wasade](#):
>
> @firasmidani, the method I had proposed as workaround was to use QIIME 1.9.1’s split\_sequence\_file\_on\_sample\_ids to split the result of split\_libraries\_fastq.py into per sample files. I think that approach should still work as a ducttape solution, but I have not verified that it works on the latest release of QIIME2.

Thanks for the workaround @wasade!

Another option is to use a tool to convert your FASTQ file into FASTA, then you should be able to import it using the `QIIME1DemuxFormat` command you posted above. QIIME 1's `convert_fastaqual_fastq.py` script can be used to do that conversion (ignore the script name, it can do bidirectional conversions), and there's plenty of other tools available that can do the conversion as well if QIIME 1 isn't an option for you.

Let us know how it goes!

---

<div class="post-metadata">

**Author:** ![firasmidani](https://forum.qiime2.org/user_avatar/forum.qiime2.org/firasmidani/32/609_2.png) [@firasmidani](https://forum.qiime2.org/u/firasmidani)\
**Post date:** [October 26, 2017, 8:04pm UTC](https://forum.qiime2.org/t/qiime1demuxformat-is-not-compatible-with-fastq-files/1603/6 "2017-10-26T20:04:45Z")

</div>

> @firasmidani, the method I had proposed as workaround was to use QIIME 1.9.1’s split\_sequence\_file\_on\_sample\_ids to split the result of split\_libraries\_fastq.py into per sample files. I think that approach should still work as a ducttape solution, but I have not verified that it works on the latest release of QIIME2.

Thanks @wasade. Over the past couple of weeks, I have been primarily using your workaround approach including your `make_importable.sh` script and it has been working great with the newest Qiime release (2017.9).

> We don’t currently support importing QIIME 1 demultiplexed FASTQ files. We have an open issue2 tracking this feature and will follow up here when it’s available in a release!

@jairideout, thanks for pointing out the open issue; I did not notice it earlier.

> Another option is to use a tool to convert your FASTQ file into FASTA, then you should be able to import it using the QIIME1DemuxFormat command you posted above. QIIME 1’s convert\_fastaqual\_fastq.py script can be used to do that conversion (ignore the script name, it can do bidirectional conversions), and there’s plenty of other tools available that can do the conversion as well if QIIME 1 isn’t an option for you.

FASTQ to FASTA conversion followed by QIIME1DemuxFormat importing works as expected but I would like to re-run older or publicly available datasets through QIIME2 with DADA2 denoising which requires quality scores.

In the meantime, I will keep using @wasade's approach and will re-visit this issue at the next release. 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:** [November 27, 2017, 2:05am UTC](https://forum.qiime2.org/t/qiime1demuxformat-is-not-compatible-with-fastq-files/1603/7 "2017-11-27T02:05:03Z")

</div>

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