public void AddDbEntryProperty(string dbReferenceType, string dbReferenceId, string protertyType, string protertyValue) { DbReferenceType type = DbReferenceType.GetDbReferenceType(dbReferenceType); if (type == null) { return; } dbEntries[type][dbReferenceId].AddProperty(protertyType, protertyValue); }
private UniprotEntry CopyEntry() { UniprotEntry newEntry = new UniprotEntry(); DbReferenceType[] dbRefTypes = new DbReferenceType[dbEntries.Keys.Count]; dbEntries.Keys.CopyTo(dbRefTypes, 0); foreach (DbReferenceType refType in dbRefTypes) { string[] dbRefIDs = Get(refType); foreach (string id in dbRefIDs) { newEntry.AddDbEntry(refType.UniprotName, id); foreach (KeyValuePair <string, List <string> > property in dbEntries[refType][id].properties) { foreach (string propertyValue in property.Value) { newEntry.AddDbEntryProperty(refType.UniprotName, id, property.Key, propertyValue); } } } } if (features != null) { foreach (FeatureType type in GetAllFeatureTypes()) { newEntry.AddFeatures(type, GetFeatures(type)); } } foreach (string kword in Keywords) { newEntry.AddKeyword(kword); } newEntry.ProteinFullNames = ProteinFullNames; newEntry.ProteinShortNames = ProteinShortNames; newEntry.ProteinEcNumbers = ProteinEcNumbers; newEntry.Accessions = Accessions; newEntry.GeneNamesAndTypes = GeneNamesAndTypes; newEntry.OrganismNames = OrganismNames; newEntry.UniprotNames = UniprotNames; newEntry.Sequence = Sequence; foreach (string taxId in taxonomyIds) { newEntry.AddTaxonomyId(taxId); } foreach (string hostTaxId in hostTaxonomyIds) { newEntry.AddHostTaxonomyId(hostTaxId); } return(newEntry); }
public string[] GetNames(DbReferenceType key) { if (!dbEntries.ContainsKey(key)) { return(new string[0]); } UniprotDbReference[] x = dbEntries[key].Values.ToArray(); string[] result = new string[x.Length]; for (int i = 0; i < x.Length; i++) { result[i] = x[i].GetPropertyValues("entry name")[0]; } return(result); }
public List <UniprotEntry> ResolveIsoforms(Dictionary <string, List <string> > isoformToEnsembl) { DbReferenceType dbRefType = DbReferenceType.ensembl; List <UniprotEntry> isoforms = new List <UniprotEntry>(); foreach (KeyValuePair <string, List <string> > isofToEnsembl in isoformToEnsembl) { UniprotEntry modEntry = CopyEntry(); modEntry.dbEntries.Remove(dbRefType); Dictionary <string, UniprotDbReference> enstToData = new Dictionary <string, UniprotDbReference>(); foreach (string enst in isofToEnsembl.Value) { enstToData.Add(enst, dbEntries[dbRefType][enst]); } modEntry.dbEntries.Add(dbRefType, enstToData); isoforms.Add(modEntry); } return(isoforms); }
public void AddDbEntry(string dbReferenceType, string dbReferenceId) { if (dbEntries == null) { dbEntries = new Dictionary <DbReferenceType, Dictionary <string, UniprotDbReference> >(); } DbReferenceType type = DbReferenceType.GetDbReferenceType(dbReferenceType); if (type == null) { return; } if (!dbEntries.ContainsKey(type)) { dbEntries.Add(type, new Dictionary <string, UniprotDbReference>()); } if (!dbEntries[type].ContainsKey(dbReferenceId)) { dbEntries[type].Add(dbReferenceId, new UniprotDbReference()); } }
private static DbReferenceType[] CreateDbReferenceTypeList() { List <DbReferenceType> ft = new List <DbReferenceType> { go, kegg, pfam, pdb, wormBase, reactome, mgi, sgd, mim, prosite, interPro, prints, smart, flyBase, wormPep, ncbiTaxonomy, doi, pubMed, embl, refSeq, geneId, protClustDb, medLine, proteinModelPortal, smr, gene3D, panther, pirsf, supfam, uniGene, dip, intAct, pride, ensemblPlants, gramene, eggNog, oma, phylomeDb, string1, ctd, xenbase, hogenom, hovergen, orthoDb, ipi, geneTree, patric, arrayExpress, brenda, ec, germOnline, ensemblMetazoa, bioCyc, genomeReviews, pir, ensembl, bgee, ko, inParanoid, nextBio, hamap, tigrfams, ensemblBacteria, dmdm, geneCards, hgnc, nextProt, cleanEx, genevestigator, mint, uniProt, peptideAtlas, ensemblFungi, cygd, tair, ucsc, proMex, proDom, pdbSum, phosphoSite, hssp, tigr, ensemblProtists, dictyBase, hinvDb, pharmGkb, rgd, zfin, merops, cazy, dnasu, hpa, pseudoCap, tcdb, vectorBase, drugBank, swiss2Dpage, dosacCobs2Dpage, ucd2Dpage, legioList, orphanet, genoList, pomBase, phosSite, echoBase, ecoGene, world2Dpage, cornea2Dpage, tubercuList, reproduction2Dpage, agricola, agd, leproma, allergome, geneFarm, peroxiBase, eco2Dbase, cgd, glycoSuiteDb, siena2Dpage, pmapCutDb, bindingDb, pathwayInteractionDb, twoDBaseEcoli, ogp, maizeGdb, conoServer, disProt, aarhusGhent2Dpage, euPathDb, phci2Dpage, compluyeast2Dpage, reBase, arachnoServer, euHcvDb, pmma2Dpage, pptaseDb, ratHeart2Dpage, anu2Dpage, ruleBase, saas, pirsr, pirnr, genpept, evolutionaryTrace, uniPathway, genomeRnai, paxDb, signaLink, hamapRule, chiTars, chEmbl, sabioRk, mycoClap, geneWiki, uniCarbKb, bioGrid, treeFam, pro, guideToPharmacology, uniProtKb, ccds, maxqb, prositeProrule, geneReviews, proteomes, expressionAtlas, bioMuta, chEbi, depod, moonProt, SwissPalm, iPTMnet, PhosphoSitePlus, TopDownProteomics, Genevisible, CORUM, ELM, EPD, DisGeNET, MalaCards, OpenTargets, SIGNOR, Araport, CDD, SFLD, ESTHER, SwissLipids, GeneDB, CollecTF, WBParaSite, IMGTGENEDB, SAM, ProteomicsDB, VGNC, CarbonylDB, GlyConnect, ComplexPortal, MoonDB, Rhea, jPOST, UniLectin }; allDbReferenceTypeStrings = new string[ft.Count]; for (int i = 0; i < allDbReferenceTypeStrings.Length; i++) { allDbReferenceTypeStrings[i] = ft[i].UniprotName; } int[] o = ArrayUtils.Order(allDbReferenceTypeStrings); allDbReferenceTypeStrings = ArrayUtils.SubArray(allDbReferenceTypeStrings, o); DbReferenceType[] result = new DbReferenceType[ft.Count]; for (int i = 0; i < result.Length; i++) { result[i] = ft[o[i]]; result[i].Index = i; } return(result); }
public UniprotDbReference[] GetDbEntries(DbReferenceType key) { return(!dbEntries.ContainsKey(key) ? new UniprotDbReference[0] : dbEntries[key].Values.ToArray()); }
public string[] Get(DbReferenceType key) { return(!dbEntries.ContainsKey(key) ? new string[0] : dbEntries[key].Keys.ToArray()); }