This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Search For Mismatches In A Seq

Dear all,

I want to look for a motif in a set of short reads allowing one mismatch. I have found in a post the reference to Bio::Grep::Backend::Vmatch. But I do not understand how to implement it. What is the format of the file that the method generate_database needs? See the code from the package synopsis below. thanks for the help.

generate a Vmatch suffix array. you have to do this only once.

  $sbe->generate_database({ 
    file          => 'ATH1.cdna', 
    description   => 'AGI Transcripts',
    datapath      => 'data',
    prefix_length => 3,
  });
bioperl perl

4 answers

Emboss has a few tools that can help with this. If you know the motif differences to expect and want to represent it as a regular expression for search, use dreg:

http://emboss.sourceforge.net/apps/release/6.3/emboss/apps/dreg.html

If you want to specify a pattern plus allowed mismatches, use fuzznuc with the -pmismatch parameter:

http://emboss.sourceforge.net/apps/release/6.3/emboss/apps/fuzznuc.html

These can be install locally and are also available as part of Galaxy:

http://usegalaxy.org

I am not familiar with the Bio::grep module but have you looked into using agrep (approximate grep) http://linux.die.net/man/1/agrep?

This sounds like a hamming distance problem.

Here are ruby snippets from a similar question on stackoverflow: http://stackoverflow.com/questions/5322428/finding-a-substring-while-allowing-for-mismatches-with-ruby

Also see this gist for implementing the same using a suffix array approach by Sammi Larbi https://github.com/codeodor/miscellany/blob/master/ruby_suffix_array/suffix_array.rb

The absolute fastest deterministic pattern scanning tool - which allow for given mismatches, insertions, and deletions - is scan_for_matches which can be downloaded here.

Log in to answer this question.