Пример #1
0
        private void SetupUnimod()
        {
            var atomProvider = new UnimodHardCodedAtomProvider(_elementProvider);

            var parser = new UnimodOboParser();

            UnimodModification[] modifications = parser.Parse(UnimodTest.GetUnimodFilePath()).ToArray();

            _unimod37 = modifications.Single(x => x.Id == "UNIMOD:37");
            //_unimodLookup = UnimodModificationLookup.CreateFromModifications(new[] { _unimod37 },
            //    atomProvider);
            _unimodLookup = UnimodModificationLookup.CreateFromModifications(modifications, atomProvider);
        }
Пример #2
0
        public void Setup()
        {
            var unimodOboParser = new UnimodOboParser();

            UnimodModification[] modifications = unimodOboParser.Parse(UnimodTest.GetUnimodFilePath()).ToArray();

            NistElementParser nistParser = new NistElementParser();

            IElement[] elements = nistParser.ParseFile(Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "elements.dat")).ToArray();
            _elementProvider = new InMemoryElementProvider(elements);

            _residueProvider = new IupacAminoAcidProvider(_elementProvider);
            var atomProvider = new UnimodHardCodedAtomProvider(_elementProvider);

            _lookup = new CompositeModificationLookup(new IProteoformModificationLookup[]
            {
                UnimodModificationLookup.CreateFromModifications(modifications, atomProvider),
                new FormulaLookup(_elementProvider),
                new MassLookup(),
                new BrnoModificationLookup(_elementProvider),
                new IgnoreKeyModificationLookup(ProFormaKey.Info),
            });

            ProFormaParser         proFormaParser         = new ProFormaParser();
            ProteoformGroupFactory proteoformGroupFactory = new ProteoformGroupFactory(_elementProvider, _residueProvider);

            var mapper = new RelayAccessionMapper(d =>
            {
                if (d == "B:ac")
                {
                    return(Tuple.Create(ProFormaEvidenceType.PsiMod, "MOD:00394")); // acetylated residue
                }
                return(Tuple.Create(ProFormaEvidenceType.None, d));
            });

            var parser  = new UniProtPtmListParser();
            var entries = parser.Parse(File.ReadAllText(UniProtTests.GetPtmListPath())).ToList();

            _chemicalProteoformHashGenerator = new ChemicalProteoformHashGenerator(proFormaParser, proteoformGroupFactory, _lookup, mapper);
        }