Exemple #1
0
 /// <summary>
 /// constructor
 /// </summary>
 public Translation(CdnaCoordinateMap codingRegion, CompactId proteinId, byte proteinVersion, string peptideSeq)
 {
     CodingRegion   = codingRegion;
     ProteinId      = proteinId;
     ProteinVersion = proteinVersion;
     PeptideSeq     = peptideSeq;
 }
Exemple #2
0
        /// <summary>
        /// reads the translation from the binary writer
        /// </summary>
        public static Translation Read(ExtendedBinaryReader reader, string[] peptideSeqs)
        {
            var codingRegion   = CdnaCoordinateMap.Read(reader);
            var proteinId      = CompactId.Read(reader);
            var proteinVersion = reader.ReadByte();
            var peptideIndex   = reader.ReadOptInt32();

            return(new Translation(codingRegion, proteinId, proteinVersion, peptideSeqs[peptideIndex]));
        }
Exemple #3
0
        private static CdnaCoordinateMap[] ReadCdnaMaps(ExtendedBinaryReader reader)
        {
            int numItems = reader.ReadOptInt32();
            var items    = new CdnaCoordinateMap[numItems];

            for (int i = 0; i < numItems; i++)
            {
                items[i] = CdnaCoordinateMap.Read(reader);
            }
            return(items);
        }
        private static string ConvertGenomicPosToCodingPos(int breakendPosition, CdnaCoordinateMap cdnaCoordinateMap,
                                                           bool onReverseStrand, int compDnaCodingStart, int compDnaCodingEnd)
        {
            int cDnaPos;

            if (onReverseStrand)
            {
                cDnaPos = cdnaCoordinateMap.CdnaStart - breakendPosition + cdnaCoordinateMap.GenomicEnd;
            }
            else
            {
                cDnaPos = cdnaCoordinateMap.CdnaEnd + breakendPosition - cdnaCoordinateMap.GenomicEnd;
            }
            if (cDnaPos > compDnaCodingEnd)
            {
                return("*" + (cDnaPos - compDnaCodingEnd));
            }
            if (cDnaPos < compDnaCodingStart)
            {
                return((cDnaPos - compDnaCodingStart).ToString());
            }

            return((cDnaPos - compDnaCodingStart + 1).ToString());
        }