/Users/cpanrun/depot/main/contrib-patched/perl/CPAN/src/Peptide-Pubmed/blib/lib/Peptide/Kmers.pm


new

  Args        : none
  Example     : my $pk = Peptide::Kmers->new(verbose => 2);
  Description : bare constructor
  Returns     : TRUE if successful, FALSE otherwise.

log_prop_kmers

  Args        : %named_parameters:
                k : length of the k-mer. Allowed values: positive integer. Mandatory.
                in_fh : filehandle for the input file. If missing, STDIN is used. 
                min : min number of occurrences. Allowed values: non-negative real number. Mandatory. Suggested values: 1 (equivalent to assuming that the k-mer occurred once even if it actually did not occur) or 0.5.
                maxtotal : max total number of occurrences. Allowed values: positive integer. Optional.
  Example     : my %log_prop = $pk->log_prop_kmers(k => 3, min => 1, text => [ qw(aecaecaecd aecd xyz123) ]);
  Description : For all overlapping k-mers (words of length k) in the input, computes the frequency of occurrence within the input text. Only allowed k-mers (those returned by kmers()) are counted. If the k-mer does not occur, min number of occurrences (eg, 0.5 or 1) is used as default threshold. Computes log10(proportion(k-mer)), where proportion(k-mer) = frequency(k-mer) / sum( all frequencies). For example, if input has 2 words: 'fooo' and 'bar', and k=2, the k-mers are: 'fo', 'oo', 'oo', 'ba', 'ar'. The frequencies are: 2 for 'oo', and 1 for the rest of the k-mers. Prints sum( all frequencies) into STDERR. If maxtotal is defined, input processing is stopped if sum( all frequencies) >= maxtotal. If this prevents any input from being processed, a warning is printed into STDERR. All warning can be suppressed by setting verbose arg to 1 or below). For comparing log10(proportion(k-mer)) from 2 different text sources, for example sequences and non-sequences, it is best to compute using the same sum( all frequencies). Thus, execute the code twice. First time, execute using undefined maxtotal, just to compute the sum( all frequencies) for the entire text from each of the sources. Second time, execute using the same maxtotal = min sum( all frequencies) for each source.
  Returns     : hash with keys = k-mers and values = log10(proportion(k-mer)) if successful, FALSE otherwise.

kmers

  Args        : %named_parameters:
                mandatory:
                k : length of the k-mer. Allowed values: positive integer.
  Example     : $pk->kmers(k => 3))[0,1,-1] # returns qw(aaa aab zzz)
  Description : Creates a list of different allowed k-mers (words of length k, using lowercase chars a-z). 
  Returns     : resulting list

 /Users/cpanrun/depot/main/contrib-patched/perl/CPAN/src/Peptide-Pubmed/blib/lib/Peptide/Kmers.pm