Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProteoformGroupFactory"/> class.
 /// </summary>
 /// <param name="elementProvider">The element provider.</param>
 /// <param name="residueProvider">The residue provider.</param>
 public ProteoformGroupFactory(IElementProvider elementProvider, IResidueProvider residueProvider)
 {
     _elementProvider = elementProvider;
     _residueProvider = residueProvider;
     _water           = new ChemicalFormula(new[]
     {
         new EntityCardinality <IElement>(_elementProvider.GetElement(1), 2),
         new EntityCardinality <IElement>(_elementProvider.GetElement(8), 1),
     });
 }
Exemplo n.º 2
0
        public void Setup()
        {
            _elementProvider = new MockElementProvider();
            _residueProvider = new IupacAminoAcidProvider(_elementProvider);
            _factory         = new ProteoformGroupFactory(_elementProvider, _residueProvider);

            var parser        = new ResidXmlParser();
            var modifications = parser.Parse(ResidXmlParserTest.GetResidFilePath()).ToArray();

            _residLookup = ResidModificationLookup.CreateFromModifications(modifications.Where(x => x.Id == "AA0038" || x.Id == "AA0074"),
                                                                           _elementProvider);
        }
Exemplo n.º 3
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);
        }