<p>5bp produces a high resolution analysis, providing its sufficiently robust.</p>

<p>Its a sliding window of 5 bp wide and 1 bp step length which runs along the length of each genome. They are performing SNP analysis/classification. The original sequence they were examining was,</p>

<pre><code>ATTAAAGGTTTAT
</code></pre>

<p>In any sliding window analysis the window size is arbitary towards the resolution and robustness of the analysis. The author believes that 5bp provides sufficiently robust information for a very high resolution classification/training analysis in their example. </p>

<p>The proof is the <code>accuracy</code> of the classification. I assume they have good results from 5bp. In ML the rationale is the general laws of ML (over/under training) and assessed on the test split in the data (probably 20%).</p>

<p>A key reason for the 1bp step is that this is the way ML works, you need a lot of data and by doing 5 bp sliding window at 1 bp step that will generate ~30 000 pieces of data for each sequence. So that's 3 million data points for 100 sequences. </p>

CC BY-SA 4.0
2020-04-20T01:41:56.057Z
Would the SNP analysis you mention include a classification algorithm such as principal component analysis?
greenpenguin
CC BY-SA 4.0
2020-04-20T09:24:40.080Z
Oh sorry thats different, PCA (ML) is a different analysis to the one I had in mind (supervised learning) and is usually performed in conjunction with tSNE @greenpenguin. PCA is judged on its ability to cluster the classification targets into different groups. PCA/tSNE is called unsupervised learning
M__
CC BY-SA 4.0
2020-04-17T19:37:49.467Z
2020-04-18T09:14:31.297Z
2020-04-18T09:14:31.297Z
M__
<p>I'm getting started in biology and bioinformatics with sequencing the SARS-Cov-2 or Coronavirus genome.  I'm interested in this code which identifies k-mers in the genome:</p>

<pre><code>from skbio import DNA 
DNA(str(seq.seq)).kmer_frequencies(5)
kmers = DNA(str(seq1.seq)).kmer_frequencies(5)
kmers
{'ATTAA': 60, 'TTAAA': 95, 'TAAAG': 64, 'AAAGG': 45, 'AAGGT': 46, 'AGGTT': 51, 'GGTTT': 55, 
'GTTTA': 69, 'TTTAT': 75,...}
</code></pre>

<p>The author of the code wants to use k-mer breakdowns to vectorize the data for machine learning purposes.  What I'm curious about is why the k-mer in this case is five nucleotides?  What factors should go into my selection of the length of the k-mer for analysis?</p>

<python><sequence-analysis><covid-19><k-mer><sars-cov-2>
Significance of k-mer length in COVID-19 sequence analysis?
# Significance of k-mer length in COVID-19 sequence analysis?

(Asked by: username_0 on 2020-04-17)

I'm getting started in biology and bioinformatics with sequencing the SARS-Cov-2 or Coronavirus genome.  I'm interested in this code which identifies k-mers in the genome:
from skbio import DNA 
DNA(str(seq.seq)).kmer_frequencies(5)
kmers = DNA(str(seq1.seq)).kmer_frequencies(5)
kmers
{'ATTAA': 60, 'TTAAA': 95, 'TAAAG': 64, 'AAAGG': 45, 'AAGGT': 46, 'AGGTT': 51, 'GGTTT': 55, 
'GTTTA': 69, 'TTTAT': 75,...}

The author of the code wants to use k-mer breakdowns to vectorize the data for machine learning purposes.  What I'm curious about is why the k-mer in this case is five nucleotides?  What factors should go into my selection of the length of the k-mer for analysis?

**Tags:** python, sequence-analysis, covid-19, k-mer, sars-cov-2

---

## 1 answers

### Answer by username_1 on 2020-04-17. Score: 0 | Accepted answer

5bp produces a high resolution analysis, providing its sufficiently robust.
Its a sliding window of 5 bp wide and 1 bp step length which runs along the length of each genome. They are performing SNP analysis/classification. The original sequence they were examining was,
ATTAAAGGTTTAT

In any sliding window analysis the window size is arbitary towards the resolution and robustness of the analysis. The author believes that 5bp provides sufficiently robust information for a very high resolution classification/training analysis in their example. 
The proof is the accuracy of the classification. I assume they have good results from 5bp. In ML the rationale is the general laws of ML (over/under training) and assessed on the test split in the data (probably 20%).
A key reason for the 1bp step is that this is the way ML works, you need a lot of data and by doing 5 bp sliding window at 1 bp step that will generate ~30 000 pieces of data for each sequence. So that's 3 million data points for 100 sequences.

> **Comments:**
> **username_0**: Would the SNP analysis you mention include a classification algorithm such as principal component analysis?  
> **username_1**: Oh sorry thats different, PCA (ML) is a different analysis to the one I had in mind (supervised learning) and is usually performed in conjunction with tSNE @greenpenguin. PCA is judged on its ability to cluster the classification targets into different groups. PCA/tSNE is called unsupervised learning  

---

