Learn R Programming

sangerseqR (version 1.8.2)

setAllelePhase: Set Reference and Alternate Alleles

Description

Parses the Primary and Secondary Sequences into Reference and Alternate Alleles

Usage

setAllelePhase(obj, refseq, trim5 = 0, trim3 = 0)

## S3 method for class 'sangerseq': setAllelePhase(obj, refseq, trim5 = 0, trim3 = 0)

Arguments

obj
sangerseq class object
refseq
DNAString for character string of reference allele sequence.
trim5
Number of bases to trim from the beginning of the sequence.
trim3
Number of bases to trim from the end of the sequence.

Value

  • A sangerseq object with the Reference Allele in the primarySeq slot and the Alternate Allele in the secondarySeq slot.

Details

When multiple heterozygous basecalls are made, it is generally unclear which calls are in phase with each other. This function takes a reference sequence for one of the alleles to match the primary and secondary basecalls as reference or alternate allele.

See Also

makeBaseCalls, chromatogram, sangerseq

Examples

Run this code
#Load Sequences
hetsangerseq <- readsangerseq(system.file("extdata",
                                          "heterozygous.ab1",
                                          package = "sangerseqR"))
homosangerseq <- readsangerseq(system.file("extdata",
                                           "homozygous.scf",
                                           package = "sangerseqR"))
#Make calls on heterozygous sequence to be parsed
hetcalls <- makeBaseCalls(hetsangerseq, ratio = 0.33)
#Need a reference sequence to set phase. Can get from annotation
#(e.g. Refseq) or another sanger sequencing file
ref <- subseq(primarySeq(homosangerseq, string = TRUE),
              start = 30,
              width = 500)
#Set the phase
hetseqalleles <- setAllelePhase(hetcalls, ref, trim5 = 50, trim3 = 100)
#Align to compare alleles
pa <- pairwiseAlignment(primarySeq(hetseqalleles),
                                   secondarySeq(hetseqalleles),
                                   type = "global-local")
writePairwiseAlignments(pa)

Run the code above in your browser using DataLab