jonathonthill / sangerseqR

git for the Bioconductor package "sangerseqR"
11 stars 10 forks source link

makeBaseCalls can ignore the highest signal #5

Open cbird808 opened 9 months ago

cbird808 commented 9 months ago

It looks like the makeBaseCalls() function can ignore the dominant peak when a nucleotide is repeated, especially when the signal does not return to zero between nucleotides. I tried to upload an ab1 file, but it's not supported. Instead, I provided the images of the chromatograms before and after makeBaseCalls(), as well as the R script below

original_primary_base_calls

makeBaseCalls

#### Packages ####
packages_used <- 
  c(
    "rstudioapi", # have to install from github, messes up tidyverse code, have to add dplyr:: to several commands
    "tidyverse",
    "janitor",
    "sangerseqR"
  )

packages_to_install <- 
  packages_used[!packages_used %in% 
                  installed.packages()[,1]]

if (length(packages_to_install) > 0) {
  install.packages(
    packages_to_install, 
    Ncpus = Sys.getenv("NUMBER_OF_PROCESSORS") - 1
  )
}

lapply(packages_used, 
       require, 
       character.only = TRUE)

#### SETDIR ####

setwd(dirname(rstudioapi::getActiveDocumentContext()$path))

#### ####
browseVignettes("sangerseqR")

test_ab1 <- 
  read.abif("../data/rbd_01_E1_LCO1490_2023-12-28_A07.ab1")

test_sanger <-
  readsangerseq("../data/rbd_01_E1_LCO1490_2023-12-28_A07.ab1")

primarySeq(test_sanger)

primarySeq(test_sanger,
           string=TRUE)

chromatogram(
  test_sanger, 
  # width = 80, 
  # height = 3, 
  trim5 = 10, 
  trim3 = 1,
  showcalls = "primary",
  showtrim = TRUE
  )

# first chromatogram image clipped

hetcalls <- 
  makeBaseCalls(
    test_sanger, 
    ratio = 0.33
    )

chromatogram(
  hetcalls, 
  # width = 80, 
  # height = 3, 
  trim5 = 10, 
  trim3 = 1,
  showcalls = "both",
  showtrim = TRUE
)

# second chromatogram image clipped