public void TestParsingManyMods(string modDefsFile) { var methodName = MethodBase.GetCurrentMethod().Name; var modFile = Utils.GetTestFile(methodName, modDefsFile.Replace("TEST_FOLDER", Utils.DEFAULT_TEST_FILE_FOLDER)); if (!modFile.Exists) { Assert.Ignore("Ignoring test TestParsingManyMods since file not found: " + modFile.FullName); } var aaSet = new AminoAcidSet(modFile.FullName); //aaSet.Display(); //SequenceLocation.ProteinNTerm var residue = AminoAcid.ProteinNTerm.Residue; var location = SequenceLocation.ProteinNTerm; var aa = aaSet.GetAminoAcid(residue, location); Console.Write("{0}\t{1}\t{2}", residue, aa.Mass, aa.Composition); foreach (var modIndex in aaSet.GetModificationIndices(residue, location)) { var modification = aaSet.GetModificationParams().GetModification(modIndex); Console.WriteLine(modification.Mass); //Console.Write("\t" + _modificationParams.GetModification(modIndex)); } Console.WriteLine(); residue = AminoAcid.ProteinCTerm.Residue; location = SequenceLocation.ProteinCTerm; aa = aaSet.GetAminoAcid(residue, location); Console.Write("{0}\t{1}\t{2}", residue, aa.Mass, aa.Composition); foreach (var modIndex in aaSet.GetModificationIndices(residue, location)) { var modification = aaSet.GetModificationParams().GetModification(modIndex); Console.WriteLine(modification.Mass); //Console.Write("\t" + _modificationParams.GetModification(modIndex)); } //foreach (var aa in AminoAcid.StandardAminoAcidArr) //{ /* * var keys = _locationSpecificResidueMap[location].Keys.ToArray(); * Array.Sort(keys); * foreach (var residue in keys) * { * var aa = GetAminoAcid(residue, location); * Console.Write("{0}\t{1}\t{2}", residue, aa.Mass, aa.Composition); * foreach (var modIndex in GetModificationIndices(residue, location)) * { * Console.Write("\t" + _modificationParams.GetModification(modIndex)); * } * Console.WriteLine(); * }*/ //} }
public void TestParsingManyMods() { const string modFilePath = @"\\protoapps\UserData\Jungkap\Lewy\db\Mods.txt"; var aaSet = new AminoAcidSet(modFilePath); //aaSet.Display(); //SequenceLocation.ProteinNTerm var residue = AminoAcid.ProteinNTerm.Residue; var location = SequenceLocation.ProteinNTerm; var aa = aaSet.GetAminoAcid(residue, location); Console.Write("{0}\t{1}\t{2}", residue, aa.Mass, aa.Composition); foreach (var modIndex in aaSet.GetModificationIndices(residue, location)) { var modification = aaSet.GetModificationParams().GetModification(modIndex); Console.WriteLine(modification.Mass); //Console.Write("\t" + _modificationParams.GetModification(modIndex)); } Console.WriteLine(); residue = AminoAcid.ProteinCTerm.Residue; location = SequenceLocation.ProteinCTerm; aa = aaSet.GetAminoAcid(residue, location); Console.Write("{0}\t{1}\t{2}", residue, aa.Mass, aa.Composition); foreach (var modIndex in aaSet.GetModificationIndices(residue, location)) { var modification = aaSet.GetModificationParams().GetModification(modIndex); Console.WriteLine(modification.Mass); //Console.Write("\t" + _modificationParams.GetModification(modIndex)); } //foreach (var aa in AminoAcid.StandardAminoAcidArr) /* * var keys = _locationSpecificResidueMap[location].Keys.ToArray(); * Array.Sort(keys); * foreach (var residue in keys) * { * var aa = GetAminoAcid(residue, location); * Console.Write("{0}\t{1}\t{2}", residue, aa.Mass, aa.Composition); * foreach (var modIndex in GetModificationIndices(residue, location)) * { * Console.Write("\t" + _modificationParams.GetModification(modIndex)); * } * Console.WriteLine(); * } * } */ }
public static AminoAcid[] GetExtendedAminoAcidArray(AminoAcidSet aaSet) { var ret = new List <AminoAcid>(); var modParam = aaSet.GetModificationParams(); var aminoAcidArray = AminoAcid.StandardAminoAcidArr; foreach (var aa in aminoAcidArray) { ret.Add(aa); foreach (var modIndex in aaSet.GetModificationIndices(aa.Residue, SequenceLocation.Everywhere)) { var aa2 = new ModifiedAminoAcid(aa, modParam.GetModification(modIndex)); ret.Add(aa2); } } return(ret.ToArray()); }
public static Modification[] GetTerminalModifications(AminoAcidSet aminoAcidSet) { var terminalModifications = new HashSet <Modification>(); var terminalLocations = new[] { SequenceLocation.ProteinNTerm, SequenceLocation.ProteinCTerm }; var terminalResidues = new[] { AminoAcid.ProteinNTerm.Residue, AminoAcid.ProteinCTerm.Residue }; var modParam = aminoAcidSet.GetModificationParams(); for (var i = 0; i < terminalLocations.Length; i++) { var location = terminalLocations[i]; var residue = terminalResidues[i]; foreach (var modIndex in aminoAcidSet.GetModificationIndices(residue, location)) { var modification = modParam.GetModification(modIndex); terminalModifications.Add(modification); } } return(terminalModifications.ToArray()); }