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!
• 2,366 views
•
link
0 answers
No answers yet.
Log in to answer this question.
homework ? what have you tried ?
Hello Kevin_Smith!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
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.
Sorry, I can link another question A: How To Compare All The K-Mers Of A Given Length With All The K-Length Sub String and the Answer by Damian Kao.