text: user6593: Let's say we have a metagenomic sample that is paired-end FASTQ files including 10,000,000 DNA reads collected using shotgun sequencing. 
  How would one make a random subsample of the mentioned metagenomic sample with for example 1,000,000 reads? I know about the seqtk function that could be used in such cases, but my question is more about whether it is meaningful to represent a metagenomic sample with a small subsample generated using this way or it has to satisfy certain criteria, e.g. in terms of the number of reads and diversity to be a valid representative of the metagenomic sample? 
  Knowing that some species might be very rare in the sample, would it ever be proper to do subsampling on metagenomic samples? 
  
  user3848: I am not NGS expert, I known ML. Essentially you are performing data augmentation which is essential for ML. What I question is whether a replicate of e6 from a population of e7 would really be sufficient for ML because you need sample sizes (replicates in this case) of >100000. 
  The answer is really simple you bootstrap the data (sample with replacement), to obtain your replicates. Numpy has a random module that will do this,
  p.random.seed(345)
  pop = np.random.randint(0,10000000 , size=1000000)
  
  Use pop to select from fastaq. The other way in is to define each fastq sequence within pop then simply,
  sample = np.random.choice(pop, size=1000000)
  
  Or a combination of the two. If you can do ML you can do Python coding.
  
original_text: 6593: <p>Let's say we have a metagenomic sample that is paired-end FASTQ files including 10,000,000 DNA reads collected using shotgun sequencing. 
  How would one make a random subsample of the mentioned metagenomic sample with for example 1,000,000 reads? I know about the <code>seqtk</code> function that could be used in such cases, but my question is more about whether it is meaningful to represent a metagenomic sample with a small subsample generated using this way or it has to satisfy certain criteria, e.g. in terms of the number of reads and diversity to be a valid representative of the metagenomic sample? 
  Knowing that some species might be very rare in the sample, would it ever be proper to do subsampling on metagenomic samples? </p>
   3848: <p>I am not NGS expert, I known ML. Essentially you are performing data augmentation which is essential for ML. What I question is whether a replicate of e6 from a population of e7 would really be sufficient for ML because you need sample sizes (replicates in this case) of >100000. </p>
  
  <p>The answer is really simple you bootstrap the data (sample with replacement), to obtain your replicates. Numpy has a random module that will do this,</p>
  
  <pre><code>p.random.seed(345)
  pop = np.random.randint(0,10000000 , size=1000000)
  </code></pre>
  
  <p>Use <code>pop</code> to select from fastaq. The other way in is to define each fastq sequence within pop then simply,</p>
  
  <pre><code>sample = np.random.choice(pop, size=1000000)
  </code></pre>
  
  <p>Or a combination of the two. If you can do ML you can do Python coding.</p>
  