BIOINFORMATICS Problem that i am struggling to solve. Computation of Profile
If anybody can answer this question i shall be grateful
Consider the following profile matrix Profile:
A: 0.4 0.3 0.0 0.1 0.0 0.9
C: 0.2 0.3 0.0 0.4 0.0 0.1
G: 0.1 0.3 1.0 0.1 0.5 0.0
T: 0.3 0.1 0.0 0.4 0.5 0.0
Compute Pr(TCGGTA|Profile). (Express your answer as a decimal and do not round your answer more than 5 decimal places.)
• 5,077 views
•
link
1 answer
This is a bit of R code to do this,
options(digits=5)
probTable<-data.frame("A"=c(0.4, 0.3, 0.0, 0.1, 0.0, 0.9),
"C"=c(0.2, 0.3, 0.0, 0.4, 0.0, 0.1),
"G"=c( 0.1, 0.3, 1.0, 0.1, 0.5, 0.0),
"T"=c(0.3, 0.1, 0.0, 0.4, 0.5, 0.0))
profileprob<-function(profile,probTable){
profileVector=unlist(strsplit(profile,""))
score=1
for (eachBasePosn in (1:length(profileVector))){
score=score*(probTable[eachBasePosn,profileVector[eachBasePosn]])
}
print(paste0("Probability score of profile",profile," is :",score ))
}
profileprob(profile="TCGGTA",probTable)
For a new profile run it as profileprob(profile="TCGGTA",probTable)
• 0 views
•
link
Log in to answer this question.
Hello meatmangler0!
It appears that your post has been cross-posted to another site: http://seqanswers.com/forums/showthread.php?p=237082#post237082
This is typically not recommended as it runs the risk of annoying people in both communities.
and Reddit r/bioinformatics https://www.reddit.com/r/bioinformatics/comments/llrr1w/bioinformatics_problem_i_am_struggling_to_solve/
Also, this looks like directly copied from an assignment. While you got a good answer now, posting this like it is might be considered against our netiquette. In any case, you should check if you understand why the probabilities are calculated the way it is done. In addition, wouldn't it be more realistic to deal with log probabilities?