/* $Id: thrdsgoi.c,v 1.2 2004/04/01 13:43:05 lavr Exp $ *=========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * File Name: thrdsgoi.c * * Author: Stephen Bryant * * Initial Version Creation Date: 08/16/2000 * * $Revision: 1.2 $ * * File Description: threader * * Modifications: * -------------------------------------------------------------------------- * $Log: thrdsgoi.c,v $ * Revision 1.2 2004/04/01 13:43:05 lavr * Spell "occurred", "occurrence", and "occurring" * * Revision 1.1 2000/08/16 20:45:21 hurwitz * initial check in of threading routines * * ========================================================================== */ /* Set core segment sampling order */ #include #include int sgoi(int is, int it, Rnd_Smp* pvl, Seg_Ord* sgo) { /*----------------------------------------------------*/ /* is: Code to determine order of segment sampling */ /* it: Code to determine order of terminus sampling */ /* pvl: Storage for segment location probabilities */ /* sgo: Segment samping order */ /*----------------------------------------------------*/ int nsc; /* Number of threaded core segments */ int i,j,k; /* Counters */ int *si; /* Segment index by order of sampling */ int *so; /* Flags segments already assigned an order */ int *to; /* Order of terminus sampling, 0=Nterm, 1=Cterm. */ float pv; /* P value */ /* Number of core segments */ nsc=sgo->nsc; /* Initialize alignment order arrays */ si=sgo->si; so=sgo->so; for(i=0; ito; /* Determine the order of core segment alignment */ /* printf("is:%d\n",is); */ switch(is) { default: { /* Order randomly */ /* printf("segment order by default random method\n"); */ pvl->n=nsc; for(i=0; ip[j]=pv; else pvl->p[j]=0.; } k=rsmp(pvl); so[k]=0; si[i]=k; } break; } case 1: { /* Order by occurrence in the core definition */ /* printf("segment order by occurrence, case 1\n"); */ for(i=0; in=2; pvl->p[0]=.5; pvl->p[1]=.5; to[i]=rsmp(pvl); } break; } case 1: { /* N-terminus first */ /* printf("segment order n-terminus first, case 1\n"); */ for(i=0; i