本文整理汇总了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);
}
示例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());
}
示例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;
}
示例4: EmptyPeptideFormulaIsH2O
public void EmptyPeptideFormulaIsH2O()
{
Peptide pepA = new Peptide();
ChemicalFormula h2O = new ChemicalFormula("H2O");
ChemicalFormula formulaB;
pepA.TryGetChemicalFormula(out formulaB);
Assert.AreEqual(h2O, formulaB);
}
示例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;
}
示例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;
}
示例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";
}
}
示例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);
}
示例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;
}
示例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;
}
}
示例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();
}
示例12: SetUp
public void SetUp()
{
_mockPeptideEveryAminoAcid = new Peptide("ACDEFGHIKLMNPQRSTVWY");
}
示例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);
}
示例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;
}
示例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;
}
}