id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
32,100
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodFactory.java
EcodFactory.releaseReferences
private static void releaseReferences() { synchronized(versionedEcodDBs) { Iterator<Entry<String, SoftReference<EcodDatabase>>> it = versionedEcodDBs.entrySet().iterator(); while(it.hasNext()) { Entry<String, SoftReference<EcodDatabase>> entry = it.next(); SoftReference<EcodDatabase> ref = entry.getValu...
java
private static void releaseReferences() { synchronized(versionedEcodDBs) { Iterator<Entry<String, SoftReference<EcodDatabase>>> it = versionedEcodDBs.entrySet().iterator(); while(it.hasNext()) { Entry<String, SoftReference<EcodDatabase>> entry = it.next(); SoftReference<EcodDatabase> ref = entry.getValu...
[ "private", "static", "void", "releaseReferences", "(", ")", "{", "synchronized", "(", "versionedEcodDBs", ")", "{", "Iterator", "<", "Entry", "<", "String", ",", "SoftReference", "<", "EcodDatabase", ">", ">", ">", "it", "=", "versionedEcodDBs", ".", "entrySet...
removes SoftReferences which have already been garbage collected
[ "removes", "SoftReferences", "which", "have", "already", "been", "garbage", "collected" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodFactory.java#L103-L115
32,101
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/CasePreservingProteinSequenceCreator.java
CasePreservingProteinSequenceCreator.getSequence
@Override public AbstractSequence<AminoAcidCompound> getSequence( List<AminoAcidCompound> list) { AbstractSequence<AminoAcidCompound> seq =super.getSequence(list); Collection<Object> strCase = new ArrayList<Object>(seq.getLength()); for(int i=0;i<seq.getLength();i++) { strCase.add(true); } seq.setUserC...
java
@Override public AbstractSequence<AminoAcidCompound> getSequence( List<AminoAcidCompound> list) { AbstractSequence<AminoAcidCompound> seq =super.getSequence(list); Collection<Object> strCase = new ArrayList<Object>(seq.getLength()); for(int i=0;i<seq.getLength();i++) { strCase.add(true); } seq.setUserC...
[ "@", "Override", "public", "AbstractSequence", "<", "AminoAcidCompound", ">", "getSequence", "(", "List", "<", "AminoAcidCompound", ">", "list", ")", "{", "AbstractSequence", "<", "AminoAcidCompound", ">", "seq", "=", "super", ".", "getSequence", "(", "list", ")...
Assumes all compounds were uppercase @see org.biojava.nbio.core.sequence.io.ProteinSequenceCreator#getSequence(java.util.List)
[ "Assumes", "all", "compounds", "were", "uppercase" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/CasePreservingProteinSequenceCreator.java#L91-L101
32,102
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/CasePreservingProteinSequenceCreator.java
CasePreservingProteinSequenceCreator.getStringCase
private static List<Object> getStringCase(String str) { List<Object> types = new ArrayList<Object>(str.length()); for(int i=0;i<str.length();i++) { types.add(Character.isUpperCase(str.charAt(i))); } return types; }
java
private static List<Object> getStringCase(String str) { List<Object> types = new ArrayList<Object>(str.length()); for(int i=0;i<str.length();i++) { types.add(Character.isUpperCase(str.charAt(i))); } return types; }
[ "private", "static", "List", "<", "Object", ">", "getStringCase", "(", "String", "str", ")", "{", "List", "<", "Object", ">", "types", "=", "new", "ArrayList", "<", "Object", ">", "(", "str", ".", "length", "(", ")", ")", ";", "for", "(", "int", "i...
Returns a list of Booleans of the same length as the input, specifying whether each character was uppercase or not. @param str A string. Should not contain unicode supplemental characters. @return a list of Booleans of the same length as the input, specifying whether each character was uppercase or not. This list conta...
[ "Returns", "a", "list", "of", "Booleans", "of", "the", "same", "length", "as", "the", "input", "specifying", "whether", "each", "character", "was", "uppercase", "or", "not", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/CasePreservingProteinSequenceCreator.java#L111-L117
32,103
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/rcsb/GetRepresentatives.java
GetRepresentatives.getAll
public static SortedSet<String> getAll() { SortedSet<String> representatives = new TreeSet<String>(); try { URL u = new URL(allUrl); InputStream stream = URLConnectionTools.getInputStream(u, 60000); if (stream != null) { BufferedReader reader = new BufferedReader( new InputStreamReader(stream...
java
public static SortedSet<String> getAll() { SortedSet<String> representatives = new TreeSet<String>(); try { URL u = new URL(allUrl); InputStream stream = URLConnectionTools.getInputStream(u, 60000); if (stream != null) { BufferedReader reader = new BufferedReader( new InputStreamReader(stream...
[ "public", "static", "SortedSet", "<", "String", ">", "getAll", "(", ")", "{", "SortedSet", "<", "String", ">", "representatives", "=", "new", "TreeSet", "<", "String", ">", "(", ")", ";", "try", "{", "URL", "u", "=", "new", "URL", "(", "allUrl", ")",...
Returns the current list of all PDB IDs. @return PdbChainKey set of all PDB IDs.
[ "Returns", "the", "current", "list", "of", "all", "PDB", "IDs", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/rcsb/GetRepresentatives.java#L97-L125
32,104
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/Component.java
Component.lazyInit
private static void lazyInit() { if (components==null) { components = new HashSet<Component>(); nonTerminalComps = new HashMap<Set<String>, Component>(); nTerminalAminoAcids = new HashMap<Set<String>, Component>(); cTerminalAminoAcids = new HashMap<Set<String>, Component>(); } }
java
private static void lazyInit() { if (components==null) { components = new HashSet<Component>(); nonTerminalComps = new HashMap<Set<String>, Component>(); nTerminalAminoAcids = new HashMap<Set<String>, Component>(); cTerminalAminoAcids = new HashMap<Set<String>, Component>(); } }
[ "private", "static", "void", "lazyInit", "(", ")", "{", "if", "(", "components", "==", "null", ")", "{", "components", "=", "new", "HashSet", "<", "Component", ">", "(", ")", ";", "nonTerminalComps", "=", "new", "HashMap", "<", "Set", "<", "String", ">...
Lazy initialization of the static variables.
[ "Lazy", "initialization", "of", "the", "static", "variables", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/Component.java#L51-L58
32,105
biojava/biojava
biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/xml/ElementTable.java
ElementTable.populateMaps
public void populateMaps(){ this.elementName2Element = new HashMap<String, Element>(); this.isotopeName2Isotope = new HashMap<String, Isotope>(); if(this.element != null){ for(Element e:this.element){ this.elementName2Element.put(e.getName(), e); if(e.getIsotopes() != null){ for(Isotope i:e.getIso...
java
public void populateMaps(){ this.elementName2Element = new HashMap<String, Element>(); this.isotopeName2Isotope = new HashMap<String, Isotope>(); if(this.element != null){ for(Element e:this.element){ this.elementName2Element.put(e.getName(), e); if(e.getIsotopes() != null){ for(Isotope i:e.getIso...
[ "public", "void", "populateMaps", "(", ")", "{", "this", ".", "elementName2Element", "=", "new", "HashMap", "<", "String", ",", "Element", ">", "(", ")", ";", "this", ".", "isotopeName2Isotope", "=", "new", "HashMap", "<", "String", ",", "Isotope", ">", ...
Populate the Maps for quick retrieval
[ "Populate", "the", "Maps", "for", "quick", "retrieval" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/xml/ElementTable.java#L60-L73
32,106
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java
BoundingBox.getDimensions
public double[] getDimensions(){ double[] dim = new double[3]; dim[0] = xmax-xmin; dim[1] = ymax-ymin; dim[2] = zmax-zmin; return dim; }
java
public double[] getDimensions(){ double[] dim = new double[3]; dim[0] = xmax-xmin; dim[1] = ymax-ymin; dim[2] = zmax-zmin; return dim; }
[ "public", "double", "[", "]", "getDimensions", "(", ")", "{", "double", "[", "]", "dim", "=", "new", "double", "[", "3", "]", ";", "dim", "[", "0", "]", "=", "xmax", "-", "xmin", ";", "dim", "[", "1", "]", "=", "ymax", "-", "ymin", ";", "dim"...
Returns the dimensions of this bounding box. @return a double array (x,y,z) with the dimensions of the box.
[ "Returns", "the", "dimensions", "of", "this", "bounding", "box", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java#L104-L114
32,107
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java
BoundingBox.overlaps
public boolean overlaps(BoundingBox o, double cutoff) { if (this==o) return true; // x dimension if (!areOverlapping(xmin,xmax,o.xmin,o.xmax,cutoff)) { return false; } // y dimension if (!areOverlapping(ymin,ymax,o.ymin,o.ymax,cutoff)) { return false; } // z dimension if (!areOverlapping(zmin,zm...
java
public boolean overlaps(BoundingBox o, double cutoff) { if (this==o) return true; // x dimension if (!areOverlapping(xmin,xmax,o.xmin,o.xmax,cutoff)) { return false; } // y dimension if (!areOverlapping(ymin,ymax,o.ymin,o.ymax,cutoff)) { return false; } // z dimension if (!areOverlapping(zmin,zm...
[ "public", "boolean", "overlaps", "(", "BoundingBox", "o", ",", "double", "cutoff", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "// x dimension", "if", "(", "!", "areOverlapping", "(", "xmin", ",", "xmax", ",", "o", ".", "xmin", ...
Returns true if this bounding box overlaps given one, i.e. they are within one cutoff distance in one of their 3 dimensions. @param cutoff @return
[ "Returns", "true", "if", "this", "bounding", "box", "overlaps", "given", "one", "i", ".", "e", ".", "they", "are", "within", "one", "cutoff", "distance", "in", "one", "of", "their", "3", "dimensions", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java#L165-L180
32,108
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java
BoundingBox.contains
public boolean contains(Point3d atom) { double x = atom.x; double y = atom.y; double z = atom.z; return xmin <= x && x <= xmax && ymin <= y && y <= ymax && zmin <= z && z <= zmax; }
java
public boolean contains(Point3d atom) { double x = atom.x; double y = atom.y; double z = atom.z; return xmin <= x && x <= xmax && ymin <= y && y <= ymax && zmin <= z && z <= zmax; }
[ "public", "boolean", "contains", "(", "Point3d", "atom", ")", "{", "double", "x", "=", "atom", ".", "x", ";", "double", "y", "=", "atom", ".", "y", ";", "double", "z", "=", "atom", ".", "z", ";", "return", "xmin", "<=", "x", "&&", "x", "<=", "x...
Check if a given point falls within this box @param atom @return
[ "Check", "if", "a", "given", "point", "falls", "within", "this", "box" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java#L208-L215
32,109
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java
BoundingBox.getMinMax
public double[] getMinMax(double[] array) { double[] minmax = new double[2]; double max = Double.MIN_VALUE; double min = Double.MAX_VALUE; for(double value : array) { if(value > max) max = value; if(value < min) min = value; } minmax[0] = min; minmax[1] = max; return minmax; }
java
public double[] getMinMax(double[] array) { double[] minmax = new double[2]; double max = Double.MIN_VALUE; double min = Double.MAX_VALUE; for(double value : array) { if(value > max) max = value; if(value < min) min = value; } minmax[0] = min; minmax[1] = max; return minmax; }
[ "public", "double", "[", "]", "getMinMax", "(", "double", "[", "]", "array", ")", "{", "double", "[", "]", "minmax", "=", "new", "double", "[", "2", "]", ";", "double", "max", "=", "Double", ".", "MIN_VALUE", ";", "double", "min", "=", "Double", "....
Returns an array of size 2 with min and max values of given double array @param array @return
[ "Returns", "an", "array", "of", "size", "2", "with", "min", "and", "max", "values", "of", "given", "double", "array" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/BoundingBox.java#L231-L245
32,110
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/LogColorMapper.java
LogColorMapper.transform
@Override public double transform(double value) { double logValue = Math.log(value>0?value:0)/Math.log(base); return logValue; }
java
@Override public double transform(double value) { double logValue = Math.log(value>0?value:0)/Math.log(base); return logValue; }
[ "@", "Override", "public", "double", "transform", "(", "double", "value", ")", "{", "double", "logValue", "=", "Math", ".", "log", "(", "value", ">", "0", "?", "value", ":", "0", ")", "/", "Math", ".", "log", "(", "base", ")", ";", "return", "logVa...
Apply log transform. @param value @return log_b(value) @see org.biojava.nbio.structure.gui.util.color.ContinuousColorMapperTransform#transform(double)
[ "Apply", "log", "transform", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/LogColorMapper.java#L65-L69
32,111
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java
ProteinModificationRegistry.registerCommonProteinModifications
private static void registerCommonProteinModifications(InputStream inStream) { try { ProteinModificationXmlReader.registerProteinModificationFromXml(inStream); } catch (Exception e) { logger.error("Exception: ", e); } }
java
private static void registerCommonProteinModifications(InputStream inStream) { try { ProteinModificationXmlReader.registerProteinModificationFromXml(inStream); } catch (Exception e) { logger.error("Exception: ", e); } }
[ "private", "static", "void", "registerCommonProteinModifications", "(", "InputStream", "inStream", ")", "{", "try", "{", "ProteinModificationXmlReader", ".", "registerProteinModificationFromXml", "(", "inStream", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{"...
register common protein modifications from XML file.
[ "register", "common", "protein", "modifications", "from", "XML", "file", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java#L65-L72
32,112
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java
ProteinModificationRegistry.lazyInit
private static synchronized void lazyInit(InputStream inStream) { if (registry==null) { registry = new HashSet<ProteinModification>(); byId = new HashMap<String, ProteinModification>(); byResidId = new HashMap<String, Set<ProteinModification>>(); byPsimodId = new HashMap<String, Set<ProteinModification>...
java
private static synchronized void lazyInit(InputStream inStream) { if (registry==null) { registry = new HashSet<ProteinModification>(); byId = new HashMap<String, ProteinModification>(); byResidId = new HashMap<String, Set<ProteinModification>>(); byPsimodId = new HashMap<String, Set<ProteinModification>...
[ "private", "static", "synchronized", "void", "lazyInit", "(", "InputStream", "inStream", ")", "{", "if", "(", "registry", "==", "null", ")", "{", "registry", "=", "new", "HashSet", "<", "ProteinModification", ">", "(", ")", ";", "byId", "=", "new", "HashMa...
Lazy Initialization the static variables and register common modifications.
[ "Lazy", "Initialization", "the", "static", "variables", "and", "register", "common", "modifications", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java#L109-L131
32,113
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java
ProteinModificationRegistry.register
public static void register(final ProteinModification modification) { if (modification==null) throw new IllegalArgumentException("modification == null!"); lazyInit(); String id = modification.getId(); if (byId.containsKey(id)) { throw new IllegalArgumentException(id+" has already been registered."); } ...
java
public static void register(final ProteinModification modification) { if (modification==null) throw new IllegalArgumentException("modification == null!"); lazyInit(); String id = modification.getId(); if (byId.containsKey(id)) { throw new IllegalArgumentException(id+" has already been registered."); } ...
[ "public", "static", "void", "register", "(", "final", "ProteinModification", "modification", ")", "{", "if", "(", "modification", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"modification == null!\"", ")", ";", "lazyInit", "(", ")", ";", ...
Register a new ProteinModification.
[ "Register", "a", "new", "ProteinModification", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java#L136-L205
32,114
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java
ProteinModificationRegistry.unregister
public static void unregister(ProteinModification modification) { if (modification==null) throw new IllegalArgumentException("modification == null!"); registry.remove(modification); byId.remove(modification.getId()); Set<ProteinModification> mods; mods = byResidId.get(modification.getResidId()); if (mod...
java
public static void unregister(ProteinModification modification) { if (modification==null) throw new IllegalArgumentException("modification == null!"); registry.remove(modification); byId.remove(modification.getId()); Set<ProteinModification> mods; mods = byResidId.get(modification.getResidId()); if (mod...
[ "public", "static", "void", "unregister", "(", "ProteinModification", "modification", ")", "{", "if", "(", "modification", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"modification == null!\"", ")", ";", "registry", ".", "remove", "(", "m...
Remove a modification from registry. @param mod
[ "Remove", "a", "modification", "from", "registry", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java#L211-L243
32,115
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java
ProteinModificationRegistry.getByComponent
public static Set<ProteinModification> getByComponent(final Component comp1, final Component... comps) { lazyInit(); Set<ProteinModification> mods = byComponent.get(comp1); if (mods==null) { return Collections.emptySet(); } if (comps.length==0) { return Collections.unmodifiableSet(mods); } else { ...
java
public static Set<ProteinModification> getByComponent(final Component comp1, final Component... comps) { lazyInit(); Set<ProteinModification> mods = byComponent.get(comp1); if (mods==null) { return Collections.emptySet(); } if (comps.length==0) { return Collections.unmodifiableSet(mods); } else { ...
[ "public", "static", "Set", "<", "ProteinModification", ">", "getByComponent", "(", "final", "Component", "comp1", ",", "final", "Component", "...", "comps", ")", "{", "lazyInit", "(", ")", ";", "Set", "<", "ProteinModification", ">", "mods", "=", "byComponent"...
Get ProteinModifications that involves one or more components. @param comp1 a {@link Component}. @param comps other {@link Component}s. @return a set of ProteinModifications that involves all the components.
[ "Get", "ProteinModifications", "that", "involves", "one", "or", "more", "components", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/ProteinModificationRegistry.java#L300-L323
32,116
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java
Astral.getRepresentatives
public static Set<String> getRepresentatives(AstralSet cutoff) { if (instances.containsKey(cutoff.getId()) && instances.get(cutoff.getId()).get() != null) { return instances.get(cutoff.getId()).get().getNames(); } Astral astral = new Astral(cutoff); instances.put(cutoff.getId(), new SoftReference<Astral>(ast...
java
public static Set<String> getRepresentatives(AstralSet cutoff) { if (instances.containsKey(cutoff.getId()) && instances.get(cutoff.getId()).get() != null) { return instances.get(cutoff.getId()).get().getNames(); } Astral astral = new Astral(cutoff); instances.put(cutoff.getId(), new SoftReference<Astral>(ast...
[ "public", "static", "Set", "<", "String", ">", "getRepresentatives", "(", "AstralSet", "cutoff", ")", "{", "if", "(", "instances", ".", "containsKey", "(", "cutoff", ".", "getId", "(", ")", ")", "&&", "instances", ".", "get", "(", "cutoff", ".", "getId",...
Get a list of representatives' names for the specified ASTRAL cutoff.
[ "Get", "a", "list", "of", "representatives", "names", "for", "the", "specified", "ASTRAL", "cutoff", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java#L114-L121
32,117
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java
Astral.init
private void init(Reader reader) { names = new TreeSet<String>(); failedLines = new LinkedHashMap<Integer,String>(); BufferedReader br = null; try { br = new BufferedReader(reader); logger.info("Reading ASTRAL file..."); String line = ""; int i = 0; while ((line = br.readLine()) != null) { ...
java
private void init(Reader reader) { names = new TreeSet<String>(); failedLines = new LinkedHashMap<Integer,String>(); BufferedReader br = null; try { br = new BufferedReader(reader); logger.info("Reading ASTRAL file..."); String line = ""; int i = 0; while ((line = br.readLine()) != null) { ...
[ "private", "void", "init", "(", "Reader", "reader", ")", "{", "names", "=", "new", "TreeSet", "<", "String", ">", "(", ")", ";", "failedLines", "=", "new", "LinkedHashMap", "<", "Integer", ",", "String", ">", "(", ")", ";", "BufferedReader", "br", "=",...
Parses the FASTA file opened by reader.
[ "Parses", "the", "FASTA", "file", "opened", "by", "reader", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java#L205-L249
32,118
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java
Grid.getAtomContacts
public AtomContactSet getAtomContacts() { AtomContactSet contacts = new AtomContactSet(cutoff); List<Contact> list = getIndicesContacts(); if (jAtomObjects == null) { for (Contact cont : list) { contacts.add(new AtomContact(new Pair<Atom>(iAtomObjects[cont.getI()],iAtomObjects[cont.getJ()]),cont.getDist...
java
public AtomContactSet getAtomContacts() { AtomContactSet contacts = new AtomContactSet(cutoff); List<Contact> list = getIndicesContacts(); if (jAtomObjects == null) { for (Contact cont : list) { contacts.add(new AtomContact(new Pair<Atom>(iAtomObjects[cont.getI()],iAtomObjects[cont.getJ()]),cont.getDist...
[ "public", "AtomContactSet", "getAtomContacts", "(", ")", "{", "AtomContactSet", "contacts", "=", "new", "AtomContactSet", "(", "cutoff", ")", ";", "List", "<", "Contact", ">", "list", "=", "getIndicesContacts", "(", ")", ";", "if", "(", "jAtomObjects", "==", ...
Returns all contacts, i.e. all atoms that are within the cutoff distance. If both iAtoms and jAtoms are defined then contacts are between iAtoms and jAtoms, if jAtoms is null, then contacts are within the iAtoms. @return
[ "Returns", "all", "contacts", "i", ".", "e", ".", "all", "atoms", "that", "are", "within", "the", "cutoff", "distance", ".", "If", "both", "iAtoms", "and", "jAtoms", "are", "defined", "then", "contacts", "are", "between", "iAtoms", "and", "jAtoms", "if", ...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java#L381-L399
32,119
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java
Grid.getIndicesContacts
public List<Contact> getIndicesContacts() { List<Contact> list = new ArrayList<>(); // if the 2 sets of atoms are not overlapping they are too far away and no need to calculate anything // this won't apply if there's only one set of atoms (iAtoms), where we would want all-to-all contacts if (noOverlap) return...
java
public List<Contact> getIndicesContacts() { List<Contact> list = new ArrayList<>(); // if the 2 sets of atoms are not overlapping they are too far away and no need to calculate anything // this won't apply if there's only one set of atoms (iAtoms), where we would want all-to-all contacts if (noOverlap) return...
[ "public", "List", "<", "Contact", ">", "getIndicesContacts", "(", ")", "{", "List", "<", "Contact", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "// if the 2 sets of atoms are not overlapping they are too far away and no need to calculate anything", "// this...
Returns all contacts, i.e. all atoms that are within the cutoff distance, as simple Contact objects containing the atom indices pairs and the distance. If both iAtoms and jAtoms are defined then contacts are between iAtoms and jAtoms, if jAtoms is null, then contacts are within the iAtoms. @return
[ "Returns", "all", "contacts", "i", ".", "e", ".", "all", "atoms", "that", "are", "within", "the", "cutoff", "distance", "as", "simple", "Contact", "objects", "containing", "the", "atom", "indices", "pairs", "and", "the", "distance", ".", "If", "both", "iAt...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java#L419-L456
32,120
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java
AFPTwister.twistOptimized
public static Group[] twistOptimized(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException { Atom[] optTwistPdb = new Atom[ca2.length]; int gPos = -1; for (Atom a : ca2) { gPos++; optTwistPdb[gPos] = a; } int blockNum = afpChain.getBlockNum(); int b2 = 0; int e2 = 0; int focu...
java
public static Group[] twistOptimized(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException { Atom[] optTwistPdb = new Atom[ca2.length]; int gPos = -1; for (Atom a : ca2) { gPos++; optTwistPdb[gPos] = a; } int blockNum = afpChain.getBlockNum(); int b2 = 0; int e2 = 0; int focu...
[ "public", "static", "Group", "[", "]", "twistOptimized", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ")", "throws", "StructureException", "{", "Atom", "[", "]", "optTwistPdb", "=", "new", "Atom", "[", "ca2", ...
superimposing according to the optimized alignment @param afpChain @param ca1 @param ca2 @return Group array twisted. @throws StructureException
[ "superimposing", "according", "to", "the", "optimized", "alignment" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java#L170-L245
32,121
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java
AFPTwister.getAtoms
private static Atom[] getAtoms(Atom[] ca, int[] positions, int length, boolean clone) { List<Atom> atoms = new ArrayList<Atom>(); for (int i = 0; i < length; i++) { int p = positions[i]; Atom a; if (clone) { a = (Atom) ca[p].clone(); a.setGroup((Group) ca[p].getGroup().clone()); } else { ...
java
private static Atom[] getAtoms(Atom[] ca, int[] positions, int length, boolean clone) { List<Atom> atoms = new ArrayList<Atom>(); for (int i = 0; i < length; i++) { int p = positions[i]; Atom a; if (clone) { a = (Atom) ca[p].clone(); a.setGroup((Group) ca[p].getGroup().clone()); } else { ...
[ "private", "static", "Atom", "[", "]", "getAtoms", "(", "Atom", "[", "]", "ca", ",", "int", "[", "]", "positions", ",", "int", "length", ",", "boolean", "clone", ")", "{", "List", "<", "Atom", ">", "atoms", "=", "new", "ArrayList", "<", "Atom", ">"...
most likely the clone flag is not needed
[ "most", "likely", "the", "clone", "flag", "is", "not", "needed" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java#L297-L313
32,122
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java
AFPTwister.calCaRmsd
private static double calCaRmsd(Atom[] ca1, Atom[] pro, int resn, int[] res1, int[] res2) throws StructureException { Atom[] cod1 = getAtoms(ca1, res1, resn, false); Atom[] cod2 = getAtoms(pro, res2, resn, false); if (cod1.length == 0 || cod2.length == 0) { logger.info("length of atoms == 0!"); return...
java
private static double calCaRmsd(Atom[] ca1, Atom[] pro, int resn, int[] res1, int[] res2) throws StructureException { Atom[] cod1 = getAtoms(ca1, res1, resn, false); Atom[] cod2 = getAtoms(pro, res2, resn, false); if (cod1.length == 0 || cod2.length == 0) { logger.info("length of atoms == 0!"); return...
[ "private", "static", "double", "calCaRmsd", "(", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "pro", ",", "int", "resn", ",", "int", "[", "]", "res1", ",", "int", "[", "]", "res2", ")", "throws", "StructureException", "{", "Atom", "[", "]", "cod...
Return the rmsd of the CAs between the input pro and this protein, at given positions. quite similar to transPdb but while that one transforms the whole ca2, this one only works on the res1 and res2 positions. Modifies the coordinates in the second set of Atoms (pro). @return rmsd of CAs
[ "Return", "the", "rmsd", "of", "the", "CAs", "between", "the", "input", "pro", "and", "this", "protein", "at", "given", "positions", ".", "quite", "similar", "to", "transPdb", "but", "while", "that", "one", "transforms", "the", "whole", "ca2", "this", "one...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java#L371-L389
32,123
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java
AFPTwister.afp2Res
public static int afp2Res(AFPChain afpChain, int afpn, int[] afpPositions, int listStart) { int[] res1 = afpChain.getFocusRes1(); int[] res2 = afpChain.getFocusRes2(); int minLen = afpChain.getMinLen(); int n = 0; List<AFP> afpSet = afpChain.getAfpSet(); for (int i = listStart; i < listStart + afpn; i...
java
public static int afp2Res(AFPChain afpChain, int afpn, int[] afpPositions, int listStart) { int[] res1 = afpChain.getFocusRes1(); int[] res2 = afpChain.getFocusRes2(); int minLen = afpChain.getMinLen(); int n = 0; List<AFP> afpSet = afpChain.getAfpSet(); for (int i = listStart; i < listStart + afpn; i...
[ "public", "static", "int", "afp2Res", "(", "AFPChain", "afpChain", ",", "int", "afpn", ",", "int", "[", "]", "afpPositions", ",", "int", "listStart", ")", "{", "int", "[", "]", "res1", "=", "afpChain", ".", "getFocusRes1", "(", ")", ";", "int", "[", ...
Set the list of equivalent residues in the two proteins given a list of AFPs WARNING: changes the values for FocusRes1, focusRes2 and FocusResn in afpChain! @param afpChain the AFPChain to store resuts @param afpn nr of afp @param afpPositions @param listStart @return nr of eq residues
[ "Set", "the", "list", "of", "equivalent", "residues", "in", "the", "two", "proteins", "given", "a", "list", "of", "AFPs" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/AFPTwister.java#L407-L439
32,124
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/JAutoSuggest.java
JAutoSuggest.updateLocation
private void updateLocation() { try { location = getLocationOnScreen(); location.y += getHeight(); dialog.setLocation(location); } catch (IllegalComponentStateException e) { return; // might happen on window creation } }
java
private void updateLocation() { try { location = getLocationOnScreen(); location.y += getHeight(); dialog.setLocation(location); } catch (IllegalComponentStateException e) { return; // might happen on window creation } }
[ "private", "void", "updateLocation", "(", ")", "{", "try", "{", "location", "=", "getLocationOnScreen", "(", ")", ";", "location", ".", "y", "+=", "getHeight", "(", ")", ";", "dialog", ".", "setLocation", "(", "location", ")", ";", "}", "catch", "(", "...
Place the suggestion window under the JTextField.
[ "Place", "the", "suggestion", "window", "under", "the", "JTextField", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/JAutoSuggest.java#L325-L333
32,125
biojava/biojava
biojava-survival/src/main/java/org/biojava/nbio/survival/cox/matrix/StdArrayIO.java
StdArrayIO.print
public static void print(double[] a) { int N = a.length; System.out.println(N); for (int i = 0; i < N; i++) { // System.out.printf("%9.5f ", a[i]); System.out.print(a[i] + " "); } System.out.println(); }
java
public static void print(double[] a) { int N = a.length; System.out.println(N); for (int i = 0; i < N; i++) { // System.out.printf("%9.5f ", a[i]); System.out.print(a[i] + " "); } System.out.println(); }
[ "public", "static", "void", "print", "(", "double", "[", "]", "a", ")", "{", "int", "N", "=", "a", ".", "length", ";", "System", ".", "out", ".", "println", "(", "N", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i",...
Print an array of doubles to standard output. @param a
[ "Print", "an", "array", "of", "doubles", "to", "standard", "output", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/matrix/StdArrayIO.java#L86-L94
32,126
biojava/biojava
biojava-ontology/src/main/java/org/biojava/nbio/ontology/utils/SmallMap.java
SmallMap.removeMapping
private void removeMapping(int num) { if (num < numMappings) { System.arraycopy(mappings, num * 2, mappings, (num - 1) * 2, (numMappings - num) * 2); } mappings[numMappings * 2 - 1] = null; mappings[numMappings * 2 - 2] = null; numMappings--; }
java
private void removeMapping(int num) { if (num < numMappings) { System.arraycopy(mappings, num * 2, mappings, (num - 1) * 2, (numMappings - num) * 2); } mappings[numMappings * 2 - 1] = null; mappings[numMappings * 2 - 2] = null; numMappings--; }
[ "private", "void", "removeMapping", "(", "int", "num", ")", "{", "if", "(", "num", "<", "numMappings", ")", "{", "System", ".", "arraycopy", "(", "mappings", ",", "num", "*", "2", ",", "mappings", ",", "(", "num", "-", "1", ")", "*", "2", ",", "(...
num ranges from 1 to numMappings
[ "num", "ranges", "from", "1", "to", "numMappings" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ontology/src/main/java/org/biojava/nbio/ontology/utils/SmallMap.java#L141-L148
32,127
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SimpleSubstitutionMatrix.java
SimpleSubstitutionMatrix.getIndexOfCompound
private static <C extends Compound> int getIndexOfCompound(List<C> list, C compound) { int index = list.indexOf(compound); if (index == -1) { for (int i = 0; i < list.size(); i++) { if (compound.equalsIgnoreCase(list.get(i))) { index = i; break; } } } return index; }
java
private static <C extends Compound> int getIndexOfCompound(List<C> list, C compound) { int index = list.indexOf(compound); if (index == -1) { for (int i = 0; i < list.size(); i++) { if (compound.equalsIgnoreCase(list.get(i))) { index = i; break; } } } return index; }
[ "private", "static", "<", "C", "extends", "Compound", ">", "int", "getIndexOfCompound", "(", "List", "<", "C", ">", "list", ",", "C", "compound", ")", "{", "int", "index", "=", "list", ".", "indexOf", "(", "compound", ")", ";", "if", "(", "index", "=...
Returns the index of the first occurrence of the specified element in the list. If the list does not contain the given compound, the index of the first occurrence of the element according to case-insensitive equality. If no such elements exist, -1 is returned. @param list list of compounds to search @param compound com...
[ "Returns", "the", "index", "of", "the", "first", "occurrence", "of", "the", "specified", "element", "in", "the", "list", ".", "If", "the", "list", "does", "not", "contain", "the", "given", "compound", "the", "index", "of", "the", "first", "occurrence", "of...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SimpleSubstitutionMatrix.java#L229-L240
32,128
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java
SymmetryAxes.addAxis
public void addAxis(Matrix4d axis, int order, SymmetryType type) { axes.add(new Axis(axis,order,type,axes.size(),0)); }
java
public void addAxis(Matrix4d axis, int order, SymmetryType type) { axes.add(new Axis(axis,order,type,axes.size(),0)); }
[ "public", "void", "addAxis", "(", "Matrix4d", "axis", ",", "int", "order", ",", "SymmetryType", "type", ")", "{", "axes", ".", "add", "(", "new", "Axis", "(", "axis", ",", "order", ",", "type", ",", "axes", ".", "size", "(", ")", ",", "0", ")", "...
Adds a new axis of symmetry to the bottom level of the tree @param axis the new axis of symmetry found @param order number of parts that this axis divides the structure in @param type indicates whether the axis has OPEN or CLOSED symmetry
[ "Adds", "a", "new", "axis", "of", "symmetry", "to", "the", "bottom", "level", "of", "the", "tree" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L205-L207
32,129
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java
SymmetryAxes.updateAxis
public void updateAxis(Integer index, Matrix4d newAxis){ axes.get(index).setOperator(newAxis); }
java
public void updateAxis(Integer index, Matrix4d newAxis){ axes.get(index).setOperator(newAxis); }
[ "public", "void", "updateAxis", "(", "Integer", "index", ",", "Matrix4d", "newAxis", ")", "{", "axes", ".", "get", "(", "index", ")", ".", "setOperator", "(", "newAxis", ")", ";", "}" ]
Updates an axis of symmetry, after the superposition changed. @param index old axis index @param newAxis
[ "Updates", "an", "axis", "of", "symmetry", "after", "the", "superposition", "changed", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L252-L254
32,130
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java
SymmetryAxes.getElementaryAxes
public List<Matrix4d> getElementaryAxes(){ List<Matrix4d> ops = new ArrayList<Matrix4d>(getNumLevels()); for(Axis axis : axes) { ops.add(axis.getOperator()); } return ops; }
java
public List<Matrix4d> getElementaryAxes(){ List<Matrix4d> ops = new ArrayList<Matrix4d>(getNumLevels()); for(Axis axis : axes) { ops.add(axis.getOperator()); } return ops; }
[ "public", "List", "<", "Matrix4d", ">", "getElementaryAxes", "(", ")", "{", "List", "<", "Matrix4d", ">", "ops", "=", "new", "ArrayList", "<", "Matrix4d", ">", "(", "getNumLevels", "(", ")", ")", ";", "for", "(", "Axis", "axis", ":", "axes", ")", "{"...
Return the operator for all elementary axes of symmetry of the structure, that is, the axes stored in the List as unique and from which all the symmetry axes are constructed. @return axes elementary axes of symmetry.
[ "Return", "the", "operator", "for", "all", "elementary", "axes", "of", "symmetry", "of", "the", "structure", "that", "is", "the", "axes", "stored", "in", "the", "List", "as", "unique", "and", "from", "which", "all", "the", "symmetry", "axes", "are", "const...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L263-L269
32,131
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java
SymmetryAxes.getRepeatTransform
public Matrix4d getRepeatTransform(int repeat){ Matrix4d transform = new Matrix4d(); transform.setIdentity(); int[] counts = getAxisCounts(repeat); for(int t = counts.length-1; t>=0; t--) { if( counts[t] == 0 ) continue; Matrix4d axis = new Matrix4d(axes.get(t).getOperator()); for(int i=0;i<coun...
java
public Matrix4d getRepeatTransform(int repeat){ Matrix4d transform = new Matrix4d(); transform.setIdentity(); int[] counts = getAxisCounts(repeat); for(int t = counts.length-1; t>=0; t--) { if( counts[t] == 0 ) continue; Matrix4d axis = new Matrix4d(axes.get(t).getOperator()); for(int i=0;i<coun...
[ "public", "Matrix4d", "getRepeatTransform", "(", "int", "repeat", ")", "{", "Matrix4d", "transform", "=", "new", "Matrix4d", "(", ")", ";", "transform", ".", "setIdentity", "(", ")", ";", "int", "[", "]", "counts", "=", "getAxisCounts", "(", "repeat", ")",...
Return the transformation that needs to be applied to a repeat in order to superimpose onto repeat 0. @param repeat the repeat index @return transformation matrix for the repeat
[ "Return", "the", "transformation", "that", "needs", "to", "be", "applied", "to", "a", "repeat", "in", "order", "to", "superimpose", "onto", "repeat", "0", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L389-L405
32,132
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java
SymmetryAxes.getRepeatTransform
public Matrix4d getRepeatTransform(int x, int y){ Matrix4d transform = new Matrix4d(); transform.setIdentity(); int[] iCounts = getAxisCounts(x); int[] jCounts = getAxisCounts(y); int[] counts = new int[iCounts.length]; for (int k = 0; k < iCounts.length; k++) counts[k] = iCounts[k] - jCounts[k]; f...
java
public Matrix4d getRepeatTransform(int x, int y){ Matrix4d transform = new Matrix4d(); transform.setIdentity(); int[] iCounts = getAxisCounts(x); int[] jCounts = getAxisCounts(y); int[] counts = new int[iCounts.length]; for (int k = 0; k < iCounts.length; k++) counts[k] = iCounts[k] - jCounts[k]; f...
[ "public", "Matrix4d", "getRepeatTransform", "(", "int", "x", ",", "int", "y", ")", "{", "Matrix4d", "transform", "=", "new", "Matrix4d", "(", ")", ";", "transform", ".", "setIdentity", "(", ")", ";", "int", "[", "]", "iCounts", "=", "getAxisCounts", "(",...
Return the transformation that needs to be applied to repeat x in order to superimpose onto repeat y. @param x the first repeat index (transformed) @param y the second repeat index (fixed) @return transformation matrix for the repeat x
[ "Return", "the", "transformation", "that", "needs", "to", "be", "applied", "to", "repeat", "x", "in", "order", "to", "superimpose", "onto", "repeat", "y", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L415-L442
32,133
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java
SymmetryAxes.getNumRepeats
private int getNumRepeats(int level) { int size = 1; // Return 1 for illegally high level if(level < getNumLevels()) { for(Axis axis : axes.subList(level, getNumLevels())) { size *= axis.getOrder(); } } return size; }
java
private int getNumRepeats(int level) { int size = 1; // Return 1 for illegally high level if(level < getNumLevels()) { for(Axis axis : axes.subList(level, getNumLevels())) { size *= axis.getOrder(); } } return size; }
[ "private", "int", "getNumRepeats", "(", "int", "level", ")", "{", "int", "size", "=", "1", ";", "// Return 1 for illegally high level", "if", "(", "level", "<", "getNumLevels", "(", ")", ")", "{", "for", "(", "Axis", "axis", ":", "axes", ".", "subList", ...
Get the number of leaves from a node at the specified level. This is equal to the product of all degrees at or below the level. @param level level of the tree to cut at @return Number of repeats (leaves of the tree).
[ "Get", "the", "number", "of", "leaves", "from", "a", "node", "at", "the", "specified", "level", ".", "This", "is", "equal", "to", "the", "product", "of", "all", "degrees", "at", "or", "below", "the", "level", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L527-L536
32,134
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java
SymmetryAxes.getFirstRepeats
public List<Integer> getFirstRepeats(int level) { List<Integer> firstRepeats = new ArrayList<Integer>(); int m = getNumRepeats(level+1); //size of the level int d = axes.get(level).getOrder(); //degree of this level int n = m*d; // number of repeats included in each axis for (int firstRepeat = 0; firstRepeat ...
java
public List<Integer> getFirstRepeats(int level) { List<Integer> firstRepeats = new ArrayList<Integer>(); int m = getNumRepeats(level+1); //size of the level int d = axes.get(level).getOrder(); //degree of this level int n = m*d; // number of repeats included in each axis for (int firstRepeat = 0; firstRepeat ...
[ "public", "List", "<", "Integer", ">", "getFirstRepeats", "(", "int", "level", ")", "{", "List", "<", "Integer", ">", "firstRepeats", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "int", "m", "=", "getNumRepeats", "(", "level", "+", "1",...
Get the first repeat index of each axis of a specified level. @param level level of the tree to cut at @return List of first Repeats of each index, sorted in ascending order
[ "Get", "the", "first", "repeat", "index", "of", "each", "axis", "of", "a", "specified", "level", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L543-L551
32,135
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.setAsas
void setAsas(double[] asas1, double[] asas2, int nSpherePoints, int nThreads, int cofactorSizeToUse) { Atom[] atoms = getAtomsForAsa(cofactorSizeToUse); AsaCalculator asaCalc = new AsaCalculator(atoms, AsaCalculator.DEFAULT_PROBE_SIZE, nSpherePoints, nThreads); double[] complexAsas = asaCalc.calculateAsas()...
java
void setAsas(double[] asas1, double[] asas2, int nSpherePoints, int nThreads, int cofactorSizeToUse) { Atom[] atoms = getAtomsForAsa(cofactorSizeToUse); AsaCalculator asaCalc = new AsaCalculator(atoms, AsaCalculator.DEFAULT_PROBE_SIZE, nSpherePoints, nThreads); double[] complexAsas = asaCalc.calculateAsas()...
[ "void", "setAsas", "(", "double", "[", "]", "asas1", ",", "double", "[", "]", "asas2", ",", "int", "nSpherePoints", ",", "int", "nThreads", ",", "int", "cofactorSizeToUse", ")", "{", "Atom", "[", "]", "atoms", "=", "getAtomsForAsa", "(", "cofactorSizeToUse...
Set ASA annotations by passing the uncomplexed ASA values of the 2 partners. This will calculate complexed ASA and set the ASA values in the member variables. @param asas1 ASA values for atoms of partner 1 @param asas2 ASA values for atoms of partner 2 @param nSpherePoints the number of sphere points to be used for com...
[ "Set", "ASA", "annotations", "by", "passing", "the", "uncomplexed", "ASA", "values", "of", "the", "2", "partners", ".", "This", "will", "calculate", "complexed", "ASA", "and", "set", "the", "ASA", "values", "in", "the", "member", "variables", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L209-L271
32,136
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.getAllNonHAtomArray
private static final Atom[] getAllNonHAtomArray(Atom[] m, int minSizeHetAtomToInclude) { List<Atom> atoms = new ArrayList<>(); for (Atom a:m){ if (a.getElement()==Element.H) continue; Group g = a.getGroup(); if (g.getType().equals(GroupType.HETATM) && !isInChain(g) && getSizeNoH(g)<minSizeHetAto...
java
private static final Atom[] getAllNonHAtomArray(Atom[] m, int minSizeHetAtomToInclude) { List<Atom> atoms = new ArrayList<>(); for (Atom a:m){ if (a.getElement()==Element.H) continue; Group g = a.getGroup(); if (g.getType().equals(GroupType.HETATM) && !isInChain(g) && getSizeNoH(g)<minSizeHetAto...
[ "private", "static", "final", "Atom", "[", "]", "getAllNonHAtomArray", "(", "Atom", "[", "]", "m", ",", "int", "minSizeHetAtomToInclude", ")", "{", "List", "<", "Atom", ">", "atoms", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Atom", "a"...
Returns and array of all non-Hydrogen atoms in the given molecule, including all main chain HETATOM groups. Non main-chain HETATOM groups with fewer than minSizeHetAtomToInclude non-Hydrogen atoms are not included. @param m @param minSizeHetAtomToInclude HETATOM groups (non main-chain) with fewer number of non-Hydrogen...
[ "Returns", "and", "array", "of", "all", "non", "-", "Hydrogen", "atoms", "in", "the", "given", "molecule", "including", "all", "main", "chain", "HETATOM", "groups", ".", "Non", "main", "-", "chain", "HETATOM", "groups", "with", "fewer", "than", "minSizeHetAt...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L307-L325
32,137
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.getSizeNoH
private static int getSizeNoH(Group g) { int size = 0; for (Atom a:g.getAtoms()) { if (a.getElement()!=Element.H) size++; } return size; }
java
private static int getSizeNoH(Group g) { int size = 0; for (Atom a:g.getAtoms()) { if (a.getElement()!=Element.H) size++; } return size; }
[ "private", "static", "int", "getSizeNoH", "(", "Group", "g", ")", "{", "int", "size", "=", "0", ";", "for", "(", "Atom", "a", ":", "g", ".", "getAtoms", "(", ")", ")", "{", "if", "(", "a", ".", "getElement", "(", ")", "!=", "Element", ".", "H",...
Calculates the number of non-Hydrogen atoms in the given group @param g @return
[ "Calculates", "the", "number", "of", "non", "-", "Hydrogen", "atoms", "in", "the", "given", "group" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L332-L339
32,138
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.isInChain
private static boolean isInChain(Group g) { ChemComp chemComp = g.getChemComp(); if (chemComp==null) { logger.warn("Warning: can't determine PolymerType for group "+g.getResidueNumber()+" ("+g.getPDBName()+"). Will consider it as non-nucleotide/non-protein type."); return false; } PolymerType polyType =...
java
private static boolean isInChain(Group g) { ChemComp chemComp = g.getChemComp(); if (chemComp==null) { logger.warn("Warning: can't determine PolymerType for group "+g.getResidueNumber()+" ("+g.getPDBName()+"). Will consider it as non-nucleotide/non-protein type."); return false; } PolymerType polyType =...
[ "private", "static", "boolean", "isInChain", "(", "Group", "g", ")", "{", "ChemComp", "chemComp", "=", "g", ".", "getChemComp", "(", ")", ";", "if", "(", "chemComp", "==", "null", ")", "{", "logger", ".", "warn", "(", "\"Warning: can't determine PolymerType ...
Returns true if the given group is part of the main chain, i.e. if it is a peptide-linked group or a nucleotide @param g @return
[ "Returns", "true", "if", "the", "given", "group", "is", "part", "of", "the", "main", "chain", "i", ".", "e", ".", "if", "it", "is", "a", "peptide", "-", "linked", "group", "or", "a", "nucleotide" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L347-L364
32,139
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.getInterfacingResidues
public Pair<List<Group>> getInterfacingResidues(double minAsaForSurface) { List<Group> interf1 = new ArrayList<Group>(); List<Group> interf2 = new ArrayList<Group>(); for (GroupAsa groupAsa:groupAsas1.values()) { if (groupAsa.getAsaU()>minAsaForSurface && groupAsa.getBsa()>0) { interf1.add(groupAsa.getG...
java
public Pair<List<Group>> getInterfacingResidues(double minAsaForSurface) { List<Group> interf1 = new ArrayList<Group>(); List<Group> interf2 = new ArrayList<Group>(); for (GroupAsa groupAsa:groupAsas1.values()) { if (groupAsa.getAsaU()>minAsaForSurface && groupAsa.getBsa()>0) { interf1.add(groupAsa.getG...
[ "public", "Pair", "<", "List", "<", "Group", ">", ">", "getInterfacingResidues", "(", "double", "minAsaForSurface", ")", "{", "List", "<", "Group", ">", "interf1", "=", "new", "ArrayList", "<", "Group", ">", "(", ")", ";", "List", "<", "Group", ">", "i...
Returns the residues belonging to the interface, i.e. the residues at the surface with BSA>0 @param minAsaForSurface the minimum ASA to consider a residue on the surface @return
[ "Returns", "the", "residues", "belonging", "to", "the", "interface", "i", ".", "e", ".", "the", "residues", "at", "the", "surface", "with", "BSA", ">", "0" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L530-L549
32,140
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.getSurfaceResidues
public Pair<List<Group>> getSurfaceResidues(double minAsaForSurface) { List<Group> surf1 = new ArrayList<Group>(); List<Group> surf2 = new ArrayList<Group>(); for (GroupAsa groupAsa:groupAsas1.values()) { if (groupAsa.getAsaU()>minAsaForSurface) { surf1.add(groupAsa.getGroup()); } } for (GroupAsa ...
java
public Pair<List<Group>> getSurfaceResidues(double minAsaForSurface) { List<Group> surf1 = new ArrayList<Group>(); List<Group> surf2 = new ArrayList<Group>(); for (GroupAsa groupAsa:groupAsas1.values()) { if (groupAsa.getAsaU()>minAsaForSurface) { surf1.add(groupAsa.getGroup()); } } for (GroupAsa ...
[ "public", "Pair", "<", "List", "<", "Group", ">", ">", "getSurfaceResidues", "(", "double", "minAsaForSurface", ")", "{", "List", "<", "Group", ">", "surf1", "=", "new", "ArrayList", "<", "Group", ">", "(", ")", ";", "List", "<", "Group", ">", "surf2",...
Returns the residues belonging to the surface @param minAsaForSurface the minimum ASA to consider a residue on the surface @return
[ "Returns", "the", "residues", "belonging", "to", "the", "surface" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L556-L574
32,141
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.isIsologous
public boolean isIsologous() { double scoreInverse = this.getContactOverlapScore(this, true); logger.debug("Interface {} contact overlap score with itself inverted: {}", getId(), scoreInverse); return (scoreInverse>SELF_SCORE_FOR_ISOLOGOUS); }
java
public boolean isIsologous() { double scoreInverse = this.getContactOverlapScore(this, true); logger.debug("Interface {} contact overlap score with itself inverted: {}", getId(), scoreInverse); return (scoreInverse>SELF_SCORE_FOR_ISOLOGOUS); }
[ "public", "boolean", "isIsologous", "(", ")", "{", "double", "scoreInverse", "=", "this", ".", "getContactOverlapScore", "(", "this", ",", "true", ")", ";", "logger", ".", "debug", "(", "\"Interface {} contact overlap score with itself inverted: {}\"", ",", "getId", ...
Tell whether the interface is isologous, i.e. it is formed by the same patches of same Compound on both sides. @return true if isologous, false if heterologous
[ "Tell", "whether", "the", "interface", "is", "isologous", "i", ".", "e", ".", "it", "is", "formed", "by", "the", "same", "patches", "of", "same", "Compound", "on", "both", "sides", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L675-L680
32,142
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.getParentChains
public Pair<Chain> getParentChains() { Atom[] firstMol = this.molecules.getFirst(); Atom[] secondMol = this.molecules.getSecond(); if (firstMol.length==0 || secondMol.length==0) { logger.warn("No atoms found in first or second molecule, can't get parent Chains"); return null; } return new Pair<Chain>(f...
java
public Pair<Chain> getParentChains() { Atom[] firstMol = this.molecules.getFirst(); Atom[] secondMol = this.molecules.getSecond(); if (firstMol.length==0 || secondMol.length==0) { logger.warn("No atoms found in first or second molecule, can't get parent Chains"); return null; } return new Pair<Chain>(f...
[ "public", "Pair", "<", "Chain", ">", "getParentChains", "(", ")", "{", "Atom", "[", "]", "firstMol", "=", "this", ".", "molecules", ".", "getFirst", "(", ")", ";", "Atom", "[", "]", "secondMol", "=", "this", ".", "molecules", ".", "getSecond", "(", "...
Finds the parent chains by looking up the references of first atom of each side of this interface @return
[ "Finds", "the", "parent", "chains", "by", "looking", "up", "the", "references", "of", "first", "atom", "of", "each", "side", "of", "this", "interface" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L686-L695
32,143
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java
StructureInterface.getParentCompounds
public Pair<EntityInfo> getParentCompounds() { Pair<Chain> chains = getParentChains(); if (chains == null) { logger.warn("Could not find parents chains, compounds will be null"); return null; } return new Pair<EntityInfo>(chains.getFirst().getEntityInfo(), chains.getSecond().getEntityInfo()); }
java
public Pair<EntityInfo> getParentCompounds() { Pair<Chain> chains = getParentChains(); if (chains == null) { logger.warn("Could not find parents chains, compounds will be null"); return null; } return new Pair<EntityInfo>(chains.getFirst().getEntityInfo(), chains.getSecond().getEntityInfo()); }
[ "public", "Pair", "<", "EntityInfo", ">", "getParentCompounds", "(", ")", "{", "Pair", "<", "Chain", ">", "chains", "=", "getParentChains", "(", ")", ";", "if", "(", "chains", "==", "null", ")", "{", "logger", ".", "warn", "(", "\"Could not find parents ch...
Finds the parent compounds by looking up the references of first atom of each side of this interface @return
[ "Finds", "the", "parent", "compounds", "by", "looking", "up", "the", "references", "of", "first", "atom", "of", "each", "side", "of", "this", "interface" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java#L701-L708
32,144
biojava/biojava
biojava-structure/src/main/java/demo/DemoMMCIFReader.java
DemoMMCIFReader.loadSimple
public void loadSimple(){ String pdbId = "4hhb"; AtomCache cache = new AtomCache(); cache.setUseMmCif(true); StructureIO.setAtomCache(cache); try { Structure s = StructureIO.getStructure(pdbId); System.out.println(pdbId + " has nr atoms: " + StructureTools.getNrAtoms(s)); } catch (Exception e){ ...
java
public void loadSimple(){ String pdbId = "4hhb"; AtomCache cache = new AtomCache(); cache.setUseMmCif(true); StructureIO.setAtomCache(cache); try { Structure s = StructureIO.getStructure(pdbId); System.out.println(pdbId + " has nr atoms: " + StructureTools.getNrAtoms(s)); } catch (Exception e){ ...
[ "public", "void", "loadSimple", "(", ")", "{", "String", "pdbId", "=", "\"4hhb\"", ";", "AtomCache", "cache", "=", "new", "AtomCache", "(", ")", ";", "cache", ".", "setUseMmCif", "(", "true", ")", ";", "StructureIO", ".", "setAtomCache", "(", "cache", ")...
A basic example how to load an mmCif file and get a Structure object
[ "A", "basic", "example", "how", "to", "load", "an", "mmCif", "file", "and", "get", "a", "Structure", "object" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/demo/DemoMMCIFReader.java#L56-L72
32,145
biojava/biojava
biojava-structure/src/main/java/demo/DemoMMCIFReader.java
DemoMMCIFReader.loadFromDirectAccess
public void loadFromDirectAccess(){ String pdbId = "1A4W"; StructureProvider pdbreader = new MMCIFFileReader(); try { Structure s = pdbreader.getStructureById(pdbId); System.out.println("Getting chain H of 1A4W"); List<Chain> hs = s.getNonPolyChainsByPDB("H"); Chain h = hs.get(0); List<Group> ...
java
public void loadFromDirectAccess(){ String pdbId = "1A4W"; StructureProvider pdbreader = new MMCIFFileReader(); try { Structure s = pdbreader.getStructureById(pdbId); System.out.println("Getting chain H of 1A4W"); List<Chain> hs = s.getNonPolyChainsByPDB("H"); Chain h = hs.get(0); List<Group> ...
[ "public", "void", "loadFromDirectAccess", "(", ")", "{", "String", "pdbId", "=", "\"1A4W\"", ";", "StructureProvider", "pdbreader", "=", "new", "MMCIFFileReader", "(", ")", ";", "try", "{", "Structure", "s", "=", "pdbreader", ".", "getStructureById", "(", "pdb...
An example demonstrating how to directly use the mmCif file parsing classes. This could potentially be used to use the parser to populate a data-structure that is different from the biojava-structure data model.
[ "An", "example", "demonstrating", "how", "to", "directly", "use", "the", "mmCif", "file", "parsing", "classes", ".", "This", "could", "potentially", "be", "used", "to", "use", "the", "parser", "to", "populate", "a", "data", "-", "structure", "that", "is", ...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/demo/DemoMMCIFReader.java#L80-L117
32,146
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPCalculator.java
AFPCalculator.getFragment
private static final Atom[] getFragment(Atom[] caall, int pos, int fragmentLength , boolean clone){ if ( pos+fragmentLength > caall.length) return null; Atom[] tmp = new Atom[fragmentLength]; for (int i=0;i< fragmentLength;i++){ if (clone){ tmp[i] = (Atom)caall[i+pos].clone(); } else { tmp[...
java
private static final Atom[] getFragment(Atom[] caall, int pos, int fragmentLength , boolean clone){ if ( pos+fragmentLength > caall.length) return null; Atom[] tmp = new Atom[fragmentLength]; for (int i=0;i< fragmentLength;i++){ if (clone){ tmp[i] = (Atom)caall[i+pos].clone(); } else { tmp[...
[ "private", "static", "final", "Atom", "[", "]", "getFragment", "(", "Atom", "[", "]", "caall", ",", "int", "pos", ",", "int", "fragmentLength", ",", "boolean", "clone", ")", "{", "if", "(", "pos", "+", "fragmentLength", ">", "caall", ".", "length", ")"...
get a continue subset of Atoms based by the starting position and the length @param caall @param pos ... the start position @param fragmentLength .. the length of the subset to extract. @param clone: returns a copy of the atom (in case the coordinate get manipulated...) @return an Atom[] array
[ "get", "a", "continue", "subset", "of", "Atoms", "based", "by", "the", "starting", "position", "and", "the", "length" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPCalculator.java#L214-L231
32,147
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPCalculator.java
AFPCalculator.scoreAfp
private static final double scoreAfp(AFP afp, double badRmsd, double fragScore) { //longer AFP with low rmsd is better double s, w; //s = (rmsdCut - afptmp.rmsd) * afptmp.len; //the same scroing strategy as that in the post-processing w = afp.getRmsd() / badRmsd; w = w * w; s = fragScore * (1.0 - w); re...
java
private static final double scoreAfp(AFP afp, double badRmsd, double fragScore) { //longer AFP with low rmsd is better double s, w; //s = (rmsdCut - afptmp.rmsd) * afptmp.len; //the same scroing strategy as that in the post-processing w = afp.getRmsd() / badRmsd; w = w * w; s = fragScore * (1.0 - w); re...
[ "private", "static", "final", "double", "scoreAfp", "(", "AFP", "afp", ",", "double", "badRmsd", ",", "double", "fragScore", ")", "{", "//longer AFP with low rmsd is better", "double", "s", ",", "w", ";", "//s = (rmsdCut - afptmp.rmsd) * afptmp.len; //the same scroing str...
Assign score to each AFP
[ "Assign", "score", "to", "each", "AFP" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPCalculator.java#L238-L247
32,148
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/MenuCreator.java
MenuCreator.getAlignmentPanelMenu
public static JMenuBar getAlignmentPanelMenu(JFrame frame, ActionListener actionListener, AFPChain afpChain, MultipleAlignment msa){ JMenuBar menu = new JMenuBar(); JMenu file= new JMenu("File"); file.getAccessibleContext().setAccessibleDescription("File Menu"); menu.add(file); ImageIcon saveicon = c...
java
public static JMenuBar getAlignmentPanelMenu(JFrame frame, ActionListener actionListener, AFPChain afpChain, MultipleAlignment msa){ JMenuBar menu = new JMenuBar(); JMenu file= new JMenu("File"); file.getAccessibleContext().setAccessibleDescription("File Menu"); menu.add(file); ImageIcon saveicon = c...
[ "public", "static", "JMenuBar", "getAlignmentPanelMenu", "(", "JFrame", "frame", ",", "ActionListener", "actionListener", ",", "AFPChain", "afpChain", ",", "MultipleAlignment", "msa", ")", "{", "JMenuBar", "menu", "=", "new", "JMenuBar", "(", ")", ";", "JMenu", ...
Create the menu for the Alignment Panel representation of Structural Alignments. The alignment can be in AFPChain format or in the MultipleAlignment format. @param frame @param actionListener @param afpChain @param MultipleAlignment @return a JMenuBar
[ "Create", "the", "menu", "for", "the", "Alignment", "Panel", "representation", "of", "Structural", "Alignments", ".", "The", "alignment", "can", "be", "in", "AFPChain", "format", "or", "in", "the", "MultipleAlignment", "format", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/MenuCreator.java#L296-L381
32,149
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java
FeatureList.add
@Override public boolean add(FeatureI feature) { if (mLocation == null) { mLocation = feature.location().plus(); } else if (null != feature.location()) { mLocation = mLocation.union(feature.location().plus()); } for (Entry<String, String> entry : feature.getAttributes().entrySet()){ if (featindex.cont...
java
@Override public boolean add(FeatureI feature) { if (mLocation == null) { mLocation = feature.location().plus(); } else if (null != feature.location()) { mLocation = mLocation.union(feature.location().plus()); } for (Entry<String, String> entry : feature.getAttributes().entrySet()){ if (featindex.cont...
[ "@", "Override", "public", "boolean", "add", "(", "FeatureI", "feature", ")", "{", "if", "(", "mLocation", "==", "null", ")", "{", "mLocation", "=", "feature", ".", "location", "(", ")", ".", "plus", "(", ")", ";", "}", "else", "if", "(", "null", "...
Add specified feature to the end of the list. Updates the bounding location of the feature list, if needed. @param feature The FeatureI object to add. @return True if the feature was added.
[ "Add", "specified", "feature", "to", "the", "end", "of", "the", "list", ".", "Updates", "the", "bounding", "location", "of", "the", "feature", "list", "if", "needed", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L73-L98
32,150
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java
FeatureList.hasGaps
public boolean hasGaps(int gapLength) { Location last = null; for (FeatureI f : this) { if (last != null && gapLength <= f.location().distance(last)) { return true; } else { last = f.location(); } } return false; }
java
public boolean hasGaps(int gapLength) { Location last = null; for (FeatureI f : this) { if (last != null && gapLength <= f.location().distance(last)) { return true; } else { last = f.location(); } } return false; }
[ "public", "boolean", "hasGaps", "(", "int", "gapLength", ")", "{", "Location", "last", "=", "null", ";", "for", "(", "FeatureI", "f", ":", "this", ")", "{", "if", "(", "last", "!=", "null", "&&", "gapLength", "<=", "f", ".", "location", "(", ")", "...
Check size of gaps between successive features in list. The features in the list are assumed to be appropriately ordered. @param gapLength The minimum gap length to consider. Use a gapLength of 0 to check if features are contiguous. @return True if list has any gaps equal to or greater than gapLength.
[ "Check", "size", "of", "gaps", "between", "successive", "features", "in", "list", ".", "The", "features", "in", "the", "list", "are", "assumed", "to", "be", "appropriately", "ordered", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L132-L143
32,151
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java
FeatureList.splice
public String splice(DNASequence sequence) { StringBuilder subData = new StringBuilder(); Location last = null; for (FeatureI f : this) { Location loc = f.location(); if (last == null || loc.startsAfter(last)) { subData.append(sequence.getSubSequence(loc.start(), loc.end()).toString()); last = loc...
java
public String splice(DNASequence sequence) { StringBuilder subData = new StringBuilder(); Location last = null; for (FeatureI f : this) { Location loc = f.location(); if (last == null || loc.startsAfter(last)) { subData.append(sequence.getSubSequence(loc.start(), loc.end()).toString()); last = loc...
[ "public", "String", "splice", "(", "DNASequence", "sequence", ")", "{", "StringBuilder", "subData", "=", "new", "StringBuilder", "(", ")", ";", "Location", "last", "=", "null", ";", "for", "(", "FeatureI", "f", ":", "this", ")", "{", "Location", "loc", "...
Concatenate successive portions of the specified sequence using the feature locations in the list. The list is assumed to be appropriately ordered. @param sequence The source sequence from which portions should be selected. @return The spliced data. @throws IllegalStateException Out of order or overlapping FeatureI lo...
[ "Concatenate", "successive", "portions", "of", "the", "specified", "sequence", "using", "the", "feature", "locations", "in", "the", "list", ".", "The", "list", "is", "assumed", "to", "be", "appropriately", "ordered", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L158-L175
32,152
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java
FeatureList.selectByAttribute
public FeatureList selectByAttribute(String key) { FeatureList list = new FeatureList(); if (featindex.containsKey(key)){ Map<String, List<FeatureI>> featsmap =featindex.get(key); if(null != featsmap) { for (List<FeatureI> feats: featsmap.values()){ list.addAll(Collections.unmodifiableCollection(feat...
java
public FeatureList selectByAttribute(String key) { FeatureList list = new FeatureList(); if (featindex.containsKey(key)){ Map<String, List<FeatureI>> featsmap =featindex.get(key); if(null != featsmap) { for (List<FeatureI> feats: featsmap.values()){ list.addAll(Collections.unmodifiableCollection(feat...
[ "public", "FeatureList", "selectByAttribute", "(", "String", "key", ")", "{", "FeatureList", "list", "=", "new", "FeatureList", "(", ")", ";", "if", "(", "featindex", ".", "containsKey", "(", "key", ")", ")", "{", "Map", "<", "String", ",", "List", "<", ...
Create a list of all features that include the specified attribute key. @param key The key to consider. @return A list of features that include the key.
[ "Create", "a", "list", "of", "all", "features", "that", "include", "the", "specified", "attribute", "key", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L292-L310
32,153
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java
FeatureList.selectOverlapping
public FeatureList selectOverlapping(String seqname, Location location, boolean useBothStrands) throws Exception { FeatureList list = new FeatureList(); for (FeatureI feature : this) { boolean overlaps = false; if (feature.seqname().equals(seqname)) { if (location.isSameStrand(feature.location())) { ...
java
public FeatureList selectOverlapping(String seqname, Location location, boolean useBothStrands) throws Exception { FeatureList list = new FeatureList(); for (FeatureI feature : this) { boolean overlaps = false; if (feature.seqname().equals(seqname)) { if (location.isSameStrand(feature.location())) { ...
[ "public", "FeatureList", "selectOverlapping", "(", "String", "seqname", ",", "Location", "location", ",", "boolean", "useBothStrands", ")", "throws", "Exception", "{", "FeatureList", "list", "=", "new", "FeatureList", "(", ")", ";", "for", "(", "FeatureI", "feat...
Create a list of all features that overlap the specified location on the specified sequence. @param seqname The sequence name. Only features with this sequence name will be checked for overlap. @param location The location to check. @param useBothStrands If true, locations are mapped to their positive strand image bef...
[ "Create", "a", "list", "of", "all", "features", "that", "overlap", "the", "specified", "location", "on", "the", "specified", "sequence", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L356-L374
32,154
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java
FeatureList.hasAttribute
public boolean hasAttribute(String key) { if (featindex.containsKey(key)){ Map<String, List<FeatureI>> mappa = featindex.get(key); if (mappa!= null && mappa.size()>0)return true; return false; } for (FeatureI f : this) { if (f.hasAttribute(key)) { return true; } } return false; }
java
public boolean hasAttribute(String key) { if (featindex.containsKey(key)){ Map<String, List<FeatureI>> mappa = featindex.get(key); if (mappa!= null && mappa.size()>0)return true; return false; } for (FeatureI f : this) { if (f.hasAttribute(key)) { return true; } } return false; }
[ "public", "boolean", "hasAttribute", "(", "String", "key", ")", "{", "if", "(", "featindex", ".", "containsKey", "(", "key", ")", ")", "{", "Map", "<", "String", ",", "List", "<", "FeatureI", ">", ">", "mappa", "=", "featindex", ".", "get", "(", "key...
Check if any feature in list has the specified attribute key. @param key The attribute key to consider. @return True if at least one feature has the attribute key.
[ "Check", "if", "any", "feature", "in", "list", "has", "the", "specified", "attribute", "key", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L413-L426
32,155
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java
FeatureList.sortByStart
public FeatureList sortByStart() { FeatureI[] array = toArray(new FeatureI[1]); Arrays.sort(array, new FeatureComparator()); return new FeatureList(Arrays.asList(array)); }
java
public FeatureList sortByStart() { FeatureI[] array = toArray(new FeatureI[1]); Arrays.sort(array, new FeatureComparator()); return new FeatureList(Arrays.asList(array)); }
[ "public", "FeatureList", "sortByStart", "(", ")", "{", "FeatureI", "[", "]", "array", "=", "toArray", "(", "new", "FeatureI", "[", "1", "]", ")", ";", "Arrays", ".", "sort", "(", "array", ",", "new", "FeatureComparator", "(", ")", ")", ";", "return", ...
Create a new list that is ordered by the starting index of the features' locations. All locations must be on the same strand of the same sequence. @return An ordered list. @throws IndexOutOfBoundsException Cannot compare/sort features whose locations are on opposite strands, or whose seqnames differ.
[ "Create", "a", "new", "list", "that", "is", "ordered", "by", "the", "starting", "index", "of", "the", "features", "locations", ".", "All", "locations", "must", "be", "on", "the", "same", "strand", "of", "the", "same", "sequence", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L492-L498
32,156
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifParser.java
SimpleMMcifParser.processLine
private List<String> processLine(String line, BufferedReader buf, int fieldLength) throws IOException{ //System.out.println("XX processLine " + fieldLength + " " + line); // go through the line and process each character List<String> lineData = new ArrayList<String>(); boolean inString = false; ...
java
private List<String> processLine(String line, BufferedReader buf, int fieldLength) throws IOException{ //System.out.println("XX processLine " + fieldLength + " " + line); // go through the line and process each character List<String> lineData = new ArrayList<String>(); boolean inString = false; ...
[ "private", "List", "<", "String", ">", "processLine", "(", "String", "line", ",", "BufferedReader", "buf", ",", "int", "fieldLength", ")", "throws", "IOException", "{", "//System.out.println(\"XX processLine \" + fieldLength + \" \" + line);", "// go through the line and proc...
Get the content of a cif entry @param line @param buf @return
[ "Get", "the", "content", "of", "a", "cif", "entry" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifParser.java#L535-L599
32,157
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/BiojavaJmol.java
BiojavaJmol.jmolInClassPath
public static boolean jmolInClassPath(){ try { Class.forName(viewer); } catch (ClassNotFoundException e){ e.printStackTrace(); return false; } return true; }
java
public static boolean jmolInClassPath(){ try { Class.forName(viewer); } catch (ClassNotFoundException e){ e.printStackTrace(); return false; } return true; }
[ "public", "static", "boolean", "jmolInClassPath", "(", ")", "{", "try", "{", "Class", ".", "forName", "(", "viewer", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "return", "false", ";",...
returns true if Jmol can be found in the classpath, otherwise false. @return true/false depending if Jmol can be found
[ "returns", "true", "if", "Jmol", "can", "be", "found", "in", "the", "classpath", "otherwise", "false", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/BiojavaJmol.java#L204-L212
32,158
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java
InputStreamProvider.getInputStream
public InputStream getInputStream(String pathToFile) throws IOException { File f = new File(pathToFile); return getInputStream(f); }
java
public InputStream getInputStream(String pathToFile) throws IOException { File f = new File(pathToFile); return getInputStream(f); }
[ "public", "InputStream", "getInputStream", "(", "String", "pathToFile", ")", "throws", "IOException", "{", "File", "f", "=", "new", "File", "(", "pathToFile", ")", ";", "return", "getInputStream", "(", "f", ")", ";", "}" ]
Get an InputStream for given file path. The caller is responsible for closing the stream or otherwise a resource leak can occur. @param pathToFile the path of the file. @return an InputStream for the file located at the path. @throws IOException
[ "Get", "an", "InputStream", "for", "given", "file", "path", ".", "The", "caller", "is", "responsible", "for", "closing", "the", "stream", "or", "otherwise", "a", "resource", "leak", "can", "occur", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java#L88-L93
32,159
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java
InputStreamProvider.getMagicNumber
private int getMagicNumber(InputStream in) throws IOException { int t = in.read(); if (t < 0) throw new EOFException("Failed to read magic number"); int magic = (t & 0xff) << 8; t = in.read(); if (t < 0) throw new EOFException("Failed to read magic number"); magic += t & 0xff; return magic; }
java
private int getMagicNumber(InputStream in) throws IOException { int t = in.read(); if (t < 0) throw new EOFException("Failed to read magic number"); int magic = (t & 0xff) << 8; t = in.read(); if (t < 0) throw new EOFException("Failed to read magic number"); magic += t & 0xff; return magic; }
[ "private", "int", "getMagicNumber", "(", "InputStream", "in", ")", "throws", "IOException", "{", "int", "t", "=", "in", ".", "read", "(", ")", ";", "if", "(", "t", "<", "0", ")", "throw", "new", "EOFException", "(", "\"Failed to read magic number\"", ")", ...
open the file and read the magic number from the beginning this is used to determine the compression type @param in an input stream to read from @return the magic number @throws IOException
[ "open", "the", "file", "and", "read", "the", "magic", "number", "from", "the", "beginning", "this", "is", "used", "to", "determine", "the", "compression", "type" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java#L103-L115
32,160
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java
InputStreamProvider.getInputStream
public InputStream getInputStream(File f) throws IOException { // use the magic numbers to determine the compression type, // use file extension only as 2nd choice int magic = 0; InputStream test = getInputStreamFromFile(f); magic = getMagicNumber(test); test.close(); InputStream inputStream = nu...
java
public InputStream getInputStream(File f) throws IOException { // use the magic numbers to determine the compression type, // use file extension only as 2nd choice int magic = 0; InputStream test = getInputStreamFromFile(f); magic = getMagicNumber(test); test.close(); InputStream inputStream = nu...
[ "public", "InputStream", "getInputStream", "(", "File", "f", ")", "throws", "IOException", "{", "// use the magic numbers to determine the compression type,", "// use file extension only as 2nd choice", "int", "magic", "=", "0", ";", "InputStream", "test", "=", "getInputStrea...
Get an InputStream for the file. The caller is responsible for closing the stream or otherwise a resource leak can occur. @param f a File @return an InputStream for the file @throws IOException
[ "Get", "an", "InputStream", "for", "the", "file", ".", "The", "caller", "is", "responsible", "for", "closing", "the", "stream", "or", "otherwise", "a", "resource", "leak", "can", "occur", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java#L156-L232
32,161
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java
InputStreamProvider.getInputStreamFromFile
private InputStream getInputStreamFromFile(File f) throws FileNotFoundException{ InputStream stream = null; if ( cacheRawFiles ){ stream = FlatFileCache.getInputStream(f.getAbsolutePath()); if ( stream == null){ FlatFileCache.addToCache(f.getAbsolutePath(),f); stream = FlatFileCache.getInputStream...
java
private InputStream getInputStreamFromFile(File f) throws FileNotFoundException{ InputStream stream = null; if ( cacheRawFiles ){ stream = FlatFileCache.getInputStream(f.getAbsolutePath()); if ( stream == null){ FlatFileCache.addToCache(f.getAbsolutePath(),f); stream = FlatFileCache.getInputStream...
[ "private", "InputStream", "getInputStreamFromFile", "(", "File", "f", ")", "throws", "FileNotFoundException", "{", "InputStream", "stream", "=", "null", ";", "if", "(", "cacheRawFiles", ")", "{", "stream", "=", "FlatFileCache", ".", "getInputStream", "(", "f", "...
Wrapper for new FileInputStream. if System.property biojava.cache.files is set, will try to load files from memory cache. @param f @return @throws FileNotFoundException
[ "Wrapper", "for", "new", "FileInputStream", ".", "if", "System", ".", "property", "biojava", ".", "cache", ".", "files", "is", "set", "will", "try", "to", "load", "files", "from", "memory", "cache", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/InputStreamProvider.java#L242-L260
32,162
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/model/AFPChain.java
AFPChain.getNrEQR
public int getNrEQR(){ if (myResultsEQR < 0){ if ( optLen == null) { myResultsEQR = 0; return 0; } int nrEqr = 0; for(int bk = 0; bk < blockNum; bk ++) { for ( int i=0;i< optLen[bk];i++){ nrEqr++; } } myResultsEQR = nrEqr; } return myResultsEQR; }
java
public int getNrEQR(){ if (myResultsEQR < 0){ if ( optLen == null) { myResultsEQR = 0; return 0; } int nrEqr = 0; for(int bk = 0; bk < blockNum; bk ++) { for ( int i=0;i< optLen[bk];i++){ nrEqr++; } } myResultsEQR = nrEqr; } return myResultsEQR; }
[ "public", "int", "getNrEQR", "(", ")", "{", "if", "(", "myResultsEQR", "<", "0", ")", "{", "if", "(", "optLen", "==", "null", ")", "{", "myResultsEQR", "=", "0", ";", "return", "0", ";", "}", "int", "nrEqr", "=", "0", ";", "for", "(", "int", "b...
Get the number of structurally equivalent residues @return nr of EQR
[ "Get", "the", "number", "of", "structurally", "equivalent", "residues" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/model/AFPChain.java#L302-L320
32,163
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/model/AFPChain.java
AFPChain.getCoverage1
public int getCoverage1(){ if ( myResultsSimilarity1 < 0 ) { int distance = ca1Length + ca2Length - 2 * getNrEQR(); int similarity = (ca1Length + ca2Length - distance ) / 2; myResultsSimilarity1 = Math.round(similarity /(float) ca1Length * 100); } return myResultsSimilarity1; }
java
public int getCoverage1(){ if ( myResultsSimilarity1 < 0 ) { int distance = ca1Length + ca2Length - 2 * getNrEQR(); int similarity = (ca1Length + ca2Length - distance ) / 2; myResultsSimilarity1 = Math.round(similarity /(float) ca1Length * 100); } return myResultsSimilarity1; }
[ "public", "int", "getCoverage1", "(", ")", "{", "if", "(", "myResultsSimilarity1", "<", "0", ")", "{", "int", "distance", "=", "ca1Length", "+", "ca2Length", "-", "2", "*", "getNrEQR", "(", ")", ";", "int", "similarity", "=", "(", "ca1Length", "+", "ca...
Get the coverage of protein 1 with the alignment @return percentage of coverage, between 0 and 100.
[ "Get", "the", "coverage", "of", "protein", "1", "with", "the", "alignment" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/model/AFPChain.java#L326-L335
32,164
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/model/AFPChain.java
AFPChain.getCoverage2
public int getCoverage2(){ if ( myResultsSimilarity2 < 0 ) { int distance = ca1Length + ca2Length - 2 * getNrEQR(); int similarity = (ca1Length + ca2Length - distance ) / 2; myResultsSimilarity2 = Math.round(similarity /(float) ca2Length * 100); } return myResultsSimilarity2; }
java
public int getCoverage2(){ if ( myResultsSimilarity2 < 0 ) { int distance = ca1Length + ca2Length - 2 * getNrEQR(); int similarity = (ca1Length + ca2Length - distance ) / 2; myResultsSimilarity2 = Math.round(similarity /(float) ca2Length * 100); } return myResultsSimilarity2; }
[ "public", "int", "getCoverage2", "(", ")", "{", "if", "(", "myResultsSimilarity2", "<", "0", ")", "{", "int", "distance", "=", "ca1Length", "+", "ca2Length", "-", "2", "*", "getNrEQR", "(", ")", ";", "int", "similarity", "=", "(", "ca1Length", "+", "ca...
Get the coverage of protein 2 with the alignment @return percentage of coverage, between 0 and 100.
[ "Get", "the", "coverage", "of", "protein", "2", "with", "the", "alignment" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/model/AFPChain.java#L341-L352
32,165
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java
PDBStatus.getStatus
public static Status getStatus(String pdbId) { Status[] statuses = getStatus(new String[] {pdbId}); if(statuses != null) { assert(statuses.length == 1); return statuses[0]; } else { return null; } }
java
public static Status getStatus(String pdbId) { Status[] statuses = getStatus(new String[] {pdbId}); if(statuses != null) { assert(statuses.length == 1); return statuses[0]; } else { return null; } }
[ "public", "static", "Status", "getStatus", "(", "String", "pdbId", ")", "{", "Status", "[", "]", "statuses", "=", "getStatus", "(", "new", "String", "[", "]", "{", "pdbId", "}", ")", ";", "if", "(", "statuses", "!=", "null", ")", "{", "assert", "(", ...
Get the status of the PDB in question. @param pdbId @return The status, or null if an error occurred.
[ "Get", "the", "status", "of", "the", "PDB", "in", "question", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java#L162-L170
32,166
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java
PDBStatus.getStatus
public static Status[] getStatus(String[] pdbIds) { Status[] statuses = new Status[pdbIds.length]; List<Map<String,String>> attrList = getStatusIdRecords(pdbIds); //Expect a single record if(attrList == null || attrList.size() != pdbIds.length) { logger.error("Error getting Status for {} from the PDB websit...
java
public static Status[] getStatus(String[] pdbIds) { Status[] statuses = new Status[pdbIds.length]; List<Map<String,String>> attrList = getStatusIdRecords(pdbIds); //Expect a single record if(attrList == null || attrList.size() != pdbIds.length) { logger.error("Error getting Status for {} from the PDB websit...
[ "public", "static", "Status", "[", "]", "getStatus", "(", "String", "[", "]", "pdbIds", ")", "{", "Status", "[", "]", "statuses", "=", "new", "Status", "[", "pdbIds", ".", "length", "]", ";", "List", "<", "Map", "<", "String", ",", "String", ">", "...
Get the status of the a collection of PDBs in question in a single query. @see #getStatus(String) @param pdbIds @return The status array, or null if an error occurred.
[ "Get", "the", "status", "of", "the", "a", "collection", "of", "PDBs", "in", "question", "in", "a", "single", "query", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java#L179-L227
32,167
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java
PDBStatus.mergeReversed
private static void mergeReversed(List<String> merged, final List<String> other) { if(other.isEmpty()) return; if(merged.isEmpty()) { merged.addAll(other); return; } ListIterator<String> m = merged.listIterator(); ListIterator<String> o = other.listIterator(); ...
java
private static void mergeReversed(List<String> merged, final List<String> other) { if(other.isEmpty()) return; if(merged.isEmpty()) { merged.addAll(other); return; } ListIterator<String> m = merged.listIterator(); ListIterator<String> o = other.listIterator(); ...
[ "private", "static", "void", "mergeReversed", "(", "List", "<", "String", ">", "merged", ",", "final", "List", "<", "String", ">", "other", ")", "{", "if", "(", "other", ".", "isEmpty", "(", ")", ")", "return", ";", "if", "(", "merged", ".", "isEmpty...
Takes two reverse sorted lists of strings and merges the second into the first. Duplicates are removed. @param merged A reverse sorted list. Modified by this method to contain the contents of other. @param other A reverse sorted list. Not modified.
[ "Takes", "two", "reverse", "sorted", "lists", "of", "strings", "and", "merges", "the", "second", "into", "the", "first", ".", "Duplicates", "are", "removed", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java#L406-L450
32,168
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java
PDBStatus.getReplaces
public static List<String> getReplaces(String newPdbId, boolean recurse) { List<Map<String,String>> attrList = getStatusIdRecords(new String[] {newPdbId}); //Expect a single record if(attrList == null || attrList.size() != 1) { //TODO Is it possible to have multiple record per ID? // They seem to be combine...
java
public static List<String> getReplaces(String newPdbId, boolean recurse) { List<Map<String,String>> attrList = getStatusIdRecords(new String[] {newPdbId}); //Expect a single record if(attrList == null || attrList.size() != 1) { //TODO Is it possible to have multiple record per ID? // They seem to be combine...
[ "public", "static", "List", "<", "String", ">", "getReplaces", "(", "String", "newPdbId", ",", "boolean", "recurse", ")", "{", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "attrList", "=", "getStatusIdRecords", "(", "new", "String", "[", "...
Get the ID of the protein which was made obsolete by newPdbId. @param newPdbId PDB ID of the newer structure @param recurse If true, return all ancestors of newPdbId. Otherwise, just go one step newer than oldPdbId. @return A (possibly empty) list of ID(s) of the ancestor(s) of newPdbId, or <tt>null</tt> if an error o...
[ "Get", "the", "ID", "of", "the", "protein", "which", "was", "made", "obsolete", "by", "newPdbId", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java#L462-L504
32,169
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java
PDBStatus.getStatusIdRecords
private static List<Map<String, String>> getStatusIdRecords(String[] pdbIDs) { List<Map<String,String>> result = new ArrayList<Map<String,String>>(pdbIDs.length); String serverName = System.getProperty(PDB_SERVER_PROPERTY); if ( serverName == null) serverName = DEFAULT_PDB_SERVER; else logger.info(Stri...
java
private static List<Map<String, String>> getStatusIdRecords(String[] pdbIDs) { List<Map<String,String>> result = new ArrayList<Map<String,String>>(pdbIDs.length); String serverName = System.getProperty(PDB_SERVER_PROPERTY); if ( serverName == null) serverName = DEFAULT_PDB_SERVER; else logger.info(Stri...
[ "private", "static", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "getStatusIdRecords", "(", "String", "[", "]", "pdbIDs", ")", "{", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "result", "=", "new", "ArrayList", "<", "M...
Fetches the status of one or more pdbIDs from the server. <p>Returns the results as a list of Attributes. Each attribute should contain "structureId" and "status" attributes, and possibly more. <p>Example:</br> <tt>http://www.rcsb.org/pdb/rest/idStatus?structureID=1HHB,4HHB</tt></br> <pre>&lt;idStatus&gt; &lt;record ...
[ "Fetches", "the", "status", "of", "one", "or", "more", "pdbIDs", "from", "the", "server", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java#L537-L613
32,170
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java
PDBStatus.getCurrentPDBIds
public static SortedSet<String> getCurrentPDBIds() throws IOException { SortedSet<String> allPDBs = new TreeSet<String>(); String serverName = System.getProperty(PDB_SERVER_PROPERTY); if ( serverName == null) serverName = DEFAULT_PDB_SERVER; else logger.info(String.format("Got System property %s=%s",PDB...
java
public static SortedSet<String> getCurrentPDBIds() throws IOException { SortedSet<String> allPDBs = new TreeSet<String>(); String serverName = System.getProperty(PDB_SERVER_PROPERTY); if ( serverName == null) serverName = DEFAULT_PDB_SERVER; else logger.info(String.format("Got System property %s=%s",PDB...
[ "public", "static", "SortedSet", "<", "String", ">", "getCurrentPDBIds", "(", ")", "throws", "IOException", "{", "SortedSet", "<", "String", ">", "allPDBs", "=", "new", "TreeSet", "<", "String", ">", "(", ")", ";", "String", "serverName", "=", "System", "....
Returns a list of current PDB IDs @return a list of PDB IDs, or null if a problem occurred
[ "Returns", "a", "list", "of", "current", "PDB", "IDs" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBStatus.java#L674-L706
32,171
biojava/biojava
biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/FastaSequence.java
FastaSequence.getFormatedSequence
public String getFormatedSequence(final int width) { if (sequence == null) { return ""; } assert width >= 0 : "Wrong width parameter "; final StringBuilder sb = new StringBuilder(sequence); int nchunks = sequence.length() / width; // add up inserted new line chars nchunks = (nchunks + sequence.length()) / wi...
java
public String getFormatedSequence(final int width) { if (sequence == null) { return ""; } assert width >= 0 : "Wrong width parameter "; final StringBuilder sb = new StringBuilder(sequence); int nchunks = sequence.length() / width; // add up inserted new line chars nchunks = (nchunks + sequence.length()) / wi...
[ "public", "String", "getFormatedSequence", "(", "final", "int", "width", ")", "{", "if", "(", "sequence", "==", "null", ")", "{", "return", "\"\"", ";", "}", "assert", "width", ">=", "0", ":", "\"Wrong width parameter \"", ";", "final", "StringBuilder", "sb"...
Format sequence per width letter in one string. Without spaces. @return multiple line formated sequence, one line width letters length
[ "Format", "sequence", "per", "width", "letter", "in", "one", "string", ".", "Without", "spaces", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/FastaSequence.java#L124-L148
32,172
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/PermutationGroup.java
PermutationGroup.completeGroup
public void completeGroup() { // Copy initial set to allow permutations to grow List<List<Integer>> gens = new ArrayList<List<Integer>>(permutations); // Keep HashSet version of permutations for fast lookup. Set<List<Integer>> known = new HashSet<List<Integer>>(permutations); //breadth-first search through th...
java
public void completeGroup() { // Copy initial set to allow permutations to grow List<List<Integer>> gens = new ArrayList<List<Integer>>(permutations); // Keep HashSet version of permutations for fast lookup. Set<List<Integer>> known = new HashSet<List<Integer>>(permutations); //breadth-first search through th...
[ "public", "void", "completeGroup", "(", ")", "{", "// Copy initial set to allow permutations to grow", "List", "<", "List", "<", "Integer", ">>", "gens", "=", "new", "ArrayList", "<", "List", "<", "Integer", ">", ">", "(", "permutations", ")", ";", "// Keep Hash...
Starts with an incomplete set of group generators in `permutations` and expands it to include all possible combinations. Ways to complete group: - combinations of permutations pi x pj - combinations with itself p^k
[ "Starts", "with", "an", "incomplete", "set", "of", "group", "generators", "in", "permutations", "and", "expands", "it", "to", "include", "all", "possible", "combinations", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/PermutationGroup.java#L61-L83
32,173
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/alignment/GuideTree.java
GuideTree.getDistanceMatrix
public double[][] getDistanceMatrix() { double[][] matrix = new double[distances.getSize()][distances.getSize()]; for (int i = 0; i < matrix.length; i++) { for (int j = i+1; j < matrix.length; j++) { matrix[i][j] = matrix[j][i] = distances.getValue(i, j); } } return matrix; }
java
public double[][] getDistanceMatrix() { double[][] matrix = new double[distances.getSize()][distances.getSize()]; for (int i = 0; i < matrix.length; i++) { for (int j = i+1; j < matrix.length; j++) { matrix[i][j] = matrix[j][i] = distances.getValue(i, j); } } return matrix; }
[ "public", "double", "[", "]", "[", "]", "getDistanceMatrix", "(", ")", "{", "double", "[", "]", "[", "]", "matrix", "=", "new", "double", "[", "distances", ".", "getSize", "(", ")", "]", "[", "distances", ".", "getSize", "(", ")", "]", ";", "for", ...
Returns the distance matrix used to construct this guide tree. The scores have been normalized. @return the distance matrix used to construct this guide tree
[ "Returns", "the", "distance", "matrix", "used", "to", "construct", "this", "guide", "tree", ".", "The", "scores", "have", "been", "normalized", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/GuideTree.java#L107-L115
32,174
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/alignment/GuideTree.java
GuideTree.getScoreMatrix
public double[][] getScoreMatrix() { double[][] matrix = new double[sequences.size()][sequences.size()]; for (int i = 0, n = 0; i < matrix.length; i++) { matrix[i][i] = scorers.get(i).getMaxScore(); for (int j = i+1; j < matrix.length; j++) { matrix[i][j] = matrix[j][i] = scorers.get(n++).getScore(); }...
java
public double[][] getScoreMatrix() { double[][] matrix = new double[sequences.size()][sequences.size()]; for (int i = 0, n = 0; i < matrix.length; i++) { matrix[i][i] = scorers.get(i).getMaxScore(); for (int j = i+1; j < matrix.length; j++) { matrix[i][j] = matrix[j][i] = scorers.get(n++).getScore(); }...
[ "public", "double", "[", "]", "[", "]", "getScoreMatrix", "(", ")", "{", "double", "[", "]", "[", "]", "matrix", "=", "new", "double", "[", "sequences", ".", "size", "(", ")", "]", "[", "sequences", ".", "size", "(", ")", "]", ";", "for", "(", ...
Returns the similarity matrix used to construct this guide tree. The scores have not been normalized. @return the similarity matrix used to construct this guide tree
[ "Returns", "the", "similarity", "matrix", "used", "to", "construct", "this", "guide", "tree", ".", "The", "scores", "have", "not", "been", "normalized", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/GuideTree.java#L131-L140
32,175
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java
BiologicalAssemblyBuilder.orderTransformationsByChainId
private void orderTransformationsByChainId(Structure asymUnit, List<BiologicalAssemblyTransformation> transformations) { final List<String> chainIds = getChainIds(asymUnit); Collections.sort(transformations, new Comparator<BiologicalAssemblyTransformation>() { @Override public int compare(BiologicalAssemblyTr...
java
private void orderTransformationsByChainId(Structure asymUnit, List<BiologicalAssemblyTransformation> transformations) { final List<String> chainIds = getChainIds(asymUnit); Collections.sort(transformations, new Comparator<BiologicalAssemblyTransformation>() { @Override public int compare(BiologicalAssemblyTr...
[ "private", "void", "orderTransformationsByChainId", "(", "Structure", "asymUnit", ",", "List", "<", "BiologicalAssemblyTransformation", ">", "transformations", ")", "{", "final", "List", "<", "String", ">", "chainIds", "=", "getChainIds", "(", "asymUnit", ")", ";", ...
Orders model transformations by chain ids in the same order as in the asymmetric unit @param asymUnit @param transformations
[ "Orders", "model", "transformations", "by", "chain", "ids", "in", "the", "same", "order", "as", "in", "the", "asymmetric", "unit" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java#L165-L178
32,176
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java
BiologicalAssemblyBuilder.getChainIds
private List<String> getChainIds(Structure asymUnit) { List<String> chainIds = new ArrayList<String>(); for ( Chain c : asymUnit.getChains()){ String intChainID = c.getId(); chainIds.add(intChainID); } return chainIds; }
java
private List<String> getChainIds(Structure asymUnit) { List<String> chainIds = new ArrayList<String>(); for ( Chain c : asymUnit.getChains()){ String intChainID = c.getId(); chainIds.add(intChainID); } return chainIds; }
[ "private", "List", "<", "String", ">", "getChainIds", "(", "Structure", "asymUnit", ")", "{", "List", "<", "String", ">", "chainIds", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "Chain", "c", ":", "asymUnit", ".", "getChains...
Returns a list of chain ids in the order they are specified in the ATOM records in the asymmetric unit @param asymUnit @return
[ "Returns", "a", "list", "of", "chain", "ids", "in", "the", "order", "they", "are", "specified", "in", "the", "ATOM", "records", "in", "the", "asymmetric", "unit" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java#L186-L193
32,177
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java
BiologicalAssemblyBuilder.addChainMultiModel
private void addChainMultiModel(Structure s, Chain newChain, String transformId) { // multi-model bioassembly if ( modelIndex.size() == 0) modelIndex.add("PLACEHOLDER FOR ASYM UNIT"); int modelCount = modelIndex.indexOf(transformId); if ( modelCount == -1) { modelIndex.add(transformId); modelCount ...
java
private void addChainMultiModel(Structure s, Chain newChain, String transformId) { // multi-model bioassembly if ( modelIndex.size() == 0) modelIndex.add("PLACEHOLDER FOR ASYM UNIT"); int modelCount = modelIndex.indexOf(transformId); if ( modelCount == -1) { modelIndex.add(transformId); modelCount ...
[ "private", "void", "addChainMultiModel", "(", "Structure", "s", ",", "Chain", "newChain", ",", "String", "transformId", ")", "{", "// multi-model bioassembly", "if", "(", "modelIndex", ".", "size", "(", ")", "==", "0", ")", "modelIndex", ".", "add", "(", "\"...
Adds a chain to the given structure to form a biological assembly, adding the symmetry expanded chains as new models per transformId. @param s @param newChain @param transformId
[ "Adds", "a", "chain", "to", "the", "given", "structure", "to", "form", "a", "biological", "assembly", "adding", "the", "symmetry", "expanded", "chains", "as", "new", "models", "per", "transformId", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java#L202-L225
32,178
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java
BiologicalAssemblyBuilder.getBioUnitTransformationList
public ArrayList<BiologicalAssemblyTransformation> getBioUnitTransformationList(PdbxStructAssembly psa, List<PdbxStructAssemblyGen> psags, List<PdbxStructOperList> operators) { init(); // first we populate the list of all operators from pdbx_struct_oper_list so that we can then // get them from getBioUnitTransfo...
java
public ArrayList<BiologicalAssemblyTransformation> getBioUnitTransformationList(PdbxStructAssembly psa, List<PdbxStructAssemblyGen> psags, List<PdbxStructOperList> operators) { init(); // first we populate the list of all operators from pdbx_struct_oper_list so that we can then // get them from getBioUnitTransfo...
[ "public", "ArrayList", "<", "BiologicalAssemblyTransformation", ">", "getBioUnitTransformationList", "(", "PdbxStructAssembly", "psa", ",", "List", "<", "PdbxStructAssemblyGen", ">", "psags", ",", "List", "<", "PdbxStructOperList", ">", "operators", ")", "{", "init", ...
Returns a list of transformation matrices for the generation of a macromolecular assembly for the specified assembly Id. @param psa @param psags @param operators @return list of transformation matrices to generate macromolecular assembly
[ "Returns", "a", "list", "of", "transformation", "matrices", "for", "the", "generation", "of", "a", "macromolecular", "assembly", "for", "the", "specified", "assembly", "Id", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java#L250-L290
32,179
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getNrAtoms
public static final int getNrAtoms(Structure s) { int nrAtoms = 0; Iterator<Group> iter = new GroupIterator(s); while (iter.hasNext()) { Group g = iter.next(); nrAtoms += g.size(); } return nrAtoms; }
java
public static final int getNrAtoms(Structure s) { int nrAtoms = 0; Iterator<Group> iter = new GroupIterator(s); while (iter.hasNext()) { Group g = iter.next(); nrAtoms += g.size(); } return nrAtoms; }
[ "public", "static", "final", "int", "getNrAtoms", "(", "Structure", "s", ")", "{", "int", "nrAtoms", "=", "0", ";", "Iterator", "<", "Group", ">", "iter", "=", "new", "GroupIterator", "(", "s", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")"...
Count how many Atoms are contained within a Structure object. @param s the structure object @return the number of Atoms in this Structure
[ "Count", "how", "many", "Atoms", "are", "contained", "within", "a", "Structure", "object", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L268-L280
32,180
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getNrGroups
public static final int getNrGroups(Structure s) { int nrGroups = 0; List<Chain> chains = s.getChains(0); for (Chain c : chains) { nrGroups += c.getAtomLength(); } return nrGroups; }
java
public static final int getNrGroups(Structure s) { int nrGroups = 0; List<Chain> chains = s.getChains(0); for (Chain c : chains) { nrGroups += c.getAtomLength(); } return nrGroups; }
[ "public", "static", "final", "int", "getNrGroups", "(", "Structure", "s", ")", "{", "int", "nrGroups", "=", "0", ";", "List", "<", "Chain", ">", "chains", "=", "s", ".", "getChains", "(", "0", ")", ";", "for", "(", "Chain", "c", ":", "chains", ")",...
Count how many groups are contained within a structure object. @param s the structure object @return the number of groups in the structure
[ "Count", "how", "many", "groups", "are", "contained", "within", "a", "structure", "object", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L289-L297
32,181
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getLigandsByProximity
public static List<Group> getLigandsByProximity(Collection<Group> target, Atom[] query, double cutoff) { // Geometric hashing of the reduced structure Grid grid = new Grid(cutoff); grid.addAtoms(query); List<Group> ligands = new ArrayList<>(); for(Group g :target ) { // don't worry about waters if(g.is...
java
public static List<Group> getLigandsByProximity(Collection<Group> target, Atom[] query, double cutoff) { // Geometric hashing of the reduced structure Grid grid = new Grid(cutoff); grid.addAtoms(query); List<Group> ligands = new ArrayList<>(); for(Group g :target ) { // don't worry about waters if(g.is...
[ "public", "static", "List", "<", "Group", ">", "getLigandsByProximity", "(", "Collection", "<", "Group", ">", "target", ",", "Atom", "[", "]", "query", ",", "double", "cutoff", ")", "{", "// Geometric hashing of the reduced structure", "Grid", "grid", "=", "new"...
Finds all ligand groups from the target which fall within the cutoff distance of some atom from the query set. @param target Set of groups including the ligands @param query Atom selection @param cutoff Distance from query atoms to consider, in angstroms @return All groups from the target with at least one atom within...
[ "Finds", "all", "ligand", "groups", "from", "the", "target", "which", "fall", "within", "the", "cutoff", "distance", "of", "some", "atom", "from", "the", "query", "set", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L476-L504
32,182
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.addGroupToStructure
public static Chain addGroupToStructure(Structure s, Group g, int model, Chain chainGuess, boolean clone ) { synchronized(s) { // Find or create the chain String chainId = g.getChainId(); assert !chainId.isEmpty(); Chain chain; if(chainGuess != null && chainGuess.getId() == chainId) { // previously...
java
public static Chain addGroupToStructure(Structure s, Group g, int model, Chain chainGuess, boolean clone ) { synchronized(s) { // Find or create the chain String chainId = g.getChainId(); assert !chainId.isEmpty(); Chain chain; if(chainGuess != null && chainGuess.getId() == chainId) { // previously...
[ "public", "static", "Chain", "addGroupToStructure", "(", "Structure", "s", ",", "Group", "g", ",", "int", "model", ",", "Chain", "chainGuess", ",", "boolean", "clone", ")", "{", "synchronized", "(", "s", ")", "{", "// Find or create the chain", "String", "chai...
Adds a particular group to a structure. A new chain will be created if necessary. <p>When adding multiple groups, pass the return value of one call as the chainGuess parameter of the next call for efficiency. <pre> Chain guess = null; for(Group g : groups) { guess = addGroupToStructure(s, g, guess ); } </pre> @param s...
[ "Adds", "a", "particular", "group", "to", "a", "structure", ".", "A", "new", "chain", "will", "be", "created", "if", "necessary", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L525-L577
32,183
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.addGroupsToStructure
public static void addGroupsToStructure(Structure s, Collection<Group> groups, int model, boolean clone) { Chain chainGuess = null; for(Group g : groups) { chainGuess = addGroupToStructure(s, g, model, chainGuess, clone); } }
java
public static void addGroupsToStructure(Structure s, Collection<Group> groups, int model, boolean clone) { Chain chainGuess = null; for(Group g : groups) { chainGuess = addGroupToStructure(s, g, model, chainGuess, clone); } }
[ "public", "static", "void", "addGroupsToStructure", "(", "Structure", "s", ",", "Collection", "<", "Group", ">", "groups", ",", "int", "model", ",", "boolean", "clone", ")", "{", "Chain", "chainGuess", "=", "null", ";", "for", "(", "Group", "g", ":", "gr...
Add a list of groups to a new structure. Chains will be automatically created in the new structure as needed. @param s structure to receive the group @param g group to add @param clone Indicates whether the input groups should be cloned before being added to the new chain
[ "Add", "a", "list", "of", "groups", "to", "a", "new", "structure", ".", "Chains", "will", "be", "automatically", "created", "in", "the", "new", "structure", "as", "needed", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L587-L592
32,184
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getAllGroupsFromSubset
public static Set<Group> getAllGroupsFromSubset(Atom[] atoms,GroupType types) { // Get the full structure Structure s = null; if (atoms.length > 0) { Group g = atoms[0].getGroup(); if (g != null) { Chain c = g.getChain(); if (c != null) { s = c.getStructure(); } } } // Collect all gr...
java
public static Set<Group> getAllGroupsFromSubset(Atom[] atoms,GroupType types) { // Get the full structure Structure s = null; if (atoms.length > 0) { Group g = atoms[0].getGroup(); if (g != null) { Chain c = g.getChain(); if (c != null) { s = c.getStructure(); } } } // Collect all gr...
[ "public", "static", "Set", "<", "Group", ">", "getAllGroupsFromSubset", "(", "Atom", "[", "]", "atoms", ",", "GroupType", "types", ")", "{", "// Get the full structure", "Structure", "s", "=", "null", ";", "if", "(", "atoms", ".", "length", ">", "0", ")", ...
Expand a set of atoms into all groups from the same structure. If the structure is set, only the first atom is used (assuming all atoms come from the same original structure). If the atoms aren't linked to a structure (for instance, for cloned atoms), searches all chains of all atoms for groups. @param atoms Sample of...
[ "Expand", "a", "set", "of", "atoms", "into", "all", "groups", "from", "the", "same", "structure", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L619-L662
32,185
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getAllNonHAtomArray
public static final Atom[] getAllNonHAtomArray(Structure s, boolean hetAtoms) { AtomIterator iter = new AtomIterator(s); return getAllNonHAtomArray(s, hetAtoms, iter); }
java
public static final Atom[] getAllNonHAtomArray(Structure s, boolean hetAtoms) { AtomIterator iter = new AtomIterator(s); return getAllNonHAtomArray(s, hetAtoms, iter); }
[ "public", "static", "final", "Atom", "[", "]", "getAllNonHAtomArray", "(", "Structure", "s", ",", "boolean", "hetAtoms", ")", "{", "AtomIterator", "iter", "=", "new", "AtomIterator", "(", "s", ")", ";", "return", "getAllNonHAtomArray", "(", "s", ",", "hetAto...
Returns and array of all non-Hydrogen atoms in the given Structure, optionally including HET atoms or not. Waters are not included. @param s @param hetAtoms if true HET atoms are included in array, if false they are not @return
[ "Returns", "and", "array", "of", "all", "non", "-", "Hydrogen", "atoms", "in", "the", "given", "Structure", "optionally", "including", "HET", "atoms", "or", "not", ".", "Waters", "are", "not", "included", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L674-L677
32,186
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getAllNonHAtomArray
public static final Atom[] getAllNonHAtomArray(Chain c, boolean hetAtoms) { List<Atom> atoms = new ArrayList<Atom>(); for (Group g : c.getAtomGroups()) { if (g.isWater()) continue; for (Atom a : g.getAtoms()) { if (a.getElement() == Element.H) continue; if (!hetAtoms && g.getType().equals(...
java
public static final Atom[] getAllNonHAtomArray(Chain c, boolean hetAtoms) { List<Atom> atoms = new ArrayList<Atom>(); for (Group g : c.getAtomGroups()) { if (g.isWater()) continue; for (Atom a : g.getAtoms()) { if (a.getElement() == Element.H) continue; if (!hetAtoms && g.getType().equals(...
[ "public", "static", "final", "Atom", "[", "]", "getAllNonHAtomArray", "(", "Chain", "c", ",", "boolean", "hetAtoms", ")", "{", "List", "<", "Atom", ">", "atoms", "=", "new", "ArrayList", "<", "Atom", ">", "(", ")", ";", "for", "(", "Group", "g", ":",...
Returns and array of all non-Hydrogen atoms in the given Chain, optionally including HET atoms or not Waters are not included. @param c @param hetAtoms if true HET atoms are included in array, if false they are not @return
[ "Returns", "and", "array", "of", "all", "non", "-", "Hydrogen", "atoms", "in", "the", "given", "Chain", "optionally", "including", "HET", "atoms", "or", "not", "Waters", "are", "not", "included", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L722-L740
32,187
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.extractAtoms
private static void extractAtoms(String[] atomNames, List<Chain> chains, List<Atom> atoms) { for (Chain c : chains) { for (Group g : c.getAtomGroups()) { // a temp container for the atoms of this group List<Atom> thisGroupAtoms = new ArrayList<Atom>(); // flag to check if this group contains all ...
java
private static void extractAtoms(String[] atomNames, List<Chain> chains, List<Atom> atoms) { for (Chain c : chains) { for (Group g : c.getAtomGroups()) { // a temp container for the atoms of this group List<Atom> thisGroupAtoms = new ArrayList<Atom>(); // flag to check if this group contains all ...
[ "private", "static", "void", "extractAtoms", "(", "String", "[", "]", "atomNames", ",", "List", "<", "Chain", ">", "chains", ",", "List", "<", "Atom", ">", "atoms", ")", "{", "for", "(", "Chain", "c", ":", "chains", ")", "{", "for", "(", "Group", "...
Adds to the given atoms list, all atoms of groups that contained all requested atomNames, i.e. if a group does not contain all of the requested atom names, its atoms won't be added. @param atomNames @param chains @param atoms
[ "Adds", "to", "the", "given", "atoms", "list", "all", "atoms", "of", "groups", "that", "contained", "all", "requested", "atomNames", "i", ".", "e", ".", "if", "a", "group", "does", "not", "contain", "all", "of", "the", "requested", "atom", "names", "its"...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L780-L810
32,188
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getAtomArray
public static final Atom[] getAtomArray(Chain c, String[] atomNames) { List<Atom> atoms = new ArrayList<Atom>(); for (Group g : c.getAtomGroups()) { // a temp container for the atoms of this group List<Atom> thisGroupAtoms = new ArrayList<Atom>(); // flag to check if this group contains all the requeste...
java
public static final Atom[] getAtomArray(Chain c, String[] atomNames) { List<Atom> atoms = new ArrayList<Atom>(); for (Group g : c.getAtomGroups()) { // a temp container for the atoms of this group List<Atom> thisGroupAtoms = new ArrayList<Atom>(); // flag to check if this group contains all the requeste...
[ "public", "static", "final", "Atom", "[", "]", "getAtomArray", "(", "Chain", "c", ",", "String", "[", "]", "atomNames", ")", "{", "List", "<", "Atom", ">", "atoms", "=", "new", "ArrayList", "<", "Atom", ">", "(", ")", ";", "for", "(", "Group", "g",...
Returns an array of the requested Atoms from the Chain object. Iterates over all groups and checks if the requested atoms are in this group, no matter if this is a AminoAcid or Hetatom group. If the group does not contain all requested atoms then no atoms are added for that group. @param c the Chain to get the atoms f...
[ "Returns", "an", "array", "of", "the", "requested", "Atoms", "from", "the", "Chain", "object", ".", "Iterates", "over", "all", "groups", "and", "checks", "if", "the", "requested", "atoms", "are", "in", "this", "group", "no", "matter", "if", "this", "is", ...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L825-L859
32,189
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.cloneAtomArray
public static final Atom[] cloneAtomArray(Atom[] ca) { Atom[] newCA = new Atom[ca.length]; List<Chain> model = new ArrayList<Chain>(); int apos = -1; for (Atom a : ca) { apos++; Group parentG = a.getGroup(); Chain parentC = parentG.getChain(); Chain newChain = null; for (Chain c : model) { ...
java
public static final Atom[] cloneAtomArray(Atom[] ca) { Atom[] newCA = new Atom[ca.length]; List<Chain> model = new ArrayList<Chain>(); int apos = -1; for (Atom a : ca) { apos++; Group parentG = a.getGroup(); Chain parentC = parentG.getChain(); Chain newChain = null; for (Chain c : model) { ...
[ "public", "static", "final", "Atom", "[", "]", "cloneAtomArray", "(", "Atom", "[", "]", "ca", ")", "{", "Atom", "[", "]", "newCA", "=", "new", "Atom", "[", "ca", ".", "length", "]", ";", "List", "<", "Chain", ">", "model", "=", "new", "ArrayList", ...
Provides an equivalent copy of Atoms in a new array. Clones everything, starting with parent groups and chains. The chain will only contain groups that are part of the input array. @param ca array of representative atoms, e.g. CA atoms @return Atom array @since Biojava 4.1.0
[ "Provides", "an", "equivalent", "copy", "of", "Atoms", "in", "a", "new", "array", ".", "Clones", "everything", "starting", "with", "parent", "groups", "and", "chains", ".", "The", "chain", "will", "only", "contain", "groups", "that", "are", "part", "of", "...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L933-L970
32,190
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.cloneGroups
public static Group[] cloneGroups(Atom[] ca) { Group[] newGroup = new Group[ca.length]; List<Chain> model = new ArrayList<Chain>(); int apos = -1; for (Atom a : ca) { apos++; Group parentG = a.getGroup(); Chain parentC = parentG.getChain(); Chain newChain = null; for (Chain c : model) { if ...
java
public static Group[] cloneGroups(Atom[] ca) { Group[] newGroup = new Group[ca.length]; List<Chain> model = new ArrayList<Chain>(); int apos = -1; for (Atom a : ca) { apos++; Group parentG = a.getGroup(); Chain parentC = parentG.getChain(); Chain newChain = null; for (Chain c : model) { if ...
[ "public", "static", "Group", "[", "]", "cloneGroups", "(", "Atom", "[", "]", "ca", ")", "{", "Group", "[", "]", "newGroup", "=", "new", "Group", "[", "ca", ".", "length", "]", ";", "List", "<", "Chain", ">", "model", "=", "new", "ArrayList", "<", ...
Clone a set of representative Atoms, but returns the parent groups @param ca Atom array @return Group array
[ "Clone", "a", "set", "of", "representative", "Atoms", "but", "returns", "the", "parent", "groups" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L979-L1007
32,191
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.duplicateCA2
public static Atom[] duplicateCA2(Atom[] ca2) { // we don't want to rotate input atoms, do we? Atom[] ca2clone = new Atom[ca2.length * 2]; int pos = 0; Chain c = null; String prevChainId = ""; for (Atom a : ca2) { Group g = (Group) a.getGroup().clone(); // works because each group // has only a sing...
java
public static Atom[] duplicateCA2(Atom[] ca2) { // we don't want to rotate input atoms, do we? Atom[] ca2clone = new Atom[ca2.length * 2]; int pos = 0; Chain c = null; String prevChainId = ""; for (Atom a : ca2) { Group g = (Group) a.getGroup().clone(); // works because each group // has only a sing...
[ "public", "static", "Atom", "[", "]", "duplicateCA2", "(", "Atom", "[", "]", "ca2", ")", "{", "// we don't want to rotate input atoms, do we?", "Atom", "[", "]", "ca2clone", "=", "new", "Atom", "[", "ca2", ".", "length", "*", "2", "]", ";", "int", "pos", ...
Utility method for working with circular permutations. Creates a duplicated and cloned set of Calpha atoms from the input array. @param ca2 atom array @return cloned and duplicated set of input array
[ "Utility", "method", "for", "working", "with", "circular", "permutations", ".", "Creates", "a", "duplicated", "and", "cloned", "set", "of", "Calpha", "atoms", "from", "the", "input", "array", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1017-L1077
32,192
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getAtomCAArray
public static Atom[] getAtomCAArray(Structure s) { List<Atom> atoms = new ArrayList<Atom>(); for (Chain c : s.getChains()) { for (Group g : c.getAtomGroups()) { if (g.hasAtom(CA_ATOM_NAME) && g.getAtom(CA_ATOM_NAME).getElement() == Element.C) { atoms.add(g.getAtom(CA_ATOM_NAME)); } } } ...
java
public static Atom[] getAtomCAArray(Structure s) { List<Atom> atoms = new ArrayList<Atom>(); for (Chain c : s.getChains()) { for (Group g : c.getAtomGroups()) { if (g.hasAtom(CA_ATOM_NAME) && g.getAtom(CA_ATOM_NAME).getElement() == Element.C) { atoms.add(g.getAtom(CA_ATOM_NAME)); } } } ...
[ "public", "static", "Atom", "[", "]", "getAtomCAArray", "(", "Structure", "s", ")", "{", "List", "<", "Atom", ">", "atoms", "=", "new", "ArrayList", "<", "Atom", ">", "(", ")", ";", "for", "(", "Chain", "c", ":", "s", ".", "getChains", "(", ")", ...
Return an Atom array of the C-alpha atoms. Any atom that is a carbon and has CA name will be returned. @param s the structure object @return an Atom[] array @see #getRepresentativeAtomArray(Structure)
[ "Return", "an", "Atom", "array", "of", "the", "C", "-", "alpha", "atoms", ".", "Any", "atom", "that", "is", "a", "carbon", "and", "has", "CA", "name", "will", "be", "returned", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1088-L1102
32,193
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.isNucleotide
public static final boolean isNucleotide(String groupCode3) { String code = groupCode3.trim(); return nucleotides30.containsKey(code) || nucleotides23.containsKey(code); }
java
public static final boolean isNucleotide(String groupCode3) { String code = groupCode3.trim(); return nucleotides30.containsKey(code) || nucleotides23.containsKey(code); }
[ "public", "static", "final", "boolean", "isNucleotide", "(", "String", "groupCode3", ")", "{", "String", "code", "=", "groupCode3", ".", "trim", "(", ")", ";", "return", "nucleotides30", ".", "containsKey", "(", "code", ")", "||", "nucleotides23", ".", "cont...
Test if the three-letter code of an ATOM entry corresponds to a nucleotide or to an aminoacid. @param groupCode3 3-character code for a group.
[ "Test", "if", "the", "three", "-", "letter", "code", "of", "an", "ATOM", "entry", "corresponds", "to", "a", "nucleotide", "or", "to", "an", "aminoacid", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1267-L1271
32,194
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getReducedStructure
@Deprecated public static final Structure getReducedStructure(Structure s, String chainId) throws StructureException { // since we deal here with structure alignments, // only use Model 1... Structure newS = new StructureImpl(); newS.setPDBCode(s.getPDBCode()); newS.setPDBHeader(s.getPDBHeader()); newS...
java
@Deprecated public static final Structure getReducedStructure(Structure s, String chainId) throws StructureException { // since we deal here with structure alignments, // only use Model 1... Structure newS = new StructureImpl(); newS.setPDBCode(s.getPDBCode()); newS.setPDBHeader(s.getPDBHeader()); newS...
[ "@", "Deprecated", "public", "static", "final", "Structure", "getReducedStructure", "(", "Structure", "s", ",", "String", "chainId", ")", "throws", "StructureException", "{", "// since we deal here with structure alignments,", "// only use Model 1...", "Structure", "newS", ...
Reduce a structure to provide a smaller representation . Only takes the first model of the structure. If chainName is provided only return a structure containing that Chain ID. Converts lower case chain IDs to upper case if structure does not contain a chain with that ID. @param s @param chainId @return Structure @sin...
[ "Reduce", "a", "structure", "to", "provide", "a", "smaller", "representation", ".", "Only", "takes", "the", "first", "model", "of", "the", "structure", ".", "If", "chainName", "is", "provided", "only", "return", "a", "structure", "containing", "that", "Chain",...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1285-L1339
32,195
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.getGroupByPDBResidueNumber
public static final Group getGroupByPDBResidueNumber(Structure struc, ResidueNumber pdbResNum) throws StructureException { if (struc == null || pdbResNum == null) { throw new IllegalArgumentException("Null argument(s)."); } Chain chain = struc.getPolyChainByPDB(pdbResNum.getChainName()); return chain.ge...
java
public static final Group getGroupByPDBResidueNumber(Structure struc, ResidueNumber pdbResNum) throws StructureException { if (struc == null || pdbResNum == null) { throw new IllegalArgumentException("Null argument(s)."); } Chain chain = struc.getPolyChainByPDB(pdbResNum.getChainName()); return chain.ge...
[ "public", "static", "final", "Group", "getGroupByPDBResidueNumber", "(", "Structure", "struc", ",", "ResidueNumber", "pdbResNum", ")", "throws", "StructureException", "{", "if", "(", "struc", "==", "null", "||", "pdbResNum", "==", "null", ")", "{", "throw", "new...
Get a group represented by a ResidueNumber. @param struc a {@link Structure} @param pdbResNum a {@link ResidueNumber} @return a group in the structure that is represented by the pdbResNum. @throws StructureException if the group cannot be found.
[ "Get", "a", "group", "represented", "by", "a", "ResidueNumber", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1377-L1386
32,196
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.removeModels
public static Structure removeModels(Structure s) { if (s.nrModels() == 1) return s; Structure n = new StructureImpl(); // go through whole substructure and clone ... // copy structure data n.setPDBCode(s.getPDBCode()); n.setName(s.getName()); // TODO: do deep copying of data! n.setPDBHeader(s.ge...
java
public static Structure removeModels(Structure s) { if (s.nrModels() == 1) return s; Structure n = new StructureImpl(); // go through whole substructure and clone ... // copy structure data n.setPDBCode(s.getPDBCode()); n.setName(s.getName()); // TODO: do deep copying of data! n.setPDBHeader(s.ge...
[ "public", "static", "Structure", "removeModels", "(", "Structure", "s", ")", "{", "if", "(", "s", ".", "nrModels", "(", ")", "==", "1", ")", "return", "s", ";", "Structure", "n", "=", "new", "StructureImpl", "(", ")", ";", "// go through whole substructure...
Remove all models from a Structure and keep only the first @param s original Structure @return a structure that contains only the first model @since 3.0.5
[ "Remove", "all", "models", "from", "a", "Structure", "and", "keep", "only", "the", "first" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1715-L1737
32,197
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.filterLigands
public static List<Group> filterLigands(List<Group> allGroups) { List<Group> groups = new ArrayList<Group>(); for (Group g : allGroups) { if ( g.isPolymeric()) continue; if (!g.isWater()) { groups.add(g); } } return groups; }
java
public static List<Group> filterLigands(List<Group> allGroups) { List<Group> groups = new ArrayList<Group>(); for (Group g : allGroups) { if ( g.isPolymeric()) continue; if (!g.isWater()) { groups.add(g); } } return groups; }
[ "public", "static", "List", "<", "Group", ">", "filterLigands", "(", "List", "<", "Group", ">", "allGroups", ")", "{", "List", "<", "Group", ">", "groups", "=", "new", "ArrayList", "<", "Group", ">", "(", ")", ";", "for", "(", "Group", "g", ":", "a...
Removes all polymeric and solvent groups from a list of groups
[ "Removes", "all", "polymeric", "and", "solvent", "groups", "from", "a", "list", "of", "groups" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1743-L1757
32,198
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.hasNonDeuteratedEquiv
public static boolean hasNonDeuteratedEquiv(Atom atom, Group currentGroup) { if(atom.getElement()==Element.D && currentGroup.hasAtom(replaceFirstChar(atom.getName(),'D', 'H'))) { // If it's deuterated and has a non-deuterated brother return true; } return false; }
java
public static boolean hasNonDeuteratedEquiv(Atom atom, Group currentGroup) { if(atom.getElement()==Element.D && currentGroup.hasAtom(replaceFirstChar(atom.getName(),'D', 'H'))) { // If it's deuterated and has a non-deuterated brother return true; } return false; }
[ "public", "static", "boolean", "hasNonDeuteratedEquiv", "(", "Atom", "atom", ",", "Group", "currentGroup", ")", "{", "if", "(", "atom", ".", "getElement", "(", ")", "==", "Element", ".", "D", "&&", "currentGroup", ".", "hasAtom", "(", "replaceFirstChar", "("...
Check to see if an Deuterated atom has a non deuterated brother in the group. @param atom the input atom that is putatively deuterium @param currentGroup the group the atom is in @return true if the atom is deuterated and it's hydrogen equive exists.
[ "Check", "to", "see", "if", "an", "Deuterated", "atom", "has", "a", "non", "deuterated", "brother", "in", "the", "group", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1895-L1901
32,199
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.hasDeuteratedEquiv
public static boolean hasDeuteratedEquiv(Atom atom, Group currentGroup) { if(atom.getElement()==Element.H && currentGroup.hasAtom(replaceFirstChar(atom.getName(),'H', 'D'))) { // If it's hydrogen and has a deuterated brother return true; } return false; }
java
public static boolean hasDeuteratedEquiv(Atom atom, Group currentGroup) { if(atom.getElement()==Element.H && currentGroup.hasAtom(replaceFirstChar(atom.getName(),'H', 'D'))) { // If it's hydrogen and has a deuterated brother return true; } return false; }
[ "public", "static", "boolean", "hasDeuteratedEquiv", "(", "Atom", "atom", ",", "Group", "currentGroup", ")", "{", "if", "(", "atom", ".", "getElement", "(", ")", "==", "Element", ".", "H", "&&", "currentGroup", ".", "hasAtom", "(", "replaceFirstChar", "(", ...
Check to see if a Hydrogen has a Deuterated brother in the group. @param atom the input atom that is putatively hydorgen @param currentGroup the group the atom is in @return true if the atom is hydrogen and it's Deuterium equiv exists.
[ "Check", "to", "see", "if", "a", "Hydrogen", "has", "a", "Deuterated", "brother", "in", "the", "group", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L1909-L1915