Shannon's Entropy by Sliding Window in R
0
0
Entering edit mode
2.0 years ago
Alex • 0

Hellow there. I have a fasta file containing aligned sequences (around 1,000). I need to calculate the entropy using the sliding window method on this file. How can this be done in R?

Sequence Window R Entropy Sliding • 1.4k views
ADD COMMENT
1
Entering edit mode

what did you try so far ? Show us the code.

ADD REPLY
0
Entering edit mode

To be honest, I haven't tried anything. I've never come across this topic before. I don't know much about python, so I'm looking for a solution in R if it exist

ADD REPLY
0
Entering edit mode

I would suggest starting by googling "apply function in sliding window in R". Learning how to google and find stuff out like this is the most important skill in bioinformatics. People here are very willing to help, but you have to show some effort first.

ADD REPLY
0
Entering edit mode

Okay, thank you

ADD REPLY
0
Entering edit mode

zoo::rollapply is your friend

ADD REPLY
0
Entering edit mode

If I remember correctly, TFBStools package in R has a shannon.entropy() function that you could use, maybe you need to calculate it per position and take mean over every window?

ADD REPLY
0
Entering edit mode

Yes I do this

ADD REPLY
0
Entering edit mode

Hi

Were u able to achieve this?

ADD REPLY

Login before adding your answer.

Traffic: 2894 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6