This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to make a frequent word counting program in python (record occurrence of every possible 7-mer)?

I will like to discover the common 7-mer from all the sequences in a file (.txt , each line in the file contains a single DNA sequence. Also the program should generate the reverse complement of each sequence and scan it).

So, the program should scan through each DNA sequence (and its reverse complement) using a 7 - mer window with a step of 1 and record the occurrence of every possible 7-mer.

I will appreciate very much any help for a python scrip. Thanks!

sequence sequencing blast alignment genome

I don't agree with the closing of my question. The previous questions are about available softwares that can scan DNA sequences and find occurrences of a K-mer.

My question is related with Python (No with available softwares) How to make a Python script for this kind of question. using a txt file as input that contains the DNA sequences.

Sincerely, Kevin

Loop over the string. Use a dictionary (collections.counter()) to keep the counts.

0 answers

No answers yet.

Log in to answer this question.