• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Peptide类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Search

 public abstract PeptideSpectralMatch Search(IMassSpectrum massSpectrum, Peptide peptide, FragmentTypes fragmentTypes, Tolerance productMassTolerance);
开发者ID:dbaileychess,项目名称:CSMSL,代码行数:1,代码来源:MSSearchEngine.cs


示例17: GetMoleculeTransition

        private TransitionDocNode GetMoleculeTransition(SrmDocument document, DataGridViewRow row, Peptide pep, TransitionGroup group, bool requireProductInfo)
        {
            var massType =
                document.Settings.TransitionSettings.Prediction.FragmentMassType;

            var molecule = ReadPrecursorOrProductColumns(document, row, !requireProductInfo); // Re-read the product columns, or copy precursor
            if (requireProductInfo && molecule == null)
            {
                return null;
            }
            var ion = molecule.ToCustomIon();
            var ionType = (!requireProductInfo || // We inspected the input list and found only precursor info
                          ((ion.MonoisotopicMass.Equals(pep.CustomIon.MonoisotopicMass) &&
                           ion.AverageMass.Equals(pep.CustomIon.AverageMass)))) // Same mass, must be a precursor transition
                ? IonType.precursor
                : IonType.custom;
            double mass = ion.GetMass(massType);

            var transition = new Transition(group, molecule.Charge, null, ion, ionType);
            var annotations = document.Annotations;
            if (!string.IsNullOrEmpty(molecule.Note))
            {
                var note = document.Annotations.Note;
                note = string.IsNullOrEmpty(note) ? molecule.Note : (note + "\r\n" + molecule.Note); // Not L10N
                annotations = new Annotations(note, document.Annotations.ListAnnotations(), 0);
            }
            return new TransitionDocNode(transition, annotations, null, mass, null, null, null);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:28,代码来源:PasteDlg.cs


示例18: LoadProteinData

 private void LoadProteinData(Peptide peptide)
 {
     MatchedProteins.Clear();
     peptide.ProteinList.ForEach(x => MatchedProteins.Add(new ProteinViewModel(x)));
 }
开发者ID:msdna,项目名称:MultiAlign,代码行数:5,代码来源:PeptideViewModel.cs


示例19: GetMoleculeTransitionGroup

        private TransitionGroupDocNode GetMoleculeTransitionGroup(SrmDocument document, DataGridViewRow row, Peptide pep, bool requireProductInfo)
        {
            var moleculeInfo = ReadPrecursorOrProductColumns(document, row, true); // Re-read the precursor columns
            if (!document.Settings.TransitionSettings.IsMeasurablePrecursor(moleculeInfo.Mz))
            {
                ShowTransitionError(new PasteError
                {
                    Column = INDEX_MOLECULE_MZ,
                    Line = row.Index,
                    Message = string.Format(Resources.PasteDlg_GetMoleculeTransitionGroup_The_precursor_m_z__0__is_not_measureable_with_your_current_instrument_settings_, moleculeInfo.Mz)
                });
                return null;
            }

            var customIon = moleculeInfo.ToCustomIon();
            var isotopeLabelType = moleculeInfo.IsotopeLabelType ?? IsotopeLabelType.light;
            var group = new TransitionGroup(pep, customIon, moleculeInfo.Charge, isotopeLabelType);
            try
            {
                var tran = GetMoleculeTransition(document, row, pep, group, requireProductInfo);
                if (tran == null)
                    return null;
                return new TransitionGroupDocNode(group, document.Annotations, document.Settings, null,
                    null, moleculeInfo.ExplicitTransitionGroupValues, null, new[] {tran}, true);
            }
            catch (InvalidDataException e)
            {
                ShowTransitionError(new PasteError
                {
                    Column = INDEX_PRODUCT_MZ, // Don't actually know that mz was the issue, but at least it's the right row, and in the product columns
                    Line = row.Index,
                    Message = e.Message
                });
                return null;
            }
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:36,代码来源:PasteDlg.cs


示例20: IonCalculator

        //###################################################################
        /// <summary>
        /// The class constructor
        /// </summary>
        /// <param name="config">The configuration object</param>
        public IonCalculator(Hashtable config)
        {
            this.neutralgain = new List<string>();
            this.neutralloss = new List<string>();

            this.weighttype = config.ContainsKey("weighttype") ? config["weighttype"].ToString() : this.weighttype;
            this.customtemplate = config.ContainsKey("customtemplate") ? config["customtemplate"].ToString() : this.customtemplate;

            if (config.ContainsKey("peptide") && config["peptide"] is Peptide) {
                this.peptide = (Peptide)config["peptide"];
            }
            if (config.ContainsKey("maxcharge") && config["maxcharge"] is int) {
                this.maxcharge = (int)config["maxcharge"];
            }
            if (config.ContainsKey("neutralloss") && config["neutralloss"] is List<string>) {
                this.neutralloss = (List<string>)config["neutralloss"];
            }
            if (config.ContainsKey("neutralgain") && config["neutralgain"] is List<string>) {
                this.neutralgain = (List<string>)config["neutralgain"];
            }
            if (config.ContainsKey("customonly") && config["customonly"] is bool) {
                this.customonly = (bool)config["customonly"];
            }

            this._tempArray1 = new List<Ms2Ion>();
            this._tempArray2 = new ArrayList();
        }
开发者ID:robschmidt,项目名称:XProt,代码行数:32,代码来源:IonCalculator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PerfTracker类代码示例发布时间:2022-05-24
下一篇:
C# People类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap