public String viewMultiLine(String pdbId, String chainId) { SequenceCollection coll = SequenceCollectionProvider.get(pdbId); Sequence s = coll.getChainByPDBID(chainId); s.ensureAnnotated(); ViewParameters params = new ViewParameters(); Collection<AnnotationName> annos = params.getAnnotations(); List<AnnotationName> newAnnos = new ArrayList<AnnotationName>(); for (AnnotationName anno : annos) { newAnnos.add(anno); } newAnnos.add(AnnotationRegistry.getAnnotationByName(AnnotationConstants.siteRecord)); params.setAnnotations(newAnnos); PageView pv = new PageView(0, params); // params.setDesiredSequenceRns(ResidueNumberScheme.ATOM); // register the anntation mapper for th emulti line view // Annotation2MultiLineDrawer a2h = new Annotation2MultiLineDrawer(); ChainView view = new ChainView(s, params); pv.addChain(view.getChain()); return pv.getAnnotationJson(); }
/** * provide a default view using BioJava.. could be done using some proper configuration * managment... */ public void initBioJavaView() { // first the Residue Provider ResidueInfoFactory refactory = new BioJavaResidueInfoFactory(); ResidueProvider.setResidueInfoFactory(refactory); // next the SequenceCollection Provider SequenceCollectionFactory sfactory = new BioJavaSequenceCollectionFactory(); SequenceCollectionProvider.setSequenceCollectionFactory(sfactory); BioJavaPubMedFactory pfactory = new BioJavaPubMedFactory(); PubMedProvider.setPubMedFactory(pfactory); }