error when using matchProbePair with BSgenome.Hsapiens.UCSC.hg19
1
0
Entering edit mode
@svetlanagorokhova-16615
Last seen 5.6 years ago

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

matchProbePair BSgenome Biostrings BSgenome.Hsapiens.UCSC.hg19 • 1.4k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 7 days ago
United States

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 577 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6