The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

GH::EditOp - A simple perl object (implemented in C) that represents various edit operations used in sequence alignments.

SYNOPSIS

# this example (and this man page) may be out of date.  Think twice.

use GH::EditOp;

my $editop = new GH::EditOp;

# make the op a "no-op", and see if it worked.
$editop->setType(NOP);
Not() if ($editop->getType() != NOP); Ok($i++);
Not() if ($editop->getOpName() ne "nop"); Ok($i++);

# make the op a "match op" and see if it worked.
$editop->setType(MATCH);
Not() if ($editop->getType() != MATCH); Ok($i++);
Not() if ($editop->getOpName() ne "match"); Ok($i++);

# make the op a "mismatch op" and 
$editop->setType(MISMATCH);
Not() if ($editop->getType() != MISMATCH); Ok($i++);
Not() if ($editop->getOpName() ne "mismatch"); Ok($i++);

$editop->setType(INSERT_S1);
Not() if ($editop->getType() != INSERT_S1); Ok($i++);
Not() if ($editop->getOpName() ne "insert_s1"); Ok($i++);

$editop->setType(INSERT_S2);
Not() if ($editop->getType() != INSERT_S2); Ok($i++);
Not() if ($editop->getOpName() ne "insert_s2"); Ok($i++);

$editop->setCount(0);
Not() if ($editop->getCount() != 0); Ok($i++);

$editop->setCount(2345);
Not() if ($editop->getCount() != 2345); Ok($i++);

print $op->getOpName, " ", $op->getCount;
if ($op->getCount == 1) {
  print " base.\n";
}
else {
  print " bases.\n";
}

DESCRIPTION

GH::EditOp provides an object that encapsulates an operation that might be used in a sequence alignment. Each object has a name and a count.

EXPORT

EXPORT_OK

None.

BUGS

The scoring scheme should more explicit.

Positions should start at 1. Except that then there would need to be a bug about positions starting at 0.

AUTHOR

George Hartzell, hartzell@cs.berkeley.edu

SEE ALSO

GH::MspTools.

perl(1).