/// <summary> /// Create a modification with the specified values /// </summary> /// <param name="unimodCv">CV term for the modification, if available; otherwise, use CVID.MS_unknown_modification</param> /// <param name="modificationName"> /// Name of the modification, if a CV term for the modification is not available or unknown. /// If this matches an Unimod modification name, the Unimod CV term will be used. /// </param> /// <param name="location"> /// location of the modification, using '0' for N-term and length+1 for C-term, and otherwise /// 1-based indexing /// </param> /// <param name="monoMassDelta">monoisotopic mass delta</param> /// <returns></returns> public ModificationObj(CV.CV.CVID unimodCv, string modificationName = "", int location = int.MinValue, double monoMassDelta = double.NaN) : this() { if (!monoMassDelta.Equals(double.NaN)) { MonoisotopicMassDelta = monoMassDelta; } if (location != int.MinValue) { Location = location; } if ((unimodCv != CV.CV.CVID.CVID_Unknown) && (unimodCv != CV.CV.CVID.MS_unknown_modification)) { CVParams.Add(new CVParamObj(unimodCv)); } else if (!string.IsNullOrWhiteSpace(modificationName)) { var result = SearchForUnimodMod(modificationName); if (result != CV.CV.CVID.MS_unknown_modification) { CVParams.Add(new CVParamObj(result)); } else { CVParams.Add(new CVParamObj(CV.CV.CVID.MS_unknown_modification, modificationName)); } } }
/// <summary> /// Object hash code /// </summary> public override int GetHashCode() { unchecked { var hashCode = Name?.GetHashCode() ?? 0; return((hashCode * 397) ^ (CVParams?.GetHashCode() ?? 0)); } }
/// <summary> /// Object hash code /// </summary> public override int GetHashCode() { unchecked { var hashCode = Code?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ (CVParams?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (UserParams?.GetHashCode() ?? 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = CVParams != null?CVParams.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Creates a DB sequence object with the specified values /// </summary> /// <param name="searchDb">Valid <see cref="SearchDatabaseInfo" /> object, not null</param> /// <param name="length">length of the protein</param> /// <param name="accession">protein identifier</param> /// <param name="description">description of the protein</param> public DbSequenceObj(SearchDatabaseInfo searchDb, int length, string accession, string description = "") : this() { Length = length; SearchDatabase = searchDb; Accession = accession; if (!string.IsNullOrWhiteSpace(description)) { CVParams.Add(new CVParamObj(CV.CV.CVID.MS_protein_description, description)); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = AvgMassDelta.GetHashCode(); hashCode = (hashCode * 397) ^ MonoisotopicMassDelta.GetHashCode(); hashCode = (hashCode * 397) ^ Location; hashCode = (hashCode * 397) ^ (Residues != null ? Residues.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = FixedMod.GetHashCode(); hashCode = (hashCode * 397) ^ MassDelta.GetHashCode(); hashCode = (hashCode * 397) ^ (Residues != null ? Residues.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SpecificityRules != null ? SpecificityRules.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (ProteinDetectionHypotheses != null ? ProteinDetectionHypotheses.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (Parent != null ? Parent.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (ProteinAmbiguityGroups != null ? ProteinAmbiguityGroups.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PassThreshold.GetHashCode(); hashCode = (hashCode * 397) ^ (DBSequence != null ? DBSequence.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PeptideHypotheses != null ? PeptideHypotheses.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (ContactRoles != null ? ContactRoles.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SubSamples != null ? SubSamples.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (ExternalFormatDocumentation != null ? ExternalFormatDocumentation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FileFormat != null ? FileFormat.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (Residues != null ? Residues.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AmbiguousResidues != null ? AmbiguousResidues.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (MsLevels != null ? MsLevels.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (PeptideSequence != null ? PeptideSequence.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Modifications != null ? Modifications.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SubstitutionModifications != null ? SubstitutionModifications.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ NumSequencesSearched.GetHashCode(); hashCode = (hashCode * 397) ^ (FragmentationTables != null ? FragmentationTables.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SpectrumIdentificationResults != null ? SpectrumIdentificationResults.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (SpectrumID != null ? SpectrumID.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SpectrumIdentificationItems != null ? SpectrumIdentificationItems.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SpectraData != null ? SpectraData.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (Accession != null ? Accession.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Length; hashCode = (hashCode * 397) ^ (Seq != null ? Seq.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SearchDatabase != null ? SearchDatabase.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (MidInitials != null ? MidInitials.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Affiliations != null ? Affiliations.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (Version != null ? Version.GetHashCode() : 0); hashCode = (hashCode * 397) ^ NumDatabaseSequences.GetHashCode(); hashCode = (hashCode * 397) ^ NumResidues.GetHashCode(); hashCode = (hashCode * 397) ^ (ExternalFormatDocumentation != null ? ExternalFormatDocumentation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DatabaseName != null ? DatabaseName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FileFormat != null ? FileFormat.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ IsDecoy.GetHashCode(); hashCode = (hashCode * 397) ^ Start; hashCode = (hashCode * 397) ^ End; hashCode = (hashCode * 397) ^ Pre.GetHashCode(); hashCode = (hashCode * 397) ^ Post.GetHashCode(); hashCode = (hashCode * 397) ^ Frame; hashCode = (hashCode * 397) ^ (TranslationTable != null ? TranslationTable.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Peptide != null ? Peptide.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DBSequence != null ? DBSequence.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ ChargeState; hashCode = (hashCode * 397) ^ ExperimentalMassToCharge.GetHashCode(); hashCode = (hashCode * 397) ^ CalculatedMassToCharge.GetHashCode(); hashCode = (hashCode * 397) ^ CalculatedPI.GetHashCode(); hashCode = (hashCode * 397) ^ Rank; hashCode = (hashCode * 397) ^ PassThreshold.GetHashCode(); hashCode = (hashCode * 397) ^ (Peptide != null ? Peptide.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (MassTable != null ? MassTable.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Sample != null ? Sample.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PeptideEvidences != null ? PeptideEvidences.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Fragmentations != null ? Fragmentations.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Get the SpecEValue of this identification /// </summary> /// <returns></returns> public double GetSpecEValue() { return(CVParams.GetCvParam(CV.CV.CVID.MS_MS_GF_SpecEValue, "1").ValueAs <double>()); }