Menu

#362 Eliminate custom-enzyme option

post v2.0
open
Kaipo
None
2015-12-17
2015-12-17
No

(Written in December 2012 but never followed up on. The branch has since been deleted, though it should be available via SVN.)

In looking at the code for handling enzyme cleavages in Crux, I thought it was somewhat suboptimal to use a series of "if" statements to decide, for every possible cleavage location, whether the enzyme cleaves or not. I also wanted to put in a generic way of preventing any cleavages from happening. I therefore wrote an "Enzyme" class (in the "no-cleavage" branch of Crux) that takes as input a string (either the name of an enzyme or a custom enzyme cleavage rule) and stores two hash tables that indicate whether a cleavage will occur before and after, respectively, a given amino acid. Deciding whether a particular cleavage event occurs then becomes a simple "and" operation on these two hash tables, using the preceding and following amino acids as keys:

/*
* Decides whether the enzyme cleaves between the two specified amino acids.
* Use
/
bool Enzyme::cleaves(
char preceding,
char following
) {
return(precedingCleavage_[preceding] && followingCleavage_[following]);
}

At this point, the class seems to work, as far as I can tell. My idea is to simplify the interface to eliminate the "--custom-enzyme" flag and simply specify for the "--enzyme" flag either an enzyme name or a cleavage rule. The updated docs are stored in the branch.

The next step is to hook up this class with the parameter parsing options.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB