[emboss-dev] ajSeqNewRange, sequence accuracy values
Mahmut Uludag
uludag at ebi.ac.uk
Fri Jun 25 12:26:50 UTC 2010
Hi Alan,
> As a heuristic: In cases where you find you'd need to access AJAX
> object internals from either nucleus (or an application), then that
> is a sign that a new AJAX function of some sort is required.
> [assuming there isn't a preferred way of doing something which you've
> missed of course]
>
> On that basis alone I'd go for the function.
Thanks. Did you mean the new function I copied or a new ajSeqNewRange
function with its first argument being a sequence object? If you meant
the new ajSeqAssignAccuracy function then does its name sounds correct?
I have noticed that I should have the following conditions in the
ajSeqAssignAccuracy function rather than checking them before calling
the function.
(src->Accuracy!=NULL && src->Qualsize>0)
Mahmut
> > Working on a problem I need to copy sequence accuracy values when a new
> > sequence object is defined using part of a larger original sequence.
> >
> > Since ajSeqNewRange functions in ajseq.c doesn't have sequence object as
> > input arguments (but the sequence string) I either need to define a new
> > ajSeqNewRange function with the source sequence object as one of the
> > inputs or I should define a new function similar to the following that
> > can be called after calling the ajSeqNewRange function.
> >
> > /* @func ajSeqAssignAccuracy
> > ************************************************
> > **
> > ** Copies accuracy values from src sequence to dest sequence.
> > ** Assumes dest sequence was a subset of the src sequence.
> > **
> > ** @param [r] dest [AjPSeq] sequence object to be updated
> > ** @param [r] src [AjPSeq] source sequence objcet for accuracy values
> > ** @param [r] offset [ajint] start point in the src sequence where the
> > ** dest sequence was copied from
> > **
> > ** @return [void]
> > ******************************************************************************/
> >
> > void ajSeqAssignAccuracy(AjPSeq dest, AjPSeq src, ajint offset)
> > {
> >
> > dest->Qualsize = ajSeqGetLenUngapped(dest);
> > AJCNEW0(dest->Accuracy,dest->Qualsize);
> > memmove(dest->Accuracy,src->Accuracy+offset,
> > dest->Qualsize*sizeof(float));
> > }
> >
> > Another alternative would be to make AJCNEW0 and memmove calls in
> > embaln.c where we call the ajSeqNewRange function.
> >
> > I'm finding it difficult to decide, I would appreciate any suggestions.
> >
> > Mahmut
More information about the emboss-dev
mailing list