A class representing the consensus sequence generated from multiple subreads. This is produced by the program pbccs and output to a BAM file.
Inheritance: ISequence, IQualitativeSequence
Example #1
0
        public override void ConsumeCCSRead(PacBioCCSRead read, BWAPairwiseAlignment aln, List<Variant> variants)
        {
            var aligned = aln==null ? "FALSE" : "TRUE";
            var end = String.Join (",", read.MutationsTested.ToString (), read.MutationsApplied.ToString (),
                                    read.ProcessingTimeMS.ToString (), read.Barcode1.ToString(),
                                    read.Barcode2.ToString ());

            string start = String.Join (",", read.Movie, read.HoleNumber.ToString (),
                               read.SnrA.ToString (), read.SnrC.ToString (), read.SnrG.ToString (),
                               read.SnrT.ToString (), aligned, read.ReadQuality.ToString (),
                               read.AvgZscore.ToString (), read.Sequence.Count.ToString (), read.NumPasses.ToString (),
                               read.ReadCountSuccessfullyAdded.ToString(), read.ReadCountBadZscore.ToString(),
                               read.ReadCountAlphaBetaMismatch.ToString(),
                read.ReadCountOther.ToString());
            if (aln == null) {
                start = start + ",NA,NA,NA,NA,NA,NA," + end;
            } else {
                var indels = variants.Count (z => z.Type == VariantType.INDEL);
                var snps = variants.Count (z => z.Type == VariantType.SNP);
                var total = variants.Count;
                var length = aln.AlignedSAMSequence.RefEndPos - aln.AlignedSAMSequence.Pos;
                start = start + "," + String.Join (",", length.ToString (), aln.AlignedSAMSequence.Pos, total.ToString (), indels.ToString (), snps.ToString (),
                    aln.AlignedSAMSequence.RName, end );
            }
            SW.WriteLine (start);
        }
Example #2
0
        public override void ConsumeCCSRead(PacBioCCSRead read, BWAPairwiseAlignment aln, List<Variant> variants)
        {
            if (variants == null) {
                return;
            }
            foreach (var v in variants) {
                incorrectCounts [v.QV]++;
                if (v.Type == VariantType.SNP) {
                    snpErrorCounts [v.QV]++;

                } else {
                    var id = v as IndelVariant;
                    if (id.InsertionOrDeletion == IndelType.Deletion) {
                        deletionErrorCounts [v.QV]++;
                    } else if (id.InsertionOrDeletion == IndelType.Insertion) {
                        insertionErrorCounts [v.QV]++;
                    }
                }
            }
            var refseq = aln.AlignedRefSeq;
            var qseq = aln.AlignedQuerySeq as QualitativeSequence;
            for (int i = 0; i < refseq.Count; i++) {
                if (refseq [i] == qseq [i]) {
                    correctCounts [qseq.GetQualityScore (i)]++;
                }
            }
        }
Example #3
0
 public override void ConsumeCCSRead(PacBioCCSRead read, BWAPairwiseAlignment aln, List<Variant> variants)
 {
     int i = 1;
     foreach (var v in read.ZScores) {
         var s = String.Join (",", read.Movie, read.HoleNumber, i.ToString (), v.ToString ());
         SW.WriteLine (s);
         i++;
     }
 }
Example #4
0
 public override void ConsumeCCSRead(PacBioCCSRead read, BWAPairwiseAlignment aln, List<Variant> variants)
 {
     var prefix = String.Join (",",
                      read.Movie,
                      read.HoleNumber.ToString ());
     SW.WriteLine (prefix + ",A," + read.SnrA);
     SW.WriteLine (prefix + ",C," + read.SnrC);
     SW.WriteLine (prefix + ",G," + read.SnrG);
     SW.WriteLine (prefix + ",T," + read.SnrT);
 }
 public IEnumerable<ISequence> Parse(Stream stream)
 {
     FastQParser fqp = new FastQParser ();
     foreach (var seq in fqp.Parse (stream)) {
         var name = seq.ID;
         var sp = name.Split ('/');
         var movie = sp [0];
         var hole = sp [1];
         SAMAlignedSequence sam = new SAMAlignedSequence ();
         sam.QuerySequence = seq;
         sam.OptionalFields.Add (new SAMOptionalField () { Tag = "sn", Value = "f,0,0,0,0" });
         sam.OptionalFields.Add (new SAMOptionalField () { Tag = "rs", Value = "f,0,0,0,0,0,0" });
         sam.OptionalFields.Add (new SAMOptionalField () { Tag = "zs", Value = "f,0,0,0,0,0,0" });
         PacBioCCSRead read = new PacBioCCSRead (sam) {
             AvgZscore = Single.NaN,
             HoleNumber = Convert.ToInt32 (hole),
             Movie = movie
         };
         yield return read;
     }
 }
Example #6
0
 public override void ConsumeCCSRead(PacBioCCSRead read, BWAPairwiseAlignment aln, List<Variant> variants)
 {
     if (variants == null) {
         return;
     }
     foreach (var v in variants) {
         var common = String.Join (",", read.Movie, read.HoleNumber.ToString (), v.RefName,
                          v.StartPosition.ToString (), v.Length.ToString (), v.Type.ToString (), v.QV.ToString (), v.AtEndOfAlignment.ToString ());
         var snp = v as SNPVariant;
         string unique;
         if (snp != null) {
             unique = String.Join (",", snp.RefBP, snp.AltBP, "NA,NA,NA,NA,NA");
         } else {
             var indel = v as IndelVariant;
             unique = string.Join (",", "NA,NA", indel.InsertionOrDeletion.ToString (),
                 indel.InHomopolymer.ToString (), indel.InsertedOrDeletedBases.ToString (),
                 indel.HomopolymerLengthInReference.ToString (), indel.HomopolymerBase);
         }
         SW.WriteLine (common + "," + unique);
     }
 }
 public abstract void ConsumeCCSRead(PacBioCCSRead read, BWAPairwiseAlignment aln, List<Variant> variants);