Ejemplo n.º 1
0
 public void Test()
 {
   PseudoSequenceBuilder builder = new PseudoSequenceBuilder("KR", false);
   Sequence seq = new Sequence("TEST", "EISQVFEIALKRNLPVNFEVARESGPPHMKNFVTKVSVGEFVGEGEGKSK");
   builder.Build(seq);
   Assert.AreEqual("EISQVFEIALRKNLPVNFEVAERSGPPHMNKFVTVKSVGEFVGEGEGSKK", seq.SeqString);
 }
Ejemplo n.º 2
0
    public void TestAddDigestFeatures()
    {
      Sequence seq = new Sequence("Test", "AAANESAARBBBNPSBBKFFFNITFFRGGGNDTGGR");

      Digest digest = new Digest();
      digest.DigestProtease = ProteaseManager.CreateProtease("Trypsin_TestAddDigestFeatures", true, "RK", "P");
      digest.ProteinSequence = seq;

      digest.MaxMissedCleavages = 0;
      digest.AddDigestFeatures();
      List<DigestPeptideInfo> peptides = (List<DigestPeptideInfo>)seq.Annotation[Digest.PEPTIDE_FEATURE_TYPE];
      Assert.AreEqual(4, peptides.Count);

      digest.MaxMissedCleavages = 1;
      digest.AddDigestFeatures();
      List<DigestPeptideInfo> missedPeptides = (List<DigestPeptideInfo>)seq.Annotation[Digest.PEPTIDE_FEATURE_TYPE];
      Assert.AreEqual(7, missedPeptides.Count);

      IRangeLocationFilter nglycanFilter = new NGlycanFilter();
      digest.MaxMissedCleavages = 0;
      digest.Filter = nglycanFilter;
      digest.AddDigestFeatures();
      List<DigestPeptideInfo> nglycanPeptides = (List<DigestPeptideInfo>)seq.Annotation[Digest.PEPTIDE_FEATURE_TYPE];
      Assert.AreEqual(2, nglycanPeptides.Count);
      Assert.AreEqual("AAANESAAR", nglycanPeptides[0].PeptideSeq);
      Assert.AreEqual("FFFNITFFR", nglycanPeptides[1].PeptideSeq);
    }
Ejemplo n.º 3
0
 public void TestConstruction()
 {
   Sequence seq = new Sequence("test description of test", "ABCDE");
   Assert.AreEqual("test", seq.Name);
   Assert.AreEqual("test description of test", seq.Reference);
   Assert.AreEqual("description of test", seq.Description);
   Assert.AreEqual("ABCDE", seq.SeqString);
 }
    public void TestGetReversedSequence()
    {
      var options = new ReversedDatabaseBuilderOptions()
      {
        DecoyKey = "REVERSED",
      };
      var builder = new ReversedDatabaseBuilder(options);

      var seq = new Sequence("sp|Q12345 sp protein", "ABCDE");

      options.DecoyType = DecoyType.Start;
      Assert.AreEqual("REVERSED_sp|Q12345", builder.GetReversedSequence(1, seq).Name);

      options.DecoyType = DecoyType.Middle;
      Assert.AreEqual("sp|REVERSED_Q12345", builder.GetReversedSequence(1, seq).Name);

    }
Ejemplo n.º 5
0
 public void WriteSequence(StreamWriter writer, Sequence seq)
 {
 }
Ejemplo n.º 6
0
    public void FillSequence(Sequence seq)
    {
      //matched exon fill sequence
      exons.ForEach(m => m.FillSequence(seq, this.Strand));

      //fill direct sequence
      this.DirectExpectSequence = seq.SeqString.Substring((int)this.ExpectStart, (int)(this.ExpectEnd - this.ExpectStart + 1)).ToUpper();
      if (this.Strand == '-')
      {
        this.DirectExpectSequence = SequenceUtils.GetReverseComplementedSequence(this.DirectExpectSequence);
      }
    }
Ejemplo n.º 7
0
 public void Build(Sequence seq)
 {
   seq.SeqString = findReg.Replace(seq.SeqString, "$2$1");
 }
Ejemplo n.º 8
0
 public void WriteSequence(StreamWriter writer, Sequence seq)
 {
   WriteSequence(writer, seq.Reference, seq.SeqString);
 }