# Preparing mixed orientation reads for dada2

**URL:** <https://forum.qiime2.org/t/preparing-mixed-orientation-reads-for-dada2/29048>\
**Category:** User Support\
**Tags:** dada2, vsearch, cutadapt\
**Created:** [January 26, 2024, 5:56am UTC](https://forum.qiime2.org/t/preparing-mixed-orientation-reads-for-dada2/29048 "2024-01-26T05:56:37Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)\
**Post date:** [January 26, 2024, 6:10pm UTC](https://forum.qiime2.org/t/preparing-mixed-orientation-reads-for-dada2/29048/5 "2024-01-26T18:10:37Z")

</div>

Hi @shreyaramachandran,

This may help.. though a bit onerous.

> [@train a greengenes 2022 classifier for forward reads only](https://forum.qiime2.org/t/train-a-greengenes-2022-classifier-for-forward-reads-only/28508/3):
>
> Hi @mawa86, If the majority of your reads are being assigned as "Unassigned" and "k\_\_Bacteria", it could mean that your reads are in a mixed orientation, with respect to the classifier. That is, the both the forward and reverse reads appear in the R1 files, and similarly, in the R2 files. You can read many forum threads about this [here](https://forum.qiime2.org/search?q=mixed%20orientation). One way to sanity-check if this is the case, is to run qiime feature-classifier classify-consensus-vsearch ... as vsearch does not care about read orientatio…

That being said...

We've been [discussing](https://github.com/bokulich-lab/RESCRIPt/issues/159) ways to implement the `vsearch --orient ...` command into QIIME 2 for orienting fastq files. You could try running this vsearch command externally on each of your R1 and R2 reads, or you can use reads that are already merged. `vsearch` is available within your QIIME 2 environment. It might also be easiest to run this prior to importing into QIIME 2.

# tl;dr:

```auto
vsearch \
   --orient R1-seqs.fastq \
   --db reference-database.fasta \
   --fastqout R1-seqs-oriented.fastq \
   --notmatched R1-seqs-not-oriented.fastq 

```

# more detail

You can download and export any of the marker gene reference databases from [here](https://docs.qiime2.org/2023.9/data-resources/#marker-gene-reference-databases), as your input to `--db`.

More details can be found within the [vsearch manual](https://github.com/torognes/vsearch?tab=readme-ov-file#getting-help).

**So you can do the following...**

**Export SILVA reference sequences (FASTA)**  
(You can obtain from the Data resources page linked above.)

```auto
qiime tools export \
    --input-path silva-138-99-seqs.qza \
    --output-path silva-138-99-seqs-export/

```

**export your raw fastqs (R1 & R2, or merged) if you already imported them**  
Otherwise just use the fastqs you have prior to importing into QIIM# 2

```auto
qiime tools export \
    --input-path raw-seqs.qza \
    --output-path raw-seqs-export

```

**Run vsearch to orient your fastqs**  
Again, you need to run on the R1 (forward) and R2 (reverse) reads separately. There is a chance one of the pairs will be oriented and the other will not, causing paired read mismatches. But hopefully it'll be minimal. Though there might be some minor manual edits require for one or both files.

_Or, if you plan to use deblur as your denoising approach, you can simply merge your reads with vsearch, and then run the `vsearch --orient` command. From here you can run deblur on your oriented merged reads. This will avoid task of running `vsearch --orient` on R1 and R2 separately._

```auto
vsearch \
  --orient R1-seqs.fastq \
  --db silva-138-99-seqs-export/dna-sequences.fasta \
  --fastqout oriented.fastq \
  --notmatched not-oriented.fastq

```

**Import oriented fastqs into QIIME 2**  
Then you can simply import these fastqs as you would normally do.

_Note: I've not completely vetted this strategy myself, but I figured this will provide you with a more tenable place to start._

---

_[View the full topic](https://forum.qiime2.org/t/preparing-mixed-orientation-reads-for-dada2/29048)._
