Replies: 2 comments 2 replies
-
I still have another question: I have some plot that looks thicker than others for example tree1 in my sample |
Beta Was this translation helpful? Give feedback.
-
HI! Regarding the first question, it’s hard to say without looking at the actual alignments. It’s not clear how many clones you have in that tree. Technically speaking, it could be just a few clones that all share the same hypermutations or maybe some unidentified alleles. Again, about the thick plot, it’s difficult to determine what’s happening without reviewing the actual data and knowing how many clones are present. “And how can I make 9 trees into one average tree to compare them to each other?” Could you clarify what you mean by an average tree? |
Beta Was this translation helpful? Give feedback.
-
Hi , I generated some weird plots of mutationPositionPlot. I use the script of the website, but the generated plot looks like this:
S5_mutationPositionPlot_Tree1.pdf
The code I use is
`mutationPositionPlot<-function(trId){
treeDb<-lng_db_merge%>% filter(!is.na(cloneId),treeId==trId) %>%
mutate(CDR1BeginPosition=0,
FR2BeginPosition=positionInReferenceOfFR2Begin-positionInReferenceOfCDR1Begin,
CDR2BeginPosition=positionInReferenceOfCDR2Begin-positionInReferenceOfCDR1Begin,
FR3BeginPosition=positionInReferenceOfFR3Begin-positionInReferenceOfCDR1Begin,
CDR3BeginPosition=positionInReferenceOfCDR3Begin-positionInReferenceOfCDR1Begin,
FR4BeginPosition=positionInReferenceOfCDR3Begin-positionInReferenceOfCDR1Begin+nchar(nSeqCDR3))
FR2Pos<-treeDb %>%
pull(FR2BeginPosition) %>%
unique()%>% min()
CDR2Pos<-treeDb %>%
pull(CDR2BeginPosition) %>%
unique() %>% min()
FR3Pos<-treeDb %>%
pull(FR3BeginPosition) %>%
unique()%>% min()
CDR3Pos<-treeDb %>%
pull(CDR3BeginPosition) %>%
unique()%>% min()
FR4Pos<-treeDb %>%
pull(FR4BeginPosition) %>%
unique()%>% min()
mutByRegion<-str_extract_all(treeDb %>%
pull(
nMutations{CDR1Begin:FR3End}BasedOnGermline
),"[0-9][0-9][0-9]") %>% unlist() %>% table() %>%
enframe(name = "position",value="nMut") %>%
mutate(position=as.integer(position),nMut=as.integer(nMut),
region=case_when(
position<FR2Pos ~ "CDR1",
position<CDR2Pos ~ "FR2",
position<FR3Pos ~ "CDR2",
position<CDR3Pos ~ "FR3"
)) %>%
bind_rows(
str_extract_all(treeDb %>% pull(nMutationsCDR3BasedOnGermline),
"[0-9][0-9][0-9]") %>% unlist() %>% table() %>%
enframe(name = "position",value="nMut") %>%
mutate(position=as.integer(position)+CDR3Pos,nMut=as.integer(nMut),
region="CDR3")
) %>%
bind_rows(
str_extract_all(treeDb %>% pull(nMutationsFR4BasedOnGermline),
"[0-9][0-9][0-9]") %>% unlist() %>% table() %>%
enframe(name = "position",value="nMut") %>%
mutate(position=as.integer(position)+FR4Pos,nMut=as.integer(nMut),
region="FR4")
) %>%
mutate(freqMut=nMut/nrow(treeDb))
g<-mutByRegion%>%
ggplot(aes(x=position,y=freqMut,fill=region)) +
theme_bw()+
geom_bar(stat="identity")+
scale_fill_manual(values=mi_dark)+
geom_vline(xintercept = c(FR2Pos,CDR2Pos,FR3Pos,CDR3Pos,FR4Pos),color="grey28",linetype=2)+
theme(legend.position = "none")+
scale_x_continuous(expand=c(0,0)) +
scale_y_continuous(expand=c(0,0)) +
labs(y="Mutation freq.", x="Position")
print(g)
}
mutationPositionPlot(1)`
My professor said to me this is impossible to have so many mutation of frequency 1.
Could you told me if I correctly use the script or our data didn't fit the script
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions