コード例 #1
0
        /// <summary>
        /// Calculate base number in a cds where 'pos' is
        /// </summary>
        /// <param name="pos"></param>
        /// <returns></returns>
        protected long CdsBaseNumber(long pos)
        {
            long cdsbn = Transcript.BaseNumberCds(pos, true);

            // Does not intersect the transcript?
            if (cdsbn < 0)
            {
                // 'pos' before transcript start
                if (pos <= Transcript.CdsOneBasedStart)
                {
                    if (Transcript.IsStrandPlus())
                    {
                        return(0);
                    }
                    return(Transcript.RetrieveCodingSequence().Count);
                }

                // 'pos' is after CDS end
                if (Transcript.IsStrandPlus())
                {
                    return(Transcript.RetrieveCodingSequence().Count);
                }
                return(0);
            }

            return(cdsbn);
        }
コード例 #2
0
 private long cdsBaseNumber(long pos, bool usePrevBaseIntron)
 {
     if (pos < cdsStart)
     {
         return(Transcript.IsStrandPlus() ? 0 : Transcript.RetrieveCodingSequence().Count - 1);
     }
     if (pos > cdsEnd)
     {
         return(Transcript.IsStrandPlus() ? Transcript.RetrieveCodingSequence().Count - 1 : 0);
     }
     return(Transcript.BaseNumberCds(pos, usePrevBaseIntron));
 }