Ejercicio 1.4

library(seqinr)
dengue=read.fasta("e:/Users/DANILO/Downloads/dengue")
seqden=dengue[[1]]
seqlength=length(seqden)
seqlength
## [1] 10735
dentable=table(seqden)
seqdenG=dentable[[3]]
seqdenG
## [1] 2770
propG=seqdenG/seqlength
propG
## [1] 0.2580345
prop.test(seqdenG,seqlength,alternative = "g",p = 0.25)
## 
##  1-sample proportions test with continuity correction
## 
## data:  seqdenG out of seqlength, null probability 0.25
## X-squared = 3.6531, df = 1, p-value = 0.02798
## alternative hypothesis: true p is greater than 0.25
## 95 percent confidence interval:
##  0.2511035 1.0000000
## sample estimates:
##         p 
## 0.2580345

la hipotesis nula se rechaza ya que el p-value es menor del 5%

Ejercicio 1.5

library(seqinr)
dengue2=read.fasta("e:/Users/DANILO/Downloads/dengue 2")
seqden2=dengue2[[1]]
seqlength2=length(seqden2)
seqlength2
## [1] 10723
tableden=count(seqden, 2)
TGden=tableden[[15]]
TGden
## [1] 832
tableden2=count(seqden2,2)
TGden2=tableden2[[15]]
TGden2
## [1] 795
prop.test(x = c(TGden,TGden2),n = c(seqlength,seqlength2),alternative = "two.sided")
## 
##  2-sample test for equality of proportions with continuity correction
## 
## data:  c(TGden, TGden2) out of c(seqlength, seqlength2)
## X-squared = 0.81889, df = 1, p-value = 0.3655
## alternative hypothesis: two.sided
## 95 percent confidence interval:
##  -0.003812892  0.010540479
## sample estimates:
##     prop 1     prop 2 
## 0.07750349 0.07413970

la hipotesis nula no se rechaza ya que el p-value es mayor al 5%

Ejercicio 1.6

sec=seqden[400:550]
sec
##   [1] "g" "a" "c" "c" "a" "t" "g" "c" "t" "c" "c" "t" "c" "a" "t" "g" "c" "t"
##  [19] "g" "c" "t" "g" "c" "c" "c" "a" "c" "a" "g" "c" "c" "c" "t" "g" "g" "c"
##  [37] "g" "t" "t" "c" "c" "a" "t" "c" "t" "g" "a" "c" "c" "a" "c" "c" "c" "g"
##  [55] "a" "g" "g" "g" "g" "g" "a" "g" "a" "g" "c" "c" "g" "c" "a" "c" "a" "t"
##  [73] "g" "a" "t" "a" "g" "t" "t" "a" "g" "c" "a" "a" "g" "c" "a" "g" "g" "a"
##  [91] "a" "a" "g" "a" "g" "g" "a" "a" "a" "a" "t" "c" "a" "c" "t" "t" "t" "t"
## [109] "g" "t" "t" "t" "a" "a" "g" "a" "c" "c" "t" "c" "t" "g" "c" "a" "g" "g"
## [127] "t" "g" "t" "c" "a" "a" "c" "a" "t" "g" "t" "g" "c" "a" "c" "c" "c" "t"
## [145] "t" "a" "t" "t" "g" "c" "a"
length(sec)
## [1] 151
cuentaden=count(sec,1)
Gden=cuentaden[[3]]
Tden=cuentaden[[4]]
CocienteTG=Tden/Gden
CocienteTG
## [1] 0.8918919
prop.test(x = c(Gden,Tden),n = c(151,151), alternative = "g")
## 
##  2-sample test for equality of proportions with continuity correction
## 
## data:  c(Gden, Tden) out of c(151, 151)
## X-squared = 0.16736, df = 1, p-value = 0.3412
## alternative hypothesis: greater
## 95 percent confidence interval:
##  -0.05997342  1.00000000
## sample estimates:
##    prop 1    prop 2 
## 0.2450331 0.2185430

la hipotesis nula no se rechaza ya que el p-value es mayor al 5%

Ejercicio 1.7

library(seqinr)
secden=seqden[400:500]
secden
##   [1] "g" "a" "c" "c" "a" "t" "g" "c" "t" "c" "c" "t" "c" "a" "t" "g" "c" "t"
##  [19] "g" "c" "t" "g" "c" "c" "c" "a" "c" "a" "g" "c" "c" "c" "t" "g" "g" "c"
##  [37] "g" "t" "t" "c" "c" "a" "t" "c" "t" "g" "a" "c" "c" "a" "c" "c" "c" "g"
##  [55] "a" "g" "g" "g" "g" "g" "a" "g" "a" "g" "c" "c" "g" "c" "a" "c" "a" "t"
##  [73] "g" "a" "t" "a" "g" "t" "t" "a" "g" "c" "a" "a" "g" "c" "a" "g" "g" "a"
##  [91] "a" "a" "g" "a" "g" "g" "a" "a" "a" "a" "t"
tabladen=count(secden,2)
tabladen
## 
## aa ac ag at ca cc cg ct ga gc gg gt ta tc tg tt 
##  6  5 10  6 10 11  3  6  9 10  7  2  2  4  7  2
secden2=seqden2[400:500]
secden2
##   [1] "g" "c" "a" "g" "g" "c" "a" "t" "g" "a" "t" "c" "a" "t" "t" "a" "t" "g"
##  [19] "c" "t" "g" "a" "t" "t" "c" "c" "a" "a" "c" "a" "g" "t" "g" "a" "t" "g"
##  [37] "g" "c" "g" "t" "t" "c" "c" "a" "t" "t" "t" "a" "a" "c" "c" "a" "c" "a"
##  [55] "c" "g" "t" "a" "a" "c" "g" "g" "a" "g" "a" "a" "c" "c" "a" "c" "a" "c"
##  [73] "a" "t" "g" "a" "t" "c" "g" "t" "c" "a" "g" "c" "a" "g" "a" "c" "a" "a"
##  [91] "g" "a" "g" "a" "a" "a" "g" "g" "g" "a" "a"
tabladen2=count(secden2,2)
tabladen2
## 
## aa ac ag at ca cc cg ct ga gc gg gt ta tc tg tt 
##  8  9  8  9 14  4  4  1 10  5  5  4  3  5  6  5
TA=tabladen[[13]]
GC=tabladen[[10]]
TA2=tabladen2[[13]]
GC2=tabladen2[[10]]
cociente=TA/GC
cociente
## [1] 0.2
cociente2=TA2/GC2
cociente2
## [1] 0.6
prop.test(x=c(TA,TA2),n=c(GC,GC2),alternative = "g")
## Warning in prop.test(x = c(TA, TA2), n = c(GC, GC2), alternative = "g"): Chi-
## squared approximation may be incorrect
## 
##  2-sample test for equality of proportions with continuity correction
## 
## data:  c(TA, TA2) out of c(GC, GC2)
## X-squared = 0.9375, df = 1, p-value = 0.8335
## alternative hypothesis: greater
## 95 percent confidence interval:
##  -0.9661187  1.0000000
## sample estimates:
## prop 1 prop 2 
##    0.2    0.6

la hipotesis nula no se rechaza ya que el p-value es mayor a 5%