Question: error when using matchProbePair with BSgenome.Hsapiens.UCSC.hg19
0
gravatar for svetlana.gorokhova
5 months ago by
svetlana.gorokhova0 wrote:

Hi, I'm trying to get genomic coordinates (hg19) for a pair of primers, but I'm getting an error.

Here's the code used and the message received:

> library(Biostrings)
> library(BiocManager)
> library(BSgenome.Hsapiens.UCSC.hg19)
> testF <- DNAString(x= "CACGGCCGCAGTCCCAATCA")
> testR <- DNAString(x= "TGGGCATGCGCAACCTCTCG")
> genome <- BSgenome.Hsapiens.UCSC.hg19
> matchProbePair(testF, testR, genome)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘matchProbePair’ for signature ‘"BSgenome"’

thanks for your help

ADD COMMENTlink modified 5 months ago by James W. MacDonald51k • written 5 months ago by svetlana.gorokhova0
Answer: error when using matchProbePair with BSgenome.Hsapiens.UCSC.hg19
0
gravatar for James W. MacDonald
5 months ago by
United States
James W. MacDonald51k wrote:

Have you looked at the help page for matchProbePairs?

Usage:

     matchProbePair(Fprobe, Rprobe, subject, algorithm="auto", logfile=NULL, verbose=FALSE)

Arguments:

  Fprobe: The forward probe.

  Rprobe: The reverse probe.

 subject: A DNAString object (or an XStringViews object with a
          DNAString subject) containing the target sequence.

A BSgenome object is definitely not a DNAString object. There are also examples!

Examples:

     library(BSgenome.Dmelanogaster.UCSC.dm3)
     subject <- Dmelanogaster$chr3R

     ## With 20-nucleotide forward and reverse probes:
     Fprobe <- "AGCTCCGAGTTCCTGCAATA"
     Rprobe <- "CGTTGTTCACAAATATGCGG"
     matchProbePair(Fprobe, Rprobe, subject) # 1 "theoretical amplicon"

     ## With shorter forward and reverse probes, the risk of having multiple
     ## "theoretical amplicons" increases:
     Fprobe <- "AGCTCCGAGTTCC"
     Rprobe <- "CGTTGTTCACAA"

which I think show how to use the function?

ADD COMMENTlink written 5 months ago by James W. MacDonald51k

before posting the question, I spent a lot of time on that help page and I tried many other combinations, inluding putting Hsapiens$chr11 (where my primers are) as subject, without success. Is it possible to use matchProbePair with the whole human genome? Is there a different package/function I should look into (I'm new to Bioconductor)? I need to get coordinates for 500 primer pairs, so In-Silico-PCR from UCSC browser is not an option. Thank you

ADD REPLYlink written 5 months ago by svetlana.gorokhova0

Well you would have to show some code. If I do that, it seems to work OK.

> testF <- DNAString("CACGGCCGCAGTCCCAATCA")
> testR <- DNAString("TGGGCATGCGCAACCTCTCG")
> matchProbePair(testF, testR, Hsapiens$chr11)
  Views on a 135086622-letter DNAString subject
subject: NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN...NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
views:
       start      end width
[1] 67482832 67483347   516 [CACGGCCGCAGTCCCAATCAATTC...AGGCGAGAGGTTGCGCATGCCCA]
ADD REPLYlink written 5 months ago by James W. MacDonald51k

Well that was on hg38. For completeness, here is hg19

> testF <- DNAString("CACGGCCGCAGTCCCAATCA")
> testR <- DNAString("TGGGCATGCGCAACCTCTCG")
> matchProbePair(testF, testR, Hsapiens$chr11)
  Views on a 135006516-letter DNAString subject
subject: NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN...NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
views:
       start      end width
[1] 67250303 67250818   516 [CACGGCCGCAGTCCCAATCAATTC...AGGCGAGAGGTTGCGCATGCCCA]

That sounds like a lot of PCR primer pairs. But if you really need to do something like that, you could just set up a loop for each chromosome where you run matchProbePair for each of the PCR primers that are supposed to bind to that chromosome. There may be some other, better trick than that, and if so hopefully Herve Pages will see this post and let you know what that is.

ADD REPLYlink written 5 months ago by James W. MacDonald51k

It works now for chr11 example. I'll loop through the chromosomes to get the matches in the the whole genome. Thanks for your help!

ADD REPLYlink written 5 months ago by svetlana.gorokhova0

I now found everything I need to search Genomes for patterns in the excellent guide by Hervé Pages! https://bioconductor.org/packages/release/bioc/vignettes/BSgenome/inst/doc/GenomeSearching.pdf

ADD REPLYlink written 5 months ago by svetlana.gorokhova0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 125 users visited in the last hour