Esempio n. 1
0
        //public static string GetZezValue(this SAMAlignedSequence sam)
        //{
        //  return GetOptionValue(sam, "ZE", "Z");
        //}

        public static void WriteFastq(this SAMAlignedSequence sam, StreamWriter sw, bool posAsPaired = false)
        {
            if (posAsPaired)
            {
                sw.WriteLine(string.Format("@{0} {1}", sam.QName, sam.Pos));
            }
            else
            {
                sw.WriteLine("@" + sam.QName);
            }
            sw.WriteLine(sam.GetQuerySequenceString());
            sw.WriteLine("+");
            sw.WriteLine(sam.GetQualityScoresString());
        }
Esempio n. 2
0
    public string SAMToString(SAMAlignedSequence sam)
    {
      if (sam == null)
      {
        return null;
      }

      return string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}",
        sam.QName,
        (int)sam.Flag,
        sam.RName,
        sam.Pos,
        sam.MapQ,
        sam.CIGAR,
        sam.MRNM,
        sam.MPos,
        sam.ISize,
        sam.GetQuerySequenceString(),
        sam.GetQualityScoresString(),
        (from of in sam.OptionalFields
         select string.Format("{0}:{1}:{2}", of.Tag, of.VType, of.Value)).Merge("\t"));
    }
Esempio n. 3
0
 public static void WriteFasta(this SAMAlignedSequence sam, StreamWriter sw)
 {
     sw.WriteLine(">" + sam.QName);
     sw.WriteLine(sam.GetQuerySequenceString());
 }