BIOINFORMATICS Problem that i am struggling to solve. Computation of Profile
1
0
Entering edit mode
16 months ago

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


sequence genome homework • 1.3k views
0
Entering edit mode

Hello meatmangler0!

This is typically not recommended as it runs the risk of annoying people in both communities.

0
Entering edit mode

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?

1
Entering edit mode
16 months ago

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)