1 year ago

#287480

test-img

Khurram Basharat

Calculate sample proportions for n=1000 and mean of sample proportions in R

I want to calculate the mean of the sample proportions of 5-Mers that are AATAA. But stuck in obtaining 100 samples each of length 1000 of sample proportion of 5-MERS that are AATAA from the first 100,000 nucleotides of NC_006620.3

library(ape)
library(seqinr)
library("stringr")

dog_ch38 <- read.GenBank("NC_006620.3") # 

dog_ch38 <- str_to_upper(dog_ch38)

    enter code here

get_DNA_sample <- function(DNA, n){
       N <- str_length(DNA)
       start <- sample(1:(N - n + 1), size = 1)
       return(str_sub(DNA, start, start + n - 1))
   }
get_DNA_sample(dog_ch38, 1000)

r

bioinformatics

dna-sequence

0 Answers

Your Answer

Accepted video resources