# Difference in classification with complete sample set and a subsample

**URL:** https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629
**Category:** User Support
**Tags:** feature-classifier
**Created:** [March 20, 2024, 3:26am UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629 "2024-03-20T03:26:38Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 20, 2024, 3:26am UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/1 "2024-03-20T03:26:39Z")

</div>

Hi,  
While doing an 18S analysis using qiime2-amplicon-2023.9, when I tried analyzing the whole run set of 384 samples, the taxonomy hits after using silva-138 full length classifier were very less. However, when a subset of 8 samples from the same run were analyzed separately, the hits were more diverse and resembled more to an independent analysis. I verified both the runs till dada2-denoising and for the same set of samples (8 out of 384 analyzed together) and the same 8 analyzed separately, I do see that the number of reads after filtering and chimera removal are exactly the same.  
Where could the issue possibly arise from?

Thank You for the help

---

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 21, 2024, 10:07pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/2 "2024-03-21T22:07:27Z")

</div>

Hi,

This is in continuation of my previous thread. After digging more into the ASVs and their sequences, from both the complete run analysis and the analysis of the subset, I realized that for similar ASVs obtained in both the analysis, the classifier classified them well and with fairly high confidence in subset but failed to classify them in the complete run analysis.  
I am using SILVA 138.1 full length pre-trained classifier from qiime2 website for both these run. Also, I am attaching a csv file which should provide a better idea of what I have written.

Thank you  
[Comparison\_of\_all\_and\_subset.csv](https://forum.qiime2.org/uploads/short-url/fLnsqelVsAxGB5tfkvw9Y5rYyJg.csv) (2.0 MB)

---

<div class="post-metadata">

### Author: ![colinvwood](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinvwood/32/17303_2.png) [@colinvwood](https://forum.qiime2.org/u/colinvwood)
#### Post date: [March 22, 2024, 5:12pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/3 "2024-03-22T17:12:19Z")

</div>

Hello @Mudit_Bhatia,

Would you mind posting the classification command that you used?

---

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 22, 2024, 5:30pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/4 "2024-03-22T17:30:18Z")

</div>

Thank You Colin for the response.

For both the classifications, the following command was used and only the reads file used was changed.  
 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/211ceed1506fd1437cda333cdd0485fd70f49bf8.png)

---

<div class="post-metadata">

### Author: ![colinvwood](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinvwood/32/17303_2.png) [@colinvwood](https://forum.qiime2.org/u/colinvwood)
#### Post date: [March 22, 2024, 11:08pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/5 "2024-03-22T23:08:23Z")

</div>

Hello @Mudit_Bhatia,

Would you mind sharing (attaching) the two resulting classification artifacts if they're not too large?

---

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 23, 2024, 12:57am UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/6 "2024-03-23T00:57:46Z")

</div>

Hi Collin,

Please find the files attached.

Thank You  
[taxonomy\_complete.qza](https://forum.qiime2.org/uploads/short-url/4BmUMVHUY7vGJWwvChtmyHP4mxI.qza) (960.9 KB)  
[taxonomy\_subset.qza](https://forum.qiime2.org/uploads/short-url/e8NYxdXH78HELjptnsfty3P89gC.qza) (182.7 KB)

---

<div class="post-metadata">

### Author: ![jphagen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jphagen/32/17133_2.png) [@jphagen](https://forum.qiime2.org/u/jphagen)
#### Post date: [March 25, 2024, 5:13pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/7 "2024-03-25T17:13:05Z")

</div>



---

<div class="post-metadata">

### Author: ![colinvwood](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinvwood/32/17303_2.png) [@colinvwood](https://forum.qiime2.org/u/colinvwood)
#### Post date: [March 25, 2024, 9:20pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/10 "2024-03-25T21:20:09Z")

</div>

Hello @Mudit_Bhatia,

This can happen either when the sequences to be classified are in mixed orientation or when there's a nonsense sequence among them that causes the orientation detector to assume the wrong direction. Do you know whether your sequencing pipeline would have resulted in mixed orientation reads? If so, use `qiime rescript orient-seqs` to orient them consistently. If not, I would try rerunning `classify-sklearn` once with the `--p-read-orientation` parameter set to `'same'` and once with it set to `'reverse-complement'` and then check those taxonomies.

---

<div class="post-metadata">

### Author: ![jphagen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jphagen/32/17133_2.png) [@jphagen](https://forum.qiime2.org/u/jphagen)
#### Post date: [March 25, 2024, 10:22pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/11 "2024-03-25T22:22:14Z")

</div>



---

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 25, 2024, 11:50pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/12 "2024-03-25T23:50:45Z")

</div>

Thank You Colin for the response.

I do not think that the sequencing pipeline is resulting in reads-with mixed orientation. If that was the case, would the ASVs generated be exactly the same? Because in the first file I shared,

> [@Mudit\_Bhatia](#):
>
> [Comparison\_of\_all\_and\_subset.csv](https://forum.qiime2.org/uploads/short-url/fLnsqelVsAxGB5tfkvw9Y5rYyJg.csv) (2.0 MB)

the common ASVs generated for both the analysis (complete and subset) are exactly the same, however, they are being aligned differently. For the subset, they have a high confidence and aligned to eukaryotes but in the complete analysis, they have a much lower confidence and either being assigned to bacteria or unassigned.

I will try to run the analysis with reverse-complement and get back.

Thank You for your time and consideration.

---

<div class="post-metadata">

### Author: ![colinvwood](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinvwood/32/17303_2.png) [@colinvwood](https://forum.qiime2.org/u/colinvwood)
#### Post date: [March 26, 2024, 5:32pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/13 "2024-03-26T17:32:52Z")

</div>

Hello @Mudit_Bhatia,

> If that was the case, would the ASVs generated be exactly the same?

I'm not sure, but it seems possible. I think that more likely is that there is nonsense sequence in the total set that confused the orientation finder and tanked everything.

---

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 26, 2024, 10:36pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/14 "2024-03-26T22:36:53Z")

</div>

Thank you Colin for the response.

I did the complete analysis of the run in subsets and got most of the subsets which resulted in fairly nice classification. I am trying to stick to Silva-138.1 classifier which is available on the qiime2 website as I have been having issues training the feature classifier by myself, something I am discussing [here](https://forum.qiime2.org/t/training-silva-132-classifier-for-qiime2-amplicon-2023-9/29651/16)

I have tried using both Rescript protocol and the protocol for qiime2 versions before 2024.2. Is there any other way I can try

> [@colinvwood](#):
>
> This can happen either when the sequences to be classified are in mixed orientation or when there's a nonsense sequence among them that causes the orientation detector to assume the wrong direction. Do you know whether your sequencing pipeline would have resulted in mixed orientation reads? If so, use `qiime rescript orient-seqs` to orient them consistently. If not, I would try rerunning `classify-sklearn` once with the `--p-read-orientation` parameter set to `'same'` and once with it set to `'reverse-complement'` and then check those taxonomies.

without having to train the feature classifier?

---

<div class="post-metadata">

### Author: ![colinvwood](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinvwood/32/17303_2.png) [@colinvwood](https://forum.qiime2.org/u/colinvwood)
#### Post date: [March 26, 2024, 11:08pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/15 "2024-03-26T23:08:59Z")

</div>

Hello @Mudit_Bhatia,

Just to be clear did you try running the complete set with the same classifier but using the `--p-read-orientation` parameter?

---

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 27, 2024, 4:57pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/16 "2024-03-27T16:57:10Z")

</div>

Thank You @colinvwood for the response. I missed that point earlier but I did run it and I see that when I use --p-read-orientation 'same', the classification works well and it does not do a proper classification when the --p-read-orientation 'reverse complement'.

That does solve my issue but if you do not mind, could you please explain why the default parameter --p-read-orientation 'auto' did not do the job?

Thank you for your support

---

<div class="post-metadata">

### Author: ![colinvwood](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinvwood/32/17303_2.png) [@colinvwood](https://forum.qiime2.org/u/colinvwood)
#### Post date: [March 27, 2024, 5:52pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/17 "2024-03-27T17:52:40Z")

</div>

Hello @Mudit_Bhatia,

The hypothesis was, as suggested by @Nicholas_Bokulich, that there was a nonsense/garbage read that was chosen by the orientation checker and caused the direction of the reads to be misinterpreted. Hardcoding the orientation didn't allow this to happen. In your subset the nonsense read either wasn't present or wasn't chosen by the orientation checker, so you didn't have the problem there.

---

<div class="post-metadata">

### Author: ![Mudit\_Bhatia](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mudit_bhatia/32/17746_2.png) [@Mudit\_Bhatia](https://forum.qiime2.org/u/Mudit_Bhatia)
#### Post date: [March 27, 2024, 5:54pm UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/18 "2024-03-27T17:54:42Z")

</div>

Thank You for the support and explanation!

---

<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: [April 30, 2024, 2:12am UTC](https://forum.qiime2.org/t/difference-in-classification-with-complete-sample-set-and-a-subsample/29629/19 "2024-04-30T02:12:06Z")

</div>

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