[emboss-dev] ajSeqNewRange, sequence accuracy values

ajb at ebi.ac.uk ajb at ebi.ac.uk
Fri Jun 25 12:03:45 UTC 2010


Hi Mahmut,

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.

Alan


> 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
>
>
> _______________________________________________
> emboss-dev mailing list
> emboss-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/emboss-dev
>





More information about the emboss-dev mailing list