Beispiel #1
0
        private MutableTranscriptRegion[] ReadCdnaMaps()
        {
            var cols = GetColumns("cDNA");

            int numCdnaMaps = int.Parse(cols[1]);

            if (numCdnaMaps == 0)
            {
                return(null);
            }

            var cdnaMaps = new MutableTranscriptRegion[numCdnaMaps];
            var colIndex = 2;

            for (var i = 0; i < numCdnaMaps; i++)
            {
                int start     = int.Parse(cols[colIndex++]);
                int end       = int.Parse(cols[colIndex++]);
                int cdnaStart = int.Parse(cols[colIndex++]);
                int cdnaEnd   = int.Parse(cols[colIndex++]);
                cdnaMaps[i] = new MutableTranscriptRegion(TranscriptRegionType.Exon, 0, start, end, cdnaStart, cdnaEnd);
            }

            return(cdnaMaps);
        }
        private static List <MutableTranscriptRegion> AddGaps(this List <MutableTranscriptRegion> sortedRegions)
        {
            for (var i = 1; i < sortedRegions.Count; i++)
            {
                var prevRegion = sortedRegions[i - 1];
                var region     = sortedRegions[i];

                int gapLength = CalculateGapLength(prevRegion, region);
                if (gapLength == 0)
                {
                    continue;
                }

                var gapRegion = new MutableTranscriptRegion(TranscriptRegionType.Gap, 0, prevRegion.End + 1, region.Start - 1);
                sortedRegions.Insert(i, gapRegion);
                i++;
            }

            return(sortedRegions);
        }