# A question about the NA's when fenerating the rarefraction curves

**URL:** <https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212>\
**Category:** Theory behind mothur\
**Created:** [November 16, 2019, 2:05am UTC](https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212 "2019-11-16T02:05:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZhangChiqian](https://avatars.discourse-cdn.com/v4/letter/z/94ad74/32.png) [@ZhangChiqian](https://forum.mothur.org/u/ZhangChiqian)\
**Post date:** [November 16, 2019, 2:05am UTC](https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212/1 "2019-11-16T02:05:20Z")

</div>

Dear all,

Good night! I am really a newbiee to Mothur, and here I want to ask a question about the rarefraction curves. Thanks.

After running the **rarefraction.single** command, I got the rarefraction file, which looks like this (fake data for demostration):

++A = # of sequences sampled; ++B = # of OUTs identified for sample 1; ++C = # of OTUs identified for sample 2

++A ++B ++C  
001 001 001  
100 30 50  
200 90 110  
300 130 210  
400 132 320  
500 132 440  
600 NA 560  
700 NA 560  
800 NA 560  
900 NA NA  
1,000 NA NA

First, based on my understanding, those NA’s appear because we cannot get more OTUs when further sampling the reads. When I draw the rarefraction curve for one specific sample, **can I replace those NA’s with the maximium number of OTUs for this sample**? For instance, when drawing the rarefraction curve for sample 1, can I use the following data?

++A = # of sequences sampled; ++B = # of OUTs identified for sample 1;

++A ++B  
001 001  
100 30 90 110  
300 130  
400 132  
500 132  
600 **132**  
700 **132**  
800 **132**  
900 **132**  
1,000 **132**

Here, instead of drawing the rarefraction curve with the _x_-axis goes to 500, I really want it goes to 1,000.

Second, in my data, sample 1 and sample 2 were take from the same location (they are similar to each other) but were sequenced individually. Now, if I want to treat sample 1 and sample 2 as a single sample, **can I take the average number of OTUs and generate the farefraction curve this way** :

++A = # of sequences sampled; ++B = # of OUTs identified for sample 1; ++C = # of OTUs identified for sample 2; ++D = Average # of OTUs for sample 1 and sample 2

++A ++B ++C ++D  
001 001 001 001  
100 30 50 40  
200 90 110 100  
300 130 210 170  
400 132 320 226  
500 132 440 286  
600 _132_ 560 346  
700 _132_ 560 346  
800 _132_ 560 346  
900 _132__560_ 346  
1,000 _132__560_ 346

Thanks a lot for any thoughts and input. And I hope that everyone will have a wonderful weekend.

Yours,  
Zhang Chiqian

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [November 18, 2019, 6:38pm UTC](https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212/2 "2019-11-18T18:38:07Z")

</div>

No, I would not replace the NAs with the maximum number of OTUs to that point. The idea of rarefaction is that you are subsampling downwards, not upwards as your method would effectively do. If you are plotting, you can remove those rows that have NAs for that sample. I describe how to do this in R within my [minimal R materials section on line plots](http://www.riffomonas.org/minimalR/06_line_plots.html).

Hope this helps a bit,  
Pat

---

<div class="post-metadata">

**Author:** ![ZhangChiqian](https://avatars.discourse-cdn.com/v4/letter/z/94ad74/32.png) [@ZhangChiqian](https://forum.mothur.org/u/ZhangChiqian)\
**Post date:** [November 20, 2019, 4:25am UTC](https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212/3 "2019-11-20T04:25:50Z")

</div>

Thanks a lot for the help! I now understand that I should remove the rows having NAs. My specific issue right now is: I have too many samples and thus too many curves/lines. In the link that you gave, it was suggested that we can reduce the number of samples using. However, I am afraid that I might lose some information by reducing the number of samples when plotting the rarefaction curves. That was why I initially wanted to calculate the average number of OTUs for a group of samples.

Do you think it is correct to calculate the average number of OTUs for a group of samples? If it is correct, how can we deal with the NAs? For the example below, sample 1 starts to get NAs after sampling 600 reads, where sample 2 starts to get NAs after sampling 900 reads. If we remove the NAs, there is no way to calculate the average number of OTUs after sampling 600 reads.

++A ++1 ++2  
001 001 001  
100 30 50  
200 90 110  
300 130 210  
400 132 320  
500 132 440  
600 NA 560  
700 NA 560  
800 NA 560  
900 NA NA  
1,000 NA NA

Any comments and suggestions are appreciated.

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [November 21, 2019, 6:56pm UTC](https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212/4 "2019-11-21T18:56:50Z")

</div>

I never look at rarefaction curves. Use summary.single instead with the number of sequences you want the data rarefied to. We go through this in the MiSeq SOP.

Pat

---

<div class="post-metadata">

**Author:** ![ZhangChiqian](https://avatars.discourse-cdn.com/v4/letter/z/94ad74/32.png) [@ZhangChiqian](https://forum.mothur.org/u/ZhangChiqian)\
**Post date:** [November 24, 2019, 2:35am UTC](https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212/5 "2019-11-24T02:35:55Z")

</div>

I see. Thanks for the reply. Have a nice weekend!

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/system/32/2_2.png) [@system](https://forum.mothur.org/u/system)\
**Post date:** [December 4, 2019, 2:36am UTC](https://forum.mothur.org/t/a-question-about-the-nas-when-fenerating-the-rarefraction-curves/20212/6 "2019-12-04T02:36:00Z")

</div>

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