Commit c0861451 authored by Beatriz Vicoso's avatar Beatriz Vicoso
Browse files

Update dNdS.md

parent 62fc1305
......@@ -66,3 +66,36 @@ cat dS_a/KaKs/* | cut -f 1,2,4,7 | grep 'NG' | perl -pi -e 's/-/\t/gi' > dS_a_NG
cat dS_b/KaKs/* | cut -f 1,2,4,7 | grep 'NG' | perl -pi -e 's/-/\t/gi' > dS_b_NG.txt
cat dS_ab/KaKs/* | cut -f 1,2,4,7 | grep 'NG' | perl -pi -e 's/-/\t/gi' > dS_ab_NG.txt
```
## Plot
In R:
```
minL<-0
dsa<-read.table("~/Documents/Will/Carp/Carp2022/4-dNdS/dS_a_NG.txt", head=F, sep="\t", fill=T)
dsb<-read.table("~/Documents/Will/Carp/Carp2022/4-dNdS/dS_b_NG.txt", head=F, sep="\t", fill=T)
dsab<-read.table("~/Documents/Will/Carp/Carp2022/4-dNdS/dS_ab_NG.txt", head=F, sep="\t", fill=T)
colnames(dsa)<-c("barb", "subA", "NG", "dSa", "La")
colnames(dsb)<-c("barb", "subB", "NG", "dSb", "Lb")
colnames(dsab)<-c("subA", "subB", "NG", "dSab", "Lab")
dsa<-na.omit(dsa)
dsa<-subset(dsa, La> minL)
dsb<-na.omit(dsb)
dsb<-subset(dsb, Lb> minL)
dsab<-na.omit(dsab)
dsab<-subset(dsab, Lab> minL)
head(dsa)
#plot
par(mar=c(4,4,1,1))
plot(density(dsa$dSa), col="#1F78B4", xlim=c(0,0.8), ylim=c(0,10), lwd=2, main="", xlab="dS (Nei-Gojobori)")
lines(density(dsb$dSb), col="#33A02C", lwd=2)
lines(density(dsab$dSab), col="#FB9A99", lwd=2)
#abline(v=median(dsa$dSa, na.rm=T), col="#1F78B4")
#abline(v=median(dsb$dSb, na.rm=T), col="#33A02C")
#abline(v=median(dsab$dSab, na.rm=T), col="#FB9A99")
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment