/** * Creates a new AtomPositionMap containing representative atoms * from a structure. * @param s */ public AtomPositionMap(Structure s) { this(StructureTools.getRepresentativeAtomArray(s)); }
public Atom[] getRepresentativeAtoms(StructureIdentifier name) throws IOException, StructureException { Atom[] atoms = null; Structure s = getStructure(name); atoms = StructureTools.getRepresentativeAtomArray(s); /* * synchronized (cache){ cache.put(name, atoms); } */ return atoms; }
/** Suggest domains for a protein structure * * @param s the protein structure * @return a list of possible domains * @throws StructureException */ public static List<Domain> suggestDomains(Structure s) throws StructureException{ Atom[] ca = StructureTools.getRepresentativeAtomArray(s); return suggestDomains(ca); }
/** * Gets a representative atom for each group that is part of the chain * backbone. Note that modified aminoacids won't be returned as part of the * backbone if the {@link org.biojava.nbio.structure.io.mmcif.ReducedChemCompProvider} was used to load the * structure. * * For amino acids, the representative is a CA carbon. For nucleotides, the * representative is the {@value #NUCLEOTIDE_REPRESENTATIVE}. Other group * types will be ignored. * * @param s * Input structure * @return representative Atoms of the structure backbone * @since Biojava 4.1.0 */ public static Atom[] getRepresentativeAtomArray(Structure s) { List<Atom> atoms = new ArrayList<Atom>(); for (Chain c : s.getChains()) { Atom[] chainAtoms = getRepresentativeAtomArray(c); for (Atom a : chainAtoms) { atoms.add(a); } } return atoms.toArray(new Atom[atoms.size()]); }
/** * Returns the representative Atom Array of the first model, if the * structure is NMR, or the Array for each model, if it is a biological * assembly with multiple models. * * @param structure * @return representative Atom[] */ public static Atom[] getRepresentativeAtoms(Structure structure) { if (structure.isNmr()) return StructureTools.getRepresentativeAtomArray(structure); else { // Get Atoms of all models List<Atom> atomList = new ArrayList<Atom>(); for (int m = 0; m < structure.nrModels(); m++) { for (Chain c : structure.getModel(m)) atomList.addAll(Arrays.asList(StructureTools .getRepresentativeAtomArray(c))); } return atomList.toArray(new Atom[0]); } }
ca1 = StructureTools.getRepresentativeAtomArray(structure1); ca2 = StructureTools.getRepresentativeAtomArray(structure2);
/** * Returns the set of intra-chain contacts for the given chain for C-alpha * or C3' atoms (including non-standard aminoacids appearing as HETATM * groups), i.e. the contact map. Uses a geometric hashing algorithm that * speeds up the calculation without need of full distance matrix. * * @param chain * @param cutoff * @return * @since Biojava 4.1.0 */ public static AtomContactSet getRepresentativeAtomsInContact(Chain chain, double cutoff) { Grid grid = new Grid(cutoff); Atom[] atoms = getRepresentativeAtomArray(chain); grid.addAtoms(atoms); return grid.getAtomContacts(); }
/** * Returns an AFPChain corresponding to the alignment between {@code structure1} and {@code structure2}, which is given by the gapped protein sequences {@code sequence1} and {@code sequence2}. The * sequences need not correspond to the entire structures, since local alignment is performed to match the sequences to structures. Assumes that a residue is aligned if and only if it is given by * an uppercase letter. * @param sequence1 <em>Must</em> have {@link ProteinSequence#getUserCollection()} set to document upper- and lower-case as aligned and unaligned; see {@link #getAlignedUserCollection(String)} * @throws StructureException */ public static AFPChain fastaToAfpChain(ProteinSequence sequence1, ProteinSequence sequence2, Structure structure1, Structure structure2) throws StructureException { if (structure1 == null || structure2 == null) { throw new IllegalArgumentException("A structure is null"); } if (sequence1 == null || sequence2 == null) { throw new IllegalArgumentException("A sequence is null"); } Atom[] ca1 = StructureTools.getRepresentativeAtomArray(structure1); Atom[] ca2 = StructureTools.getRepresentativeAtomArray(structure2); ResidueNumber[] residues1 = StructureSequenceMatcher.matchSequenceToStructure(sequence1, structure1); ResidueNumber[] residues2 = StructureSequenceMatcher.matchSequenceToStructure(sequence2, structure2); // nullify ResidueNumbers that have a lowercase sequence character if (sequence1.getUserCollection() != null) { CasePreservingProteinSequenceCreator.setLowercaseToNull(sequence1, residues1); } if (sequence2.getUserCollection() != null) { CasePreservingProteinSequenceCreator.setLowercaseToNull(sequence2, residues2); } return buildAlignment(ca1, ca2, residues1, residues2); }
Atom[] ca = StructureTools.getRepresentativeAtomArray(c); logger.debug("Chain " + c.getId() + "; CA Atoms: " + ca.length + "; SEQRES: " + c.getSeqResSequence()); if (ca.length==0)
@Override public void run() { MultipleStructureAligner algorithm = parent.getMultipleStructureAligner(); try { List<Atom[]> atomArrays = new ArrayList<Atom[]>(); for (Structure s:structures){ Atom[] ca = StructureTools.getRepresentativeAtomArray(s); atomArrays.add(ca); } MultipleAlignment msa = algorithm.align(atomArrays); msa.getEnsemble().setStructureIdentifiers(names); MultipleAlignmentJmolDisplay.display(msa); } catch (StructureException e) { e.printStackTrace(); logger.warn(e.getMessage()); } parent.notifyCalcFinished(); }
private void showAlignment( String name1, String name2){ if ( algorithm == null) { initAlgorithm(null); } try { Structure structure1 = null; if ( name1.equals("CUSTOM")) { // user uploaded a custom PDB file... structure1 = loadCustomStructure(userPath,userChain); } else { structure1 = cache.getStructure(name1); } Structure structure2 = cache.getStructure(name2); Atom[] ca1; Atom[] ca2; ca1 = StructureTools.getRepresentativeAtomArray(structure1); ca2 = StructureTools.getRepresentativeAtomArray(structure2); AFPChain afpChain; afpChain = algorithm.align(ca1, ca2); afpChain.setName1(name1); afpChain.setName2(name2); StructureAlignmentJmol jmol = StructureAlignmentDisplay.display(afpChain,ca1,ca2); //String result = afpChain.toFatcat(ca1, ca2); //String rot = afpChain.toRotMat(); DisplayAFP.showAlignmentPanel(afpChain, ca1,ca2,jmol); } catch (Exception e){ e.printStackTrace(); } }
Atom[] ca = StructureTools.getRepresentativeAtomArray(structure); List<Domain> domains = LocalProteinDomainParser.suggestDomains(ca); int i = -1;
atomArrays.add(StructureTools.getRepresentativeAtomArray(s));
@Override public void run() { // both structure have been downloaded, now calculate the alignment ... StructureAlignment algorithm = parent.getStructureAlignment(); //StructurePairAligner aligner = new StructurePairAligner(); //aligner.setDebug(true); try { Atom[] ca1 = StructureTools.getRepresentativeAtomArray(structure1); Atom[] ca2 = StructureTools.getRepresentativeAtomArray(structure2); //System.out.println("ca1 size:" + ca1.length + " ca2 size: " + ca2.length); AFPChain afpChain = algorithm.align(ca1, ca2); afpChain.setName1(name1); afpChain.setName2(name2); StructureAlignmentJmol jmol = StructureAlignmentDisplay.display(afpChain, ca1, ca2); String title = jmol.getTitle(); ConfigStrucAligParams params = algorithm.getParameters(); if ( params != null) title += " " + algorithm.getParameters().toString(); jmol.setTitle(title); DisplayAFP.showAlignmentPanel(afpChain,ca1,ca2,jmol); System.out.println(afpChain.toCE(ca1,ca2)); } catch (StructureException e){ e.printStackTrace(); logger.warn(e.getMessage()); } //logger.info("done!"); parent.notifyCalcFinished(); }
Atom[] ca1 = StructureTools.getRepresentativeAtomArray(structure); Atom[] ca2 = StructureTools.getRepresentativeAtomArray(structure); // can't use cloneCAArray because it doesn't set parent group.chain.structure
Atom[] rotCA = StructureTools.getRepresentativeAtomArray(displayS); List<Group> hetatms = StructureTools.getUnalignedGroups(rotCA); int index = rotCA.length;
Atom[] ca2; ca1 = StructureTools.getRepresentativeAtomArray(structure1); ca2 = StructureTools.getRepresentativeAtomArray(structure2);
Atom[] ca1 = StructureTools.getRepresentativeAtomArray(structure1);
ca1 = StructureTools.getRepresentativeAtomArray(structure1); } else ca1 = StructureTools.cloneAtomArray(ca1); if (ca2 == null) { structure2 = cache.getStructure(pair.getName2()); ca2 = StructureTools.getRepresentativeAtomArray(structure2); } else ca2 = StructureTools.cloneAtomArray(ca2);