[emboss-dev] ajSeqNewRange, sequence accuracy values

Mahmut Uludag uludag at ebi.ac.uk
Fri Jun 25 10:49:34 UTC 2010


Hi,

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