当前位置: 首页>>代码示例>>C#>>正文


C# Peptide类代码示例

本文整理汇总了C#中Peptide的典型用法代码示例。如果您正苦于以下问题:C# Peptide类的具体用法?C# Peptide怎么用?C# Peptide使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Peptide类属于命名空间,在下文中一共展示了Peptide类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PeptideTreeViewModel

        public PeptideTreeViewModel(Peptide peptide, TreeItemViewModel parent)
        {
            m_parent = parent;
            m_peptide = peptide;

            var information = SingletonDataProviders.GetDatasetInformation(m_peptide.GroupId);

            if (information != null)
            {
                Name = information.DatasetName;
            }
            else
            {
                Name = string.Format("Dataset {0}", m_peptide.GroupId);
            }

            AddStatistic("Id", m_peptide.Id);
            AddStatistic("Dataset Id", m_peptide.GroupId);

            AddStatistic("Precursor m/z", m_peptide.Spectrum.PrecursorMz);
            if (m_peptide.Spectrum.ParentFeature != null)
            {
                AddStatistic("Charge", m_peptide.Spectrum.ParentFeature.ChargeState);
            }
            else
            {
                AddStatistic("Charge", m_peptide.Spectrum.PrecursorChargeState);
            }

            AddString("Sequence", peptide.Sequence);
            AddStatistic("Score", peptide.Score);
            AddStatistic("Scan", peptide.Scan);
        }
开发者ID:msdna,项目名称:MultiAlign,代码行数:33,代码来源:PeptideTreeViewModel.cs

示例2: ClearModificationsBySites

        public void ClearModificationsBySites()
        {
            var peptide = new Peptide("AC[Fe]DEFGHIKLMNP[Fe]QRSTV[Fe]WY");

            peptide.ClearModifications(ModificationSites.C | ModificationSites.V);

            Assert.AreEqual("ACDEFGHIKLMNP[Fe]QRSTVWY", peptide.ToString());
        }
开发者ID:dbaileychess,项目名称:CSMSL,代码行数:8,代码来源:PeptideTestFixture.cs

示例3: DatabaseSearchSequence

 public DatabaseSearchSequence(Peptide peptide, int featureId)
 {
     Sequence = peptide.Sequence;
     Scan = peptide.Scan;
     Score = peptide.Score;
     GroupId = peptide.GroupId;
     UmcFeatureId = featureId;
     Id = peptide.Id;
 }
开发者ID:msdna,项目名称:MultiAlign,代码行数:9,代码来源:DatabaseSearchSequence.cs

示例4: EmptyPeptideFormulaIsH2O

        public void EmptyPeptideFormulaIsH2O()
        {
            Peptide pepA = new Peptide();
            ChemicalFormula h2O = new ChemicalFormula("H2O");
            ChemicalFormula formulaB;
            pepA.TryGetChemicalFormula(out formulaB);

            Assert.AreEqual(h2O, formulaB);
        }
开发者ID:kmmbvnr,项目名称:CSMSL,代码行数:9,代码来源:PeptideTestFixture.cs

示例5: FindPatterns

        public static IEnumerable<Dna> FindPatterns(Dna input, Peptide peptide)
        {
            var dnaComp = input.Complimentary();

             var forward = match(input, peptide);

             var backWard = match(dnaComp, peptide);

             var resultMatches = forward.Concat(backWard.Select(d=>d.Complimentary()));

             return resultMatches;
        }
开发者ID:eiva,项目名称:Algorithms,代码行数:12,代码来源:PeptidPatterns.cs

示例6: Search

        public override PeptideSpectralMatch Search(IMassSpectrum massSpectrum, Peptide peptide, FragmentTypes fragmentTypes, Tolerance productMassTolerance)
        {
            double[] eMasses = massSpectrum.MassSpectrum.GetMasses();
            double[] eIntenisties = massSpectrum.MassSpectrum.GetIntensities();
            double tic = massSpectrum.MassSpectrum.GetTotalIonCurrent();

            PeptideSpectralMatch psm = new PeptideSpectralMatch(DefaultPsmScoreType) {Peptide = peptide};
            double[] tMasses = peptide.Fragment(fragmentTypes).Select(frag => Mass.MzFromMass(frag.MonoisotopicMass, 1)).OrderBy(val => val).ToArray();
            double score = Search(eMasses, eIntenisties, tMasses, productMassTolerance, tic);
            psm.Score = score;

            return psm;
        }
开发者ID:dbaileychess,项目名称:CSMSL,代码行数:13,代码来源:MorpheusSearchEngine.cs

示例7: DisplayPeptide

 private void DisplayPeptide(string sequence)
 {
     try
     {
         Peptide peptide = new Peptide(sequence);
         peptideMassTB.Text = peptide.MonoisotopicMass.ToString();
         peptideMZTB.Text = peptide.ToMz(1).ToString();
     }
     catch (Exception)
     {
         peptideMZTB.Text = peptideMassTB.Text = "Not a valid Sequence";
     }
 }
开发者ID:dbaileychess,项目名称:CSMSL,代码行数:13,代码来源:PeptideCalculatorForm.cs

示例8: PeptideViewModel

        public PeptideViewModel(Peptide peptide)
        {
            m_peptide = peptide;

            var info = SingletonDataProviders.GetDatasetInformation(peptide.GroupId);
            if (info != null)
            {
                m_dataset = new DatasetInformationViewModel(info);
            }

            MatchedProteins = new ObservableCollection<ProteinViewModel>();
            LoadProteinData(peptide);
        }
开发者ID:msdna,项目名称:MultiAlign,代码行数:13,代码来源:PeptideViewModel.cs

示例9: match

 private static IEnumerable<Dna> match(Dna input, Peptide peptide)
 {
     var resultMatches = new List<Dna>();
      var rna1 = input.Translate();
      for (uint offset = 0; offset < 3; offset++)
      {
     var pep = rna1.Transcribe(offset, true);
     var matches = DnaPattern.FindAllMatches(pep, peptide);
     foreach (uint match in matches)
     {
        var of = match * 3 + offset;
        var transDna = input.Substring(of, 3 * peptide.Length);
        resultMatches.Add(transDna);
     }
      }
      return resultMatches;
 }
开发者ID:eiva,项目名称:Algorithms,代码行数:17,代码来源:PeptidPatterns.cs

示例10: ReadNextPsm

        public override IEnumerable<PeptideSpectralMatch> ReadNextPsm()
        {
            Protein prot;
            MSDataFile dataFile;
            foreach (OmssaPeptideSpectralMatch omssaPSM in _reader.GetRecords<OmssaPeptideSpectralMatch>())
            {
                Peptide peptide = new Peptide(omssaPSM.Sequence.ToUpper());
                SetFixedMods(peptide);
                SetDynamicMods(peptide, omssaPSM.Modifications);
                peptide.StartResidue = omssaPSM.StartResidue;
                peptide.EndResidue = omssaPSM.StopResidue;
                if (_proteins.TryGetValue(omssaPSM.Defline, out prot))
                {
                    peptide.Parent = prot;
                }

                PeptideSpectralMatch psm = new PeptideSpectralMatch();
                if (_extraColumns.Count > 0)
                {
                    foreach(string name in _extraColumns) {
                        psm.AddExtraData(name, _reader.GetField<string>(name));
                    }
                }
                psm.Peptide = peptide;
                psm.Score = omssaPSM.EValue;
                psm.Charge = omssaPSM.Charge;
                psm.ScoreType = PeptideSpectralMatchScoreType.EValue;
                psm.IsDecoy = omssaPSM.Defline.StartsWith("DECOY");
                psm.SpectrumNumber = omssaPSM.SpectrumNumber;
                psm.FileName = omssaPSM.FileName;

                string[] filenameparts = psm.FileName.Split('.');
                if (_dataFiles.TryGetValue(filenameparts[0], out dataFile))
                {
                    if (!dataFile.IsOpen)
                        dataFile.Open();
                    psm.Spectrum = dataFile[psm.SpectrumNumber] as MsnDataScan;
                }

                yield return psm;
            }
        }
开发者ID:B-Rich,项目名称:CSMSL,代码行数:42,代码来源:OmssaCsvPsmReader.cs

示例11: WriteTransition

        protected override void WriteTransition(TextWriter writer,
            XmlFastaSequence sequence,
            XmlPeptide peptide,
            XmlTransition transition)
        {
            char separator = TextUtil.GetCsvSeparator(_cultureInfo);
            writer.Write(transition.PrecursorMz.ToString(_cultureInfo));
            writer.Write(separator);
            writer.Write(transition.ProductMz.ToString(_cultureInfo));
            writer.Write(separator);
            if (MethodType == ExportMethodType.Standard)
                writer.Write(Math.Round(DwellTime, 2).ToString(_cultureInfo));
            else
            {
                if (!peptide.PredictedRetentionTime.HasValue)
                    throw new InvalidOperationException(Resources.XmlThermoMassListExporter_WriteTransition_Attempt_to_write_scheduling_parameters_failed);
                writer.Write(peptide.PredictedRetentionTime.Value.ToString(_cultureInfo));
            }
            writer.Write(separator);

            // Write special ID for ABI software
            var fastaSequence = new FastaSequence(sequence.Name, sequence.Description, null, peptide.Sequence);
            var newPeptide = new Peptide(fastaSequence, peptide.Sequence, 0, peptide.Sequence.Length, peptide.MissedCleavages);
            var nodePep = new PeptideDocNode(newPeptide);
            string modifiedPepSequence = AbiMassListExporter.GetSequenceWithModsString(nodePep, _document.Settings); // Not L10N;

            string extPeptideId = string.Format("{0}.{1}.{2}.{3}", // Not L10N
                                                sequence.Name,
                                                modifiedPepSequence,
                                                GetTransitionName(transition),
                                                "light"); // Not L10N : file format

            writer.WriteDsvField(extPeptideId, separator);
            writer.Write(separator);
            writer.Write(Math.Round(transition.DeclusteringPotential ?? 0, 1).ToString(_cultureInfo));

            writer.Write(separator);
            writer.Write(Math.Round(transition.CollisionEnergy, 1).ToString(_cultureInfo));

            writer.WriteLine();
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:41,代码来源:XmlExport.cs

示例12: SetUp

 public void SetUp()
 {
     _mockPeptideEveryAminoAcid = new Peptide("ACDEFGHIKLMNPQRSTVWY");
 }
开发者ID:dbaileychess,项目名称:CSMSL,代码行数:4,代码来源:FragmentTestFixture.cs

示例13: Accept

 /// <summary>
 /// This version of Accept is used to select transition groups after the peptide
 /// itself has already been screened.  For this reason, it only applies library
 /// filtering.
 /// </summary>
 public bool Accept(SrmSettings settings, Peptide peptide, ExplicitMods mods, int charge)
 {
     bool allowVariableMods;
     return Accept(settings, peptide, mods, new[] { charge }, PeptideFilterType.library, out allowVariableMods);
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:10,代码来源:SrmSettings.cs

示例14: LibrariesContainMeasurablePeptide

 private bool LibrariesContainMeasurablePeptide(Peptide peptide, IsotopeLabelType labelType,
     IEnumerable<int> precursorCharges, ExplicitMods mods)
 {
     string sequenceMod = GetModifiedSequence(peptide.Sequence, labelType, mods);
     foreach (int charge in precursorCharges)
     {
         if (LibrariesContain(sequenceMod, charge))
         {
             // Make sure the peptide for the found spectrum is measurable on
             // the current instrument.
             double precursorMass = GetPrecursorMass(labelType, peptide.Sequence, mods);
             if (IsMeasurable(precursorMass, charge))
                 return true;
         }
     }
     return false;
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:17,代码来源:SrmSettings.cs

示例15: GetMoleculePeptide

 private PeptideDocNode GetMoleculePeptide(SrmDocument document, DataGridViewRow row, PeptideGroup group, bool requireProductInfo)
 {
     DocNodeCustomIon ion;
     MoleculeInfo moleculeInfo;
     try
     {
         moleculeInfo = ReadPrecursorOrProductColumns(document, row, true); // Re-read the precursor columns
         if (moleculeInfo == null)
             return null; // Some failure, but exception was already handled
         ion = new DocNodeCustomIon(moleculeInfo.Formula, moleculeInfo.MonoMass, moleculeInfo.AverageMass,
             Convert.ToString(row.Cells[INDEX_MOLECULE_NAME].Value)); // Short name
     }
     catch (ArgumentException e)
     {
         ShowTransitionError(new PasteError
         {
             Column    = INDEX_MOLECULE_FORMULA,
             Line = row.Index,
             Message = e.Message
         });
         return null;
     }
     try
     {
         var pep = new Peptide(ion);
         var tranGroup = GetMoleculeTransitionGroup(document, row, pep, requireProductInfo);
         if (tranGroup == null)
             return null;
         return new PeptideDocNode(pep, document.Settings, null, null, moleculeInfo.ExplicitRetentionTime, new[] { tranGroup }, true);
     }
     catch (InvalidOperationException e)
     {
         ShowTransitionError(new PasteError
         {
             Column = INDEX_MOLECULE_FORMULA,
             Line = row.Index,
             Message = e.Message
         });
         return null;
     }
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:41,代码来源:PasteDlg.cs


注:本文中的Peptide类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。