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
31,600
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java
AlternativeAlignment.super_pos_alig
private void super_pos_alig(Atom[]ca1,Atom[]ca2,int[] idx1, int[] idx2, boolean getRMS) throws StructureException{ //System.out.println("superpos alig "); Atom[] ca1subset = new Atom[idx1.length]; Atom[] ca2subset = new Atom[idx2.length]; for (int i = 0 ; i < idx1.length;i++){ //System.out.println("idx1 "+...
java
private void super_pos_alig(Atom[]ca1,Atom[]ca2,int[] idx1, int[] idx2, boolean getRMS) throws StructureException{ //System.out.println("superpos alig "); Atom[] ca1subset = new Atom[idx1.length]; Atom[] ca2subset = new Atom[idx2.length]; for (int i = 0 ; i < idx1.length;i++){ //System.out.println("idx1 "+...
[ "private", "void", "super_pos_alig", "(", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "int", "[", "]", "idx1", ",", "int", "[", "]", "idx2", ",", "boolean", "getRMS", ")", "throws", "StructureException", "{", "//System.out.println(\"superpo...
Superimposes two molecules according to residue index list idx1 and idx2. Does not change the original coordinates. as an internal result the rotation matrix and shift vectors for are set @param ca1 Atom set 1 @param ca2 Atom set 2 @param idx1 idx positions in set1 @param idx2 idx positions in set2 @param getRMS a fla...
[ "Superimposes", "two", "molecules", "according", "to", "residue", "index", "list", "idx1", "and", "idx2", ".", "Does", "not", "change", "the", "original", "coordinates", ".", "as", "an", "internal", "result", "the", "rotation", "matrix", "and", "shift", "vecto...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L768-L794
31,601
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java
AlternativeAlignment.getAlignedStructure
public Structure getAlignedStructure(Structure s1, Structure s2){ // do not change the original coords .. Structure s3 = s2.clone(); currentRotMatrix.print(3,3); Calc.rotate(s3, currentRotMatrix); Calc.shift( s3, currentTranMatrix); Structure newpdb = new StructureImpl(); newpdb.setPDBCode("Java"); n...
java
public Structure getAlignedStructure(Structure s1, Structure s2){ // do not change the original coords .. Structure s3 = s2.clone(); currentRotMatrix.print(3,3); Calc.rotate(s3, currentRotMatrix); Calc.shift( s3, currentTranMatrix); Structure newpdb = new StructureImpl(); newpdb.setPDBCode("Java"); n...
[ "public", "Structure", "getAlignedStructure", "(", "Structure", "s1", ",", "Structure", "s2", ")", "{", "// do not change the original coords ..", "Structure", "s3", "=", "s2", ".", "clone", "(", ")", ";", "currentRotMatrix", ".", "print", "(", "3", ",", "3", ...
create an artifical Structure object that contains the two structures superimposed onto each other. Each structure is in a separate model. Model 1 is structure 1 and Model 2 is structure 2. @param s1 the first structure. its coordinates will not be changed @param s2 the second structure, it will be cloned and the clon...
[ "create", "an", "artifical", "Structure", "object", "that", "contains", "the", "two", "structures", "superimposed", "onto", "each", "other", ".", "Each", "structure", "is", "in", "a", "separate", "model", ".", "Model", "1", "is", "structure", "1", "and", "Mo...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L849-L868
31,602
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java
AlternativeAlignment.toPDB
public String toPDB(Structure s1, Structure s2){ Structure newpdb = getAlignedStructure(s1, s2); return newpdb.toPDB(); }
java
public String toPDB(Structure s1, Structure s2){ Structure newpdb = getAlignedStructure(s1, s2); return newpdb.toPDB(); }
[ "public", "String", "toPDB", "(", "Structure", "s1", ",", "Structure", "s2", ")", "{", "Structure", "newpdb", "=", "getAlignedStructure", "(", "s1", ",", "s2", ")", ";", "return", "newpdb", ".", "toPDB", "(", ")", ";", "}" ]
converts the alignment to a PDB file each of the structures will be represented as a model. @param s1 @param s2 @return a PDB file as a String
[ "converts", "the", "alignment", "to", "a", "PDB", "file", "each", "of", "the", "structures", "will", "be", "represented", "as", "a", "model", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L878-L884
31,603
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/ChromosomeSequence.java
ChromosomeSequence.addGene
public GeneSequence addGene(AccessionID accession, int bioBegin, int bioEnd, Strand strand) { GeneSequence geneSequence = new GeneSequence(this, bioBegin, bioEnd, strand); geneSequence.setAccession(accession); geneSequenceHashMap.put(accession.toString(), geneSequence); return geneSequence; }
java
public GeneSequence addGene(AccessionID accession, int bioBegin, int bioEnd, Strand strand) { GeneSequence geneSequence = new GeneSequence(this, bioBegin, bioEnd, strand); geneSequence.setAccession(accession); geneSequenceHashMap.put(accession.toString(), geneSequence); return geneSequence; }
[ "public", "GeneSequence", "addGene", "(", "AccessionID", "accession", ",", "int", "bioBegin", ",", "int", "bioEnd", ",", "Strand", "strand", ")", "{", "GeneSequence", "geneSequence", "=", "new", "GeneSequence", "(", "this", ",", "bioBegin", ",", "bioEnd", ",",...
Add a gene to the chromosome sequence using bioIndexing starts at 1 instead of 0. The GeneSequence that is returned will have a reference to parent chromosome sequence which actually contains the sequence data. Strand is important for positive and negative direction where negative strand means we need reverse complemen...
[ "Add", "a", "gene", "to", "the", "chromosome", "sequence", "using", "bioIndexing", "starts", "at", "1", "instead", "of", "0", ".", "The", "GeneSequence", "that", "is", "returned", "will", "have", "a", "reference", "to", "parent", "chromosome", "sequence", "w...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/ChromosomeSequence.java#L136-L141
31,604
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/AFPChainCoordManager.java
AFPChainCoordManager.getPanelPos
public Point getPanelPos(int aligSeq, int i) { Point p = new Point(); // get line // we do integer division since we ignore remainders int lineNr = i / DEFAULT_LINE_LENGTH; // but we want to have the reminder for the line position. int linePos = i % DEFAULT_LINE_LENGTH; int x = linePos * DEFAULT_CHAR_S...
java
public Point getPanelPos(int aligSeq, int i) { Point p = new Point(); // get line // we do integer division since we ignore remainders int lineNr = i / DEFAULT_LINE_LENGTH; // but we want to have the reminder for the line position. int linePos = i % DEFAULT_LINE_LENGTH; int x = linePos * DEFAULT_CHAR_S...
[ "public", "Point", "getPanelPos", "(", "int", "aligSeq", ",", "int", "i", ")", "{", "Point", "p", "=", "new", "Point", "(", ")", ";", "// get line", "// we do integer division since we ignore remainders", "int", "lineNr", "=", "i", "/", "DEFAULT_LINE_LENGTH", ";...
get the position of the sequence position on the Panel @param aligSeq 0 or 1 for which of the two sequences to ask for. @param i sequence position @return the point on a panel for a sequence position
[ "get", "the", "position", "of", "the", "sequence", "position", "on", "the", "Panel" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/AFPChainCoordManager.java#L127-L146
31,605
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/AFPChainCoordManager.java
AFPChainCoordManager.getLegendPosition
public Point getLegendPosition(int lineNr, int chainNr) { int x = DEFAULT_X_SPACE ; int y = lineNr * DEFAULT_Y_STEP + DEFAULT_Y_SPACE; y += chainNr * DEFAULT_LINE_SEPARATION; Point p = new Point(x,y); return p; }
java
public Point getLegendPosition(int lineNr, int chainNr) { int x = DEFAULT_X_SPACE ; int y = lineNr * DEFAULT_Y_STEP + DEFAULT_Y_SPACE; y += chainNr * DEFAULT_LINE_SEPARATION; Point p = new Point(x,y); return p; }
[ "public", "Point", "getLegendPosition", "(", "int", "lineNr", ",", "int", "chainNr", ")", "{", "int", "x", "=", "DEFAULT_X_SPACE", ";", "int", "y", "=", "lineNr", "*", "DEFAULT_Y_STEP", "+", "DEFAULT_Y_SPACE", ";", "y", "+=", "chainNr", "*", "DEFAULT_LINE_SE...
provide the coordinates for where to draw the legend for line X and if it is chain 1 or 2 @param lineNr which line is this for @param chainNr is it chain 0 or 1 @return get the point where to draw the legend
[ "provide", "the", "coordinates", "for", "where", "to", "draw", "the", "legend", "for", "line", "X", "and", "if", "it", "is", "chain", "1", "or", "2" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/AFPChainCoordManager.java#L192-L201
31,606
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java
FastaWriterHelper.writeProteinSequence
public static void writeProteinSequence(File file, Collection<ProteinSequence> proteinSequences) throws Exception { FileOutputStream outputStream = new FileOutputStream(file); BufferedOutputStream bo = new BufferedOutputStream(outputStream); writeProteinSequence(bo, proteinSequences); bo.close(); outputStr...
java
public static void writeProteinSequence(File file, Collection<ProteinSequence> proteinSequences) throws Exception { FileOutputStream outputStream = new FileOutputStream(file); BufferedOutputStream bo = new BufferedOutputStream(outputStream); writeProteinSequence(bo, proteinSequences); bo.close(); outputStr...
[ "public", "static", "void", "writeProteinSequence", "(", "File", "file", ",", "Collection", "<", "ProteinSequence", ">", "proteinSequences", ")", "throws", "Exception", "{", "FileOutputStream", "outputStream", "=", "new", "FileOutputStream", "(", "file", ")", ";", ...
Write collection of protein sequences to a file @param file @param proteinSequences @throws Exception
[ "Write", "collection", "of", "protein", "sequences", "to", "a", "file" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java#L55-L62
31,607
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java
FastaWriterHelper.writeSequence
public static void writeSequence(File file, Sequence<?> sequence) throws Exception { FileOutputStream outputStream = new FileOutputStream(file); BufferedOutputStream bo = new BufferedOutputStream(outputStream); writeSequences(bo, singleSeqToCollection(sequence)); bo.close(); outputStream.close(); }
java
public static void writeSequence(File file, Sequence<?> sequence) throws Exception { FileOutputStream outputStream = new FileOutputStream(file); BufferedOutputStream bo = new BufferedOutputStream(outputStream); writeSequences(bo, singleSeqToCollection(sequence)); bo.close(); outputStream.close(); }
[ "public", "static", "void", "writeSequence", "(", "File", "file", ",", "Sequence", "<", "?", ">", "sequence", ")", "throws", "Exception", "{", "FileOutputStream", "outputStream", "=", "new", "FileOutputStream", "(", "file", ")", ";", "BufferedOutputStream", "bo"...
Write a sequence to a file @param file @param sequence @throws Exception
[ "Write", "a", "sequence", "to", "a", "file" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java#L148-L154
31,608
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java
FastaWriterHelper.writeSequence
public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception { writeSequences(outputStream, singleSeqToCollection(sequence)); }
java
public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception { writeSequences(outputStream, singleSeqToCollection(sequence)); }
[ "public", "static", "void", "writeSequence", "(", "OutputStream", "outputStream", ",", "Sequence", "<", "?", ">", "sequence", ")", "throws", "Exception", "{", "writeSequences", "(", "outputStream", ",", "singleSeqToCollection", "(", "sequence", ")", ")", ";", "}...
Write a sequence to OutputStream @param outputStream @param sequence @throws Exception
[ "Write", "a", "sequence", "to", "OutputStream" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaWriterHelper.java#L162-L164
31,609
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/views/WindowedSequence.java
WindowedSequence.get
public SequenceView<C> get(int index) { int start = toStartIndex(index); int end = index + (getWindowSize() - 1); return getBackingSequence().getSubSequence(start, end); }
java
public SequenceView<C> get(int index) { int start = toStartIndex(index); int end = index + (getWindowSize() - 1); return getBackingSequence().getSubSequence(start, end); }
[ "public", "SequenceView", "<", "C", ">", "get", "(", "int", "index", ")", "{", "int", "start", "=", "toStartIndex", "(", "index", ")", ";", "int", "end", "=", "index", "+", "(", "getWindowSize", "(", ")", "-", "1", ")", ";", "return", "getBackingSequ...
Returns the window specified at the given index in offsets i.e. asking for position 2 in a moving window sequence of size 3 will get you the window starting at position 4.
[ "Returns", "the", "window", "specified", "at", "the", "given", "index", "in", "offsets", "i", ".", "e", ".", "asking", "for", "position", "2", "in", "a", "moving", "window", "sequence", "of", "size", "3", "will", "get", "you", "the", "window", "starting"...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/views/WindowedSequence.java#L106-L110
31,610
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorPointGroup.java
JmolSymmetryScriptGeneratorPointGroup.getPolyhedronColor
private Color4f getPolyhedronColor() { Color4f[] colors = getSymmetryColors(5); Color4f strongestColor = colors[4]; Color4f complement = new Color4f(Color.WHITE); complement.sub(strongestColor); return complement; }
java
private Color4f getPolyhedronColor() { Color4f[] colors = getSymmetryColors(5); Color4f strongestColor = colors[4]; Color4f complement = new Color4f(Color.WHITE); complement.sub(strongestColor); return complement; }
[ "private", "Color4f", "getPolyhedronColor", "(", ")", "{", "Color4f", "[", "]", "colors", "=", "getSymmetryColors", "(", "5", ")", ";", "Color4f", "strongestColor", "=", "colors", "[", "4", "]", ";", "Color4f", "complement", "=", "new", "Color4f", "(", "Co...
Return a color that is complementary to the symmetry color @return
[ "Return", "a", "color", "that", "is", "complementary", "to", "the", "symmetry", "color" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorPointGroup.java#L568-L574
31,611
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.countCompounds
public static <C extends Compound> int countCompounds( Sequence<C> sequence, C... compounds) { int count = 0; Map<C, Integer> compositon = getComposition(sequence); for (C compound : compounds) { if(compositon.containsKey(compound)) { count = compositon.get(compound) + count; } } return count; }
java
public static <C extends Compound> int countCompounds( Sequence<C> sequence, C... compounds) { int count = 0; Map<C, Integer> compositon = getComposition(sequence); for (C compound : compounds) { if(compositon.containsKey(compound)) { count = compositon.get(compound) + count; } } return count; }
[ "public", "static", "<", "C", "extends", "Compound", ">", "int", "countCompounds", "(", "Sequence", "<", "C", ">", "sequence", ",", "C", "...", "compounds", ")", "{", "int", "count", "=", "0", ";", "Map", "<", "C", ",", "Integer", ">", "compositon", ...
For the given vargs of compounds this method counts the number of times those compounds appear in the given sequence @param sequence The {@link Sequence} to perform the count on @param compounds The compounds to look for @param <C> The type of compound we are looking for @return The number of times the given compounds...
[ "For", "the", "given", "vargs", "of", "compounds", "this", "method", "counts", "the", "number", "of", "times", "those", "compounds", "appear", "in", "the", "given", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L62-L72
31,612
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.countGC
public static int countGC(Sequence<NucleotideCompound> sequence) { CompoundSet<NucleotideCompound> cs = sequence.getCompoundSet(); NucleotideCompound G = cs.getCompoundForString("G"); NucleotideCompound C = cs.getCompoundForString("C"); NucleotideCompound g = cs.getCompoundForString("g"); NucleotideCompound c...
java
public static int countGC(Sequence<NucleotideCompound> sequence) { CompoundSet<NucleotideCompound> cs = sequence.getCompoundSet(); NucleotideCompound G = cs.getCompoundForString("G"); NucleotideCompound C = cs.getCompoundForString("C"); NucleotideCompound g = cs.getCompoundForString("g"); NucleotideCompound c...
[ "public", "static", "int", "countGC", "(", "Sequence", "<", "NucleotideCompound", ">", "sequence", ")", "{", "CompoundSet", "<", "NucleotideCompound", ">", "cs", "=", "sequence", ".", "getCompoundSet", "(", ")", ";", "NucleotideCompound", "G", "=", "cs", ".", ...
Returns the count of GC in the given sequence @param sequence The {@link NucleotideCompound} {@link Sequence} to perform the GC analysis on @return The number of GC compounds in the sequence
[ "Returns", "the", "count", "of", "GC", "in", "the", "given", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L81-L88
31,613
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.countAT
public static int countAT(Sequence<NucleotideCompound> sequence) { CompoundSet<NucleotideCompound> cs = sequence.getCompoundSet(); NucleotideCompound A = cs.getCompoundForString("A"); NucleotideCompound T = cs.getCompoundForString("T"); NucleotideCompound a = cs.getCompoundForString("a"); NucleotideCompound t...
java
public static int countAT(Sequence<NucleotideCompound> sequence) { CompoundSet<NucleotideCompound> cs = sequence.getCompoundSet(); NucleotideCompound A = cs.getCompoundForString("A"); NucleotideCompound T = cs.getCompoundForString("T"); NucleotideCompound a = cs.getCompoundForString("a"); NucleotideCompound t...
[ "public", "static", "int", "countAT", "(", "Sequence", "<", "NucleotideCompound", ">", "sequence", ")", "{", "CompoundSet", "<", "NucleotideCompound", ">", "cs", "=", "sequence", ".", "getCompoundSet", "(", ")", ";", "NucleotideCompound", "A", "=", "cs", ".", ...
Returns the count of AT in the given sequence @param sequence The {@link NucleotideCompound} {@link Sequence} to perform the AT analysis on @return The number of AT compounds in the sequence
[ "Returns", "the", "count", "of", "AT", "in", "the", "given", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L97-L104
31,614
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.getComposition
public static <C extends Compound> Map<C, Integer> getComposition(Sequence<C> sequence) { Map<C, Integer> results = new HashMap<C, Integer>(); for (C currentCompound : sequence) { Integer currentInteger = results.get(currentCompound); if ( currentInteger == null) currentInteger = 0; currentInteger++; ...
java
public static <C extends Compound> Map<C, Integer> getComposition(Sequence<C> sequence) { Map<C, Integer> results = new HashMap<C, Integer>(); for (C currentCompound : sequence) { Integer currentInteger = results.get(currentCompound); if ( currentInteger == null) currentInteger = 0; currentInteger++; ...
[ "public", "static", "<", "C", "extends", "Compound", ">", "Map", "<", "C", ",", "Integer", ">", "getComposition", "(", "Sequence", "<", "C", ">", "sequence", ")", "{", "Map", "<", "C", ",", "Integer", ">", "results", "=", "new", "HashMap", "<", "C", ...
Does a linear scan over the given Sequence and records the number of times each base appears. The returned map will return 0 if a compound is asked for and the Map has no record of it. @param <C> The type of compound to look for @param sequence The type of sequence to look over @return Counts for the instances of all ...
[ "Does", "a", "linear", "scan", "over", "the", "given", "Sequence", "and", "records", "the", "number", "of", "times", "each", "base", "appears", ".", "The", "returned", "map", "will", "return", "0", "if", "a", "compound", "is", "asked", "for", "and", "the...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L135-L146
31,615
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.write
public static <C extends Compound> void write(Appendable appendable, Sequence<C> sequence) throws IOException { for(C compound: sequence) { appendable.append(compound.toString()); } }
java
public static <C extends Compound> void write(Appendable appendable, Sequence<C> sequence) throws IOException { for(C compound: sequence) { appendable.append(compound.toString()); } }
[ "public", "static", "<", "C", "extends", "Compound", ">", "void", "write", "(", "Appendable", "appendable", ",", "Sequence", "<", "C", ">", "sequence", ")", "throws", "IOException", "{", "for", "(", "C", "compound", ":", "sequence", ")", "{", "appendable",...
Used as a way of sending a Sequence to a writer without the cost of converting to a full length String and then writing the data out @param <C> Type of compound @param writer The writer to send data to @param sequence The sequence to write out @throws IOException Thrown if we encounter a problem
[ "Used", "as", "a", "way", "of", "sending", "a", "Sequence", "to", "a", "writer", "without", "the", "cost", "of", "converting", "to", "a", "full", "length", "String", "and", "then", "writing", "the", "data", "out" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L157-L161
31,616
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.indexOf
public static <C extends Compound> int indexOf(Sequence<C> sequence, C compound) { int index = 1; for (C currentCompound : sequence) { if (currentCompound.equals(compound)) { return index; } index++; } return 0; }
java
public static <C extends Compound> int indexOf(Sequence<C> sequence, C compound) { int index = 1; for (C currentCompound : sequence) { if (currentCompound.equals(compound)) { return index; } index++; } return 0; }
[ "public", "static", "<", "C", "extends", "Compound", ">", "int", "indexOf", "(", "Sequence", "<", "C", ">", "sequence", ",", "C", "compound", ")", "{", "int", "index", "=", "1", ";", "for", "(", "C", "currentCompound", ":", "sequence", ")", "{", "if"...
Performs a linear search of the given Sequence for the given compound. Once we find the compound we return the position.
[ "Performs", "a", "linear", "search", "of", "the", "given", "Sequence", "for", "the", "given", "compound", ".", "Once", "we", "find", "the", "compound", "we", "return", "the", "position", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L201-L211
31,617
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.createIterator
public static <C extends Compound> Iterator<C> createIterator( Sequence<C> sequence) { return new SequenceIterator<C>(sequence); }
java
public static <C extends Compound> Iterator<C> createIterator( Sequence<C> sequence) { return new SequenceIterator<C>(sequence); }
[ "public", "static", "<", "C", "extends", "Compound", ">", "Iterator", "<", "C", ">", "createIterator", "(", "Sequence", "<", "C", ">", "sequence", ")", "{", "return", "new", "SequenceIterator", "<", "C", ">", "(", "sequence", ")", ";", "}" ]
Creates a simple sequence iterator which moves through a sequence going from 1 to the length of the Sequence. Modification of the Sequence is not allowed.
[ "Creates", "a", "simple", "sequence", "iterator", "which", "moves", "through", "a", "sequence", "going", "from", "1", "to", "the", "length", "of", "the", "Sequence", ".", "Modification", "of", "the", "Sequence", "is", "not", "allowed", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L230-L233
31,618
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.createSubSequence
public static <C extends Compound> SequenceView<C> createSubSequence( Sequence<C> sequence, int start, int end) { return new SequenceProxyView<C>(sequence, start, end); }
java
public static <C extends Compound> SequenceView<C> createSubSequence( Sequence<C> sequence, int start, int end) { return new SequenceProxyView<C>(sequence, start, end); }
[ "public", "static", "<", "C", "extends", "Compound", ">", "SequenceView", "<", "C", ">", "createSubSequence", "(", "Sequence", "<", "C", ">", "sequence", ",", "int", "start", ",", "int", "end", ")", "{", "return", "new", "SequenceProxyView", "<", "C", ">...
Creates a simple sub sequence view delimited by the given start and end.
[ "Creates", "a", "simple", "sub", "sequence", "view", "delimited", "by", "the", "given", "start", "and", "end", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L238-L241
31,619
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.checksum
public static <C extends Compound> String checksum(Sequence<C> sequence) { CRC64Checksum checksum = new CRC64Checksum(); for (C compound : sequence) { checksum.update(compound.getShortName()); } return checksum.toString(); }
java
public static <C extends Compound> String checksum(Sequence<C> sequence) { CRC64Checksum checksum = new CRC64Checksum(); for (C compound : sequence) { checksum.update(compound.getShortName()); } return checksum.toString(); }
[ "public", "static", "<", "C", "extends", "Compound", ">", "String", "checksum", "(", "Sequence", "<", "C", ">", "sequence", ")", "{", "CRC64Checksum", "checksum", "=", "new", "CRC64Checksum", "(", ")", ";", "for", "(", "C", "compound", ":", "sequence", "...
Performs a simple CRC64 checksum on any given sequence.
[ "Performs", "a", "simple", "CRC64", "checksum", "on", "any", "given", "sequence", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L260-L266
31,620
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.overlappingKmers
public static <C extends Compound> List<SequenceView<C>> overlappingKmers(Sequence<C> sequence, int kmer) { List<SequenceView<C>> l = new ArrayList<SequenceView<C>>(); List<Iterator<SequenceView<C>>> windows = new ArrayList<Iterator<SequenceView<C>>>(); for(int i=1; i<=kmer; i++) { if(i == 1) { window...
java
public static <C extends Compound> List<SequenceView<C>> overlappingKmers(Sequence<C> sequence, int kmer) { List<SequenceView<C>> l = new ArrayList<SequenceView<C>>(); List<Iterator<SequenceView<C>>> windows = new ArrayList<Iterator<SequenceView<C>>>(); for(int i=1; i<=kmer; i++) { if(i == 1) { window...
[ "public", "static", "<", "C", "extends", "Compound", ">", "List", "<", "SequenceView", "<", "C", ">", ">", "overlappingKmers", "(", "Sequence", "<", "C", ">", "sequence", ",", "int", "kmer", ")", "{", "List", "<", "SequenceView", "<", "C", ">>", "l", ...
Used to generate overlapping k-mers such i.e. ATGTA will give rise to ATG, TGT & GTA @param <C> Compound to use @param sequence Sequence to build from @param kmer Kmer size @return The list of overlapping K-mers
[ "Used", "to", "generate", "overlapping", "k", "-", "mers", "such", "i", ".", "e", ".", "ATGTA", "will", "give", "rise", "to", "ATG", "TGT", "&", "GTA" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L295-L324
31,621
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.sequenceEqualityIgnoreCase
public static <C extends Compound> boolean sequenceEqualityIgnoreCase(Sequence<C> source, Sequence<C> target) { return baseSequenceEquality(source, target, true); }
java
public static <C extends Compound> boolean sequenceEqualityIgnoreCase(Sequence<C> source, Sequence<C> target) { return baseSequenceEquality(source, target, true); }
[ "public", "static", "<", "C", "extends", "Compound", ">", "boolean", "sequenceEqualityIgnoreCase", "(", "Sequence", "<", "C", ">", "source", ",", "Sequence", "<", "C", ">", "target", ")", "{", "return", "baseSequenceEquality", "(", "source", ",", "target", "...
A case-insensitive manner of comparing two sequence objects together. We will throw out any compounds which fail to match on their sequence length & compound sets used. The code will also bail out the moment we find something is wrong with a Sequence. Cost to run is linear to the length of the Sequence. @param <C> The...
[ "A", "case", "-", "insensitive", "manner", "of", "comparing", "two", "sequence", "objects", "together", ".", "We", "will", "throw", "out", "any", "compounds", "which", "fail", "to", "match", "on", "their", "sequence", "length", "&", "compound", "sets", "used...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L355-L357
31,622
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java
SequenceMixin.sequenceEquality
public static <C extends Compound> boolean sequenceEquality(Sequence<C> source, Sequence<C> target) { return baseSequenceEquality(source, target, false); }
java
public static <C extends Compound> boolean sequenceEquality(Sequence<C> source, Sequence<C> target) { return baseSequenceEquality(source, target, false); }
[ "public", "static", "<", "C", "extends", "Compound", ">", "boolean", "sequenceEquality", "(", "Sequence", "<", "C", ">", "source", ",", "Sequence", "<", "C", ">", "target", ")", "{", "return", "baseSequenceEquality", "(", "source", ",", "target", ",", "fal...
A case-sensitive manner of comparing two sequence objects together. We will throw out any compounds which fail to match on their sequence length & compound sets used. The code will also bail out the moment we find something is wrong with a Sequence. Cost to run is linear to the length of the Sequence. @param <C> The t...
[ "A", "case", "-", "sensitive", "manner", "of", "comparing", "two", "sequence", "objects", "together", ".", "We", "will", "throw", "out", "any", "compounds", "which", "fail", "to", "match", "on", "their", "sequence", "length", "&", "compound", "sets", "used",...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/SequenceMixin.java#L371-L373
31,623
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/LocIterator.java
LocIterator.hasNext
public boolean hasNext( int windowSize, int increment ) { if( windowSize <= 0 ) { throw new IllegalArgumentException( "Window size must be positive." ); } try { if( increment > 0 ) { return windowSize == mBounds.suffix( mPosition ).prefix( windowSize ).length(); } else { if( mPosit...
java
public boolean hasNext( int windowSize, int increment ) { if( windowSize <= 0 ) { throw new IllegalArgumentException( "Window size must be positive." ); } try { if( increment > 0 ) { return windowSize == mBounds.suffix( mPosition ).prefix( windowSize ).length(); } else { if( mPosit...
[ "public", "boolean", "hasNext", "(", "int", "windowSize", ",", "int", "increment", ")", "{", "if", "(", "windowSize", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Window size must be positive.\"", ")", ";", "}", "try", "{", "if", ...
Check if next window of specified size is available. @param windowSize Size of window. May be smaller or larger than default window size. @param increment The increment by which to move the window at each iteration. Note that this method does not actually change the position. However, it checks the sign of the increme...
[ "Check", "if", "next", "window", "of", "specified", "size", "is", "available", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/LocIterator.java#L91-L120
31,624
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/LocIterator.java
LocIterator.next
public Location next( int windowSize, int increment ) { if( windowSize <= 0 ) { throw new IllegalArgumentException( "Window size must be positive." ); } if( increment == 0 ) { throw new IllegalArgumentException( "Increment must be non-zero." ); } Location r; try { if( increment > 0 ) {...
java
public Location next( int windowSize, int increment ) { if( windowSize <= 0 ) { throw new IllegalArgumentException( "Window size must be positive." ); } if( increment == 0 ) { throw new IllegalArgumentException( "Increment must be non-zero." ); } Location r; try { if( increment > 0 ) {...
[ "public", "Location", "next", "(", "int", "windowSize", ",", "int", "increment", ")", "{", "if", "(", "windowSize", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Window size must be positive.\"", ")", ";", "}", "if", "(", "increment"...
Get next window of specified size, then increment position by specified amount. @return Location of next window. @param windowSize Size of window to get. @param increment Amount by which to shift position. If increment is positive, the position is shifted toward the end of the bounding location; if increment is negati...
[ "Get", "next", "window", "of", "specified", "size", "then", "increment", "position", "by", "specified", "amount", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/LocIterator.java#L190-L231
31,625
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
AbstractSequence.setProxySequenceReader
public void setProxySequenceReader(SequenceReader<C> proxyLoader) { this.sequenceStorage = proxyLoader; if (proxyLoader instanceof FeaturesKeyWordInterface) { this.setFeaturesKeyWord((FeaturesKeyWordInterface) sequenceStorage); } if (proxyLoader instanceof DatabaseReferenceInterface) { this.setDatabaseRef...
java
public void setProxySequenceReader(SequenceReader<C> proxyLoader) { this.sequenceStorage = proxyLoader; if (proxyLoader instanceof FeaturesKeyWordInterface) { this.setFeaturesKeyWord((FeaturesKeyWordInterface) sequenceStorage); } if (proxyLoader instanceof DatabaseReferenceInterface) { this.setDatabaseRef...
[ "public", "void", "setProxySequenceReader", "(", "SequenceReader", "<", "C", ">", "proxyLoader", ")", "{", "this", ".", "sequenceStorage", "=", "proxyLoader", ";", "if", "(", "proxyLoader", "instanceof", "FeaturesKeyWordInterface", ")", "{", "this", ".", "setFeatu...
Very important method that allows external mappings of sequence data and features. This method will gain additional interface inspection that allows external data sources with knowledge of features for a sequence to be supported. @param proxyLoader
[ "Very", "important", "method", "that", "allows", "external", "mappings", "of", "sequence", "data", "and", "features", ".", "This", "method", "will", "gain", "additional", "interface", "inspection", "that", "allows", "external", "data", "sources", "with", "knowledg...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java#L118-L146
31,626
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
AbstractSequence.getSource
public String getSource() { if (source != null) { return source; } if (parentSequence != null) { return parentSequence.getSource(); } return null; }
java
public String getSource() { if (source != null) { return source; } if (parentSequence != null) { return parentSequence.getSource(); } return null; }
[ "public", "String", "getSource", "(", ")", "{", "if", "(", "source", "!=", "null", ")", "{", "return", "source", ";", "}", "if", "(", "parentSequence", "!=", "null", ")", "{", "return", "parentSequence", ".", "getSource", "(", ")", ";", "}", "return", ...
Added support for the source of this sequence for GFF3 export If a sub sequence doesn't have source then check for parent source @return the source
[ "Added", "support", "for", "the", "source", "of", "this", "sequence", "for", "GFF3", "export", "If", "a", "sub", "sequence", "doesn", "t", "have", "source", "then", "check", "for", "parent", "source" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java#L267-L275
31,627
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
AbstractSequence.getFeatures
public List<FeatureInterface<AbstractSequence<C>, C>> getFeatures(int bioSequencePosition) { ArrayList<FeatureInterface<AbstractSequence<C>, C>> featureHits = new ArrayList<FeatureInterface<AbstractSequence<C>, C>>(); if (features != null) { for (FeatureInterface<AbstractSequence<C>, C> feature : features) {...
java
public List<FeatureInterface<AbstractSequence<C>, C>> getFeatures(int bioSequencePosition) { ArrayList<FeatureInterface<AbstractSequence<C>, C>> featureHits = new ArrayList<FeatureInterface<AbstractSequence<C>, C>>(); if (features != null) { for (FeatureInterface<AbstractSequence<C>, C> feature : features) {...
[ "public", "List", "<", "FeatureInterface", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", ">", "getFeatures", "(", "int", "bioSequencePosition", ")", "{", "ArrayList", "<", "FeatureInterface", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", ...
Return features at a sequence position @param bioSequencePosition @return
[ "Return", "features", "at", "a", "sequence", "position" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java#L369-L380
31,628
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
AbstractSequence.addFeature
public void addFeature(int bioStart, int bioEnd, FeatureInterface<AbstractSequence<C>, C> feature) { SequenceLocation<AbstractSequence<C>, C> sequenceLocation = new SequenceLocation<AbstractSequence<C>, C>(bioStart, bioEnd, this); feature.setLocation(sequenceLocation); addFeature(feature); }
java
public void addFeature(int bioStart, int bioEnd, FeatureInterface<AbstractSequence<C>, C> feature) { SequenceLocation<AbstractSequence<C>, C> sequenceLocation = new SequenceLocation<AbstractSequence<C>, C>(bioStart, bioEnd, this); feature.setLocation(sequenceLocation); addFeature(feature); }
[ "public", "void", "addFeature", "(", "int", "bioStart", ",", "int", "bioEnd", ",", "FeatureInterface", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", "feature", ")", "{", "SequenceLocation", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", ...
Method to help set the proper details for a feature as it relates to a sequence where the feature needs to have a location on the sequence @param bioStart @param bioEnd @param feature
[ "Method", "to", "help", "set", "the", "proper", "details", "for", "a", "feature", "as", "it", "relates", "to", "a", "sequence", "where", "the", "feature", "needs", "to", "have", "a", "location", "on", "the", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java#L397-L402
31,629
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
AbstractSequence.addFeature
public void addFeature(FeatureInterface<AbstractSequence<C>, C> feature) { features.add(feature); ArrayList<FeatureInterface<AbstractSequence<C>, C>> featureList = groupedFeatures.get(feature.getType()); if (featureList == null) { featureList = new ArrayList<FeatureInterface<AbstractSequence<C>, C>>(); grou...
java
public void addFeature(FeatureInterface<AbstractSequence<C>, C> feature) { features.add(feature); ArrayList<FeatureInterface<AbstractSequence<C>, C>> featureList = groupedFeatures.get(feature.getType()); if (featureList == null) { featureList = new ArrayList<FeatureInterface<AbstractSequence<C>, C>>(); grou...
[ "public", "void", "addFeature", "(", "FeatureInterface", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", "feature", ")", "{", "features", ".", "add", "(", "feature", ")", ";", "ArrayList", "<", "FeatureInterface", "<", "AbstractSequence", "<", "C", ...
Add a feature to this sequence. The feature will be added to the collection where the order is start position and if more than one feature at the same start position then longest is added first. This helps on doing feature layout for displaying features in SequenceFeaturePanel @param feature
[ "Add", "a", "feature", "to", "this", "sequence", ".", "The", "feature", "will", "be", "added", "to", "the", "collection", "where", "the", "order", "is", "start", "position", "and", "if", "more", "than", "one", "feature", "at", "the", "same", "start", "po...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java#L410-L420
31,630
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
AbstractSequence.removeFeature
public void removeFeature(FeatureInterface<AbstractSequence<C>, C> feature) { features.remove(feature); ArrayList<FeatureInterface<AbstractSequence<C>, C>> featureList = groupedFeatures.get(feature.getType()); if (featureList != null) { featureList.remove(feature); if (featureList.isEmpty()) { groupedFe...
java
public void removeFeature(FeatureInterface<AbstractSequence<C>, C> feature) { features.remove(feature); ArrayList<FeatureInterface<AbstractSequence<C>, C>> featureList = groupedFeatures.get(feature.getType()); if (featureList != null) { featureList.remove(feature); if (featureList.isEmpty()) { groupedFe...
[ "public", "void", "removeFeature", "(", "FeatureInterface", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", "feature", ")", "{", "features", ".", "remove", "(", "feature", ")", ";", "ArrayList", "<", "FeatureInterface", "<", "AbstractSequence", "<", "...
Remove a feature from the sequence @param feature
[ "Remove", "a", "feature", "from", "the", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java#L426-L435
31,631
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java
CrystalCell.getCellIndices
public Point3i getCellIndices(Tuple3d pt) { Point3d p = new Point3d(pt); this.transfToCrystal(p); int x = (int)Math.floor(p.x); int y = (int)Math.floor(p.y); int z = (int)Math.floor(p.z); return new Point3i(x,y,z); }
java
public Point3i getCellIndices(Tuple3d pt) { Point3d p = new Point3d(pt); this.transfToCrystal(p); int x = (int)Math.floor(p.x); int y = (int)Math.floor(p.y); int z = (int)Math.floor(p.z); return new Point3i(x,y,z); }
[ "public", "Point3i", "getCellIndices", "(", "Tuple3d", "pt", ")", "{", "Point3d", "p", "=", "new", "Point3d", "(", "pt", ")", ";", "this", ".", "transfToCrystal", "(", "p", ")", ";", "int", "x", "=", "(", "int", ")", "Math", ".", "floor", "(", "p",...
Get the index of a unit cell to which the query point belongs. <p>For instance, all points in the unit cell at the origin will return (0,0,0); Points in the unit cell one unit further along the `a` axis will return (1,0,0), etc. @param pt Input point (in orthonormal coordinates) @return A new point with the three indi...
[ "Get", "the", "index", "of", "a", "unit", "cell", "to", "which", "the", "query", "point", "belongs", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java#L155-L163
31,632
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java
CrystalCell.transfToOriginCell
public void transfToOriginCell(Tuple3d[] points, Tuple3d reference) { reference = new Point3d(reference);//clone transfToCrystal(reference); int x = (int)Math.floor(reference.x); int y = (int)Math.floor(reference.y); int z = (int)Math.floor(reference.z); for( Tuple3d point: points ) { transfToCrystal(p...
java
public void transfToOriginCell(Tuple3d[] points, Tuple3d reference) { reference = new Point3d(reference);//clone transfToCrystal(reference); int x = (int)Math.floor(reference.x); int y = (int)Math.floor(reference.y); int z = (int)Math.floor(reference.z); for( Tuple3d point: points ) { transfToCrystal(p...
[ "public", "void", "transfToOriginCell", "(", "Tuple3d", "[", "]", "points", ",", "Tuple3d", "reference", ")", "{", "reference", "=", "new", "Point3d", "(", "reference", ")", ";", "//clone", "transfToCrystal", "(", "reference", ")", ";", "int", "x", "=", "(...
Converts a set of points so that the reference point falls in the unit cell. This is useful to transform a whole chain at once, allowing some of the atoms to be outside the unit cell, but forcing the centroid to be within it. @param points A set of points to transform (in orthonormal coordinates) @param reference The...
[ "Converts", "a", "set", "of", "points", "so", "that", "the", "reference", "point", "falls", "in", "the", "unit", "cell", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java#L191-L206
31,633
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java
CrystalCell.getMaxDimension
public double getMaxDimension() { if (maxDimension!=0) { return maxDimension; } Point3d vert0 = new Point3d(0,0,0); Point3d vert1 = new Point3d(1,0,0); transfToOrthonormal(vert1); Point3d vert2 = new Point3d(0,1,0); transfToOrthonormal(vert2); Point3d vert3 = new Point3d(0,0,1); transfToOrthonormal...
java
public double getMaxDimension() { if (maxDimension!=0) { return maxDimension; } Point3d vert0 = new Point3d(0,0,0); Point3d vert1 = new Point3d(1,0,0); transfToOrthonormal(vert1); Point3d vert2 = new Point3d(0,1,0); transfToOrthonormal(vert2); Point3d vert3 = new Point3d(0,0,1); transfToOrthonormal...
[ "public", "double", "getMaxDimension", "(", ")", "{", "if", "(", "maxDimension", "!=", "0", ")", "{", "return", "maxDimension", ";", "}", "Point3d", "vert0", "=", "new", "Point3d", "(", "0", ",", "0", ",", "0", ")", ";", "Point3d", "vert1", "=", "new...
Gets the maximum dimension of the unit cell. @return
[ "Gets", "the", "maximum", "dimension", "of", "the", "unit", "cell", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java#L471-L498
31,634
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java
SiftsXMLParser.getSiftsSegment
private SiftsSegment getSiftsSegment(Element el) { String segId = el.getAttribute("segId"); String start = el.getAttribute("start"); String end = el.getAttribute("end"); SiftsSegment seg = new SiftsSegment(segId,start,end); if ( debug ) System.out.println("parsed " + seg); // get nodelist of se...
java
private SiftsSegment getSiftsSegment(Element el) { String segId = el.getAttribute("segId"); String start = el.getAttribute("start"); String end = el.getAttribute("end"); SiftsSegment seg = new SiftsSegment(segId,start,end); if ( debug ) System.out.println("parsed " + seg); // get nodelist of se...
[ "private", "SiftsSegment", "getSiftsSegment", "(", "Element", "el", ")", "{", "String", "segId", "=", "el", ".", "getAttribute", "(", "\"segId\"", ")", ";", "String", "start", "=", "el", ".", "getAttribute", "(", "\"start\"", ")", ";", "String", "end", "="...
segId="4hhb_A_1_140" start="1" end="140" @param el @return
[ "segId", "=", "4hhb_A_1_140", "start", "=", "1", "end", "=", "140" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java#L149-L181
31,635
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/ColorUtils.java
ColorUtils.rotateHue
public static Color rotateHue (Color color, float fraction) { float[] af = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null); float hue = af[0]; float saturation = af[1]; float brightness = af[2]; float hueNew = hue + fraction; Color hsb = Color.getHSBColor(hueNew, saturation, bri...
java
public static Color rotateHue (Color color, float fraction) { float[] af = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null); float hue = af[0]; float saturation = af[1]; float brightness = af[2]; float hueNew = hue + fraction; Color hsb = Color.getHSBColor(hueNew, saturation, bri...
[ "public", "static", "Color", "rotateHue", "(", "Color", "color", ",", "float", "fraction", ")", "{", "float", "[", "]", "af", "=", "Color", ".", "RGBtoHSB", "(", "color", ".", "getRed", "(", ")", ",", "color", ".", "getGreen", "(", ")", ",", "color",...
Rotate a color through HSB space @param color Starting color @param fraction Amount to add to the hue. The integer part is discarded to leave a number in [0,1) @return
[ "Rotate", "a", "color", "through", "HSB", "space" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/ColorUtils.java#L67-L79
31,636
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/client/FarmJobRunnable.java
FarmJobRunnable.getAlignmentPairsFromServer
protected PdbPairsMessage getAlignmentPairsFromServer() { String url = params.getServer(); int nrPairs = params.getStepSize(); if ( maxNrAlignments < nrPairs ) nrPairs = maxNrAlignments; SortedSet<PdbPair> allPairs = new TreeSet<PdbPair>(); PdbPairsMessage msg = null; try { if ( progressListe...
java
protected PdbPairsMessage getAlignmentPairsFromServer() { String url = params.getServer(); int nrPairs = params.getStepSize(); if ( maxNrAlignments < nrPairs ) nrPairs = maxNrAlignments; SortedSet<PdbPair> allPairs = new TreeSet<PdbPair>(); PdbPairsMessage msg = null; try { if ( progressListe...
[ "protected", "PdbPairsMessage", "getAlignmentPairsFromServer", "(", ")", "{", "String", "url", "=", "params", ".", "getServer", "(", ")", ";", "int", "nrPairs", "=", "params", ".", "getStepSize", "(", ")", ";", "if", "(", "maxNrAlignments", "<", "nrPairs", "...
talk to centralized server and fetch all alignments to run. @return a list of pairs to align.
[ "talk", "to", "centralized", "server", "and", "fetch", "all", "alignments", "to", "run", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/client/FarmJobRunnable.java#L524-L576
31,637
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.alignmentAsMap
public static Map<Integer, Integer> alignmentAsMap(AFPChain afpChain) throws StructureException { Map<Integer,Integer> map = new HashMap<Integer,Integer>(); if( afpChain.getAlnLength() < 1 ) { return map; } int[][][] optAln = afpChain.getOptAln(); int[] optLen = afpChain.getOptLen(); for(int block = 0; ...
java
public static Map<Integer, Integer> alignmentAsMap(AFPChain afpChain) throws StructureException { Map<Integer,Integer> map = new HashMap<Integer,Integer>(); if( afpChain.getAlnLength() < 1 ) { return map; } int[][][] optAln = afpChain.getOptAln(); int[] optLen = afpChain.getOptLen(); for(int block = 0; ...
[ "public", "static", "Map", "<", "Integer", ",", "Integer", ">", "alignmentAsMap", "(", "AFPChain", "afpChain", ")", "throws", "StructureException", "{", "Map", "<", "Integer", ",", "Integer", ">", "map", "=", "new", "HashMap", "<", "Integer", ",", "Integer",...
Creates a Map specifying the alignment as a mapping between residue indices of protein 1 and residue indices of protein 2. <p>For example,<pre> 1234 5678</pre> becomes<pre> 1->5 2->6 3->7 4->8</pre> @param afpChain An alignment @return A mapping from aligned residues of protein 1 to their partners in protein 2. @thro...
[ "Creates", "a", "Map", "specifying", "the", "alignment", "as", "a", "mapping", "between", "residue", "indices", "of", "protein", "1", "and", "residue", "indices", "of", "protein", "2", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L159-L178
31,638
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.getSymmetryOrder
public static int getSymmetryOrder(Map<Integer, Integer> alignment, Map<Integer,Integer> identity, final int maxSymmetry, final float minimumMetricChange) { List<Integer> preimage = new ArrayList<Integer>(alignment.keySet()); // currently unmodified List<Integer> image = new ArrayList<Integer>(preimage)...
java
public static int getSymmetryOrder(Map<Integer, Integer> alignment, Map<Integer,Integer> identity, final int maxSymmetry, final float minimumMetricChange) { List<Integer> preimage = new ArrayList<Integer>(alignment.keySet()); // currently unmodified List<Integer> image = new ArrayList<Integer>(preimage)...
[ "public", "static", "int", "getSymmetryOrder", "(", "Map", "<", "Integer", ",", "Integer", ">", "alignment", ",", "Map", "<", "Integer", ",", "Integer", ">", "identity", ",", "final", "int", "maxSymmetry", ",", "final", "float", "minimumMetricChange", ")", "...
Tries to detect symmetry in an alignment. <p>Conceptually, an alignment is a function f:A->B between two sets of integers. The function may have simple topology (meaning that if two elements of A are close, then their images in B will also be close), or may have more complex topology (such as a circular permutation). ...
[ "Tries", "to", "detect", "symmetry", "in", "an", "alignment", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L322-L383
31,639
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.getSymmetryOrder
public static int getSymmetryOrder(AFPChain afpChain, int maxSymmetry, float minimumMetricChange) throws StructureException { // alignment comes from the afpChain alignment Map<Integer,Integer> alignment = AlignmentTools.alignmentAsMap(afpChain); // Now construct identity to map aligned residues in sequential or...
java
public static int getSymmetryOrder(AFPChain afpChain, int maxSymmetry, float minimumMetricChange) throws StructureException { // alignment comes from the afpChain alignment Map<Integer,Integer> alignment = AlignmentTools.alignmentAsMap(afpChain); // Now construct identity to map aligned residues in sequential or...
[ "public", "static", "int", "getSymmetryOrder", "(", "AFPChain", "afpChain", ",", "int", "maxSymmetry", ",", "float", "minimumMetricChange", ")", "throws", "StructureException", "{", "// alignment comes from the afpChain alignment", "Map", "<", "Integer", ",", "Integer", ...
Guesses the order of symmetry in an alignment <p>Uses {@link #getSymmetryOrder(Map alignment, Map identity, int, float)} to determine the the symmetry order. For the identity alignment, sorts the aligned residues of each protein sequentially, then defines the ith residues of each protein to be equivalent. <p>Note tha...
[ "Guesses", "the", "order", "of", "symmetry", "in", "an", "alignment" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L400-L411
31,640
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.guessSequentialAlignment
public static Map<Integer, Integer> guessSequentialAlignment( Map<Integer,Integer> alignment, boolean inverseAlignment) { Map<Integer,Integer> identity = new HashMap<Integer,Integer>(); SortedSet<Integer> aligned1 = new TreeSet<Integer>(); SortedSet<Integer> aligned2 = new TreeSet<Integer>(); for(Entry<Int...
java
public static Map<Integer, Integer> guessSequentialAlignment( Map<Integer,Integer> alignment, boolean inverseAlignment) { Map<Integer,Integer> identity = new HashMap<Integer,Integer>(); SortedSet<Integer> aligned1 = new TreeSet<Integer>(); SortedSet<Integer> aligned2 = new TreeSet<Integer>(); for(Entry<Int...
[ "public", "static", "Map", "<", "Integer", ",", "Integer", ">", "guessSequentialAlignment", "(", "Map", "<", "Integer", ",", "Integer", ">", "alignment", ",", "boolean", "inverseAlignment", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "identity", "=...
Takes a potentially non-sequential alignment and guesses a sequential version of it. Residues from each structure are sorted sequentially and then compared directly. <p>The results of this method are consistent with what one might expect from an identity function, and are therefore useful with {@link #getSymmetryOrder...
[ "Takes", "a", "potentially", "non", "-", "sequential", "alignment", "and", "guesses", "a", "sequential", "version", "of", "it", ".", "Residues", "from", "each", "structure", "are", "sorted", "sequentially", "and", "then", "compared", "directly", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L444-L467
31,641
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.createAFPChain
public static AFPChain createAFPChain(Atom[] ca1, Atom[] ca2, ResidueNumber[] aligned1, ResidueNumber[] aligned2 ) throws StructureException { //input validation int alnLen = aligned1.length; if(alnLen != aligned2.length) { throw new IllegalArgumentException("Alignment lengths are not equal"); } ...
java
public static AFPChain createAFPChain(Atom[] ca1, Atom[] ca2, ResidueNumber[] aligned1, ResidueNumber[] aligned2 ) throws StructureException { //input validation int alnLen = aligned1.length; if(alnLen != aligned2.length) { throw new IllegalArgumentException("Alignment lengths are not equal"); } ...
[ "public", "static", "AFPChain", "createAFPChain", "(", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "ResidueNumber", "[", "]", "aligned1", ",", "ResidueNumber", "[", "]", "aligned2", ")", "throws", "StructureException", "{", "//input validation"...
Fundamentally, an alignment is just a list of aligned residues in each protein. This method converts two lists of ResidueNumbers into an AFPChain. <p>Parameters are filled with defaults (often null) or sometimes calculated. <p>For a way to modify the alignment of an existing AFPChain, see {@link AlignmentTools#replac...
[ "Fundamentally", "an", "alignment", "is", "just", "a", "list", "of", "aligned", "residues", "in", "each", "protein", ".", "This", "method", "converts", "two", "lists", "of", "ResidueNumbers", "into", "an", "AFPChain", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L567-L613
31,642
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.replaceOptAln
public static AFPChain replaceOptAln(int[][][] newAlgn, AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException { //The order is the number of groups in the newAlgn int order = newAlgn.length; //Calculate the alignment length from all the subunits lengths int[] optLens = new int[order]; for(int...
java
public static AFPChain replaceOptAln(int[][][] newAlgn, AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException { //The order is the number of groups in the newAlgn int order = newAlgn.length; //Calculate the alignment length from all the subunits lengths int[] optLens = new int[order]; for(int...
[ "public", "static", "AFPChain", "replaceOptAln", "(", "int", "[", "]", "[", "]", "[", "]", "newAlgn", ",", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ")", "throws", "StructureException", "{", "//The order is the num...
It replaces an optimal alignment of an AFPChain and calculates all the new alignment scores and variables.
[ "It", "replaces", "an", "optimal", "alignment", "of", "an", "AFPChain", "and", "calculates", "all", "the", "new", "alignment", "scores", "and", "variables", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L698-L737
31,643
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.replaceOptAln
public static AFPChain replaceOptAln(AFPChain afpChain, Atom[] ca1, Atom[] ca2, Map<Integer, Integer> alignment) throws StructureException { // Determine block lengths // Sort ca1 indices, then start a new block whenever ca2 indices aren't // increasing monotonically. Integer[] res1 = alignment.keyS...
java
public static AFPChain replaceOptAln(AFPChain afpChain, Atom[] ca1, Atom[] ca2, Map<Integer, Integer> alignment) throws StructureException { // Determine block lengths // Sort ca1 indices, then start a new block whenever ca2 indices aren't // increasing monotonically. Integer[] res1 = alignment.keyS...
[ "public", "static", "AFPChain", "replaceOptAln", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "Map", "<", "Integer", ",", "Integer", ">", "alignment", ")", "throws", "StructureException", "{", "// Determine bl...
Takes an AFPChain and replaces the optimal alignment based on an alignment map <p>Parameters are filled with defaults (often null) or sometimes calculated. <p>For a way to create a new AFPChain, see {@link AlignmentTools#createAFPChain(Atom[], Atom[], ResidueNumber[], ResidueNumber[])} @param afpChain The alignment ...
[ "Takes", "an", "AFPChain", "and", "replaces", "the", "optimal", "alignment", "based", "on", "an", "alignment", "map" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L753-L807
31,644
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.toConciseAlignmentString
public static <S,T> String toConciseAlignmentString(Map<S,T> alignment, Map<T,S> identity) { // Clone input to prevent changes Map<S,T> alig = new HashMap<S,T>(alignment); // Generate inverse alignment Map<S,List<S>> inverse = new HashMap<S,List<S>>(); for(Entry<S,T> e: alig.entrySet()) { S val = identity...
java
public static <S,T> String toConciseAlignmentString(Map<S,T> alignment, Map<T,S> identity) { // Clone input to prevent changes Map<S,T> alig = new HashMap<S,T>(alignment); // Generate inverse alignment Map<S,List<S>> inverse = new HashMap<S,List<S>>(); for(Entry<S,T> e: alig.entrySet()) { S val = identity...
[ "public", "static", "<", "S", ",", "T", ">", "String", "toConciseAlignmentString", "(", "Map", "<", "S", ",", "T", ">", "alignment", ",", "Map", "<", "T", ",", "S", ">", "identity", ")", "{", "// Clone input to prevent changes", "Map", "<", "S", ",", "...
Print an alignment map in a concise representation. Edges are given as two numbers separated by '>'. They are chained together where possible, or separated by spaces where disjoint or branched. <p>Note that more concise representations may be possible.</p> Examples: <li>1>2>3>1</li> <li>1>2>3>2 4>3</li> @param align...
[ "Print", "an", "alignment", "map", "in", "a", "concise", "representation", ".", "Edges", "are", "given", "as", "two", "numbers", "separated", "by", ">", ".", "They", "are", "chained", "together", "where", "possible", "or", "separated", "by", "spaces", "where...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L990-L1048
31,645
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.calculateBlockGap
public static int[] calculateBlockGap(int[][][] optAln){ //Initialize the array to be returned int [] blockGap = new int[optAln.length]; //Loop for every block and look in both chains for non-contiguous residues. for (int i=0; i<optAln.length; i++){ int gaps = 0; //the number of gaps in that block int l...
java
public static int[] calculateBlockGap(int[][][] optAln){ //Initialize the array to be returned int [] blockGap = new int[optAln.length]; //Loop for every block and look in both chains for non-contiguous residues. for (int i=0; i<optAln.length; i++){ int gaps = 0; //the number of gaps in that block int l...
[ "public", "static", "int", "[", "]", "calculateBlockGap", "(", "int", "[", "]", "[", "]", "[", "]", "optAln", ")", "{", "//Initialize the array to be returned", "int", "[", "]", "blockGap", "=", "new", "int", "[", "optAln", ".", "length", "]", ";", "//Lo...
Method that calculates the number of gaps in each subunit block of an optimal AFP alignment. INPUT: an optimal alignment in the format int[][][]. OUTPUT: an int[] array of <order> length containing the gaps in each block as int[block].
[ "Method", "that", "calculates", "the", "number", "of", "gaps", "in", "each", "subunit", "block", "of", "an", "optimal", "AFP", "alignment", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1083-L1117
31,646
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.getAlignedModel
public static final List<Chain> getAlignedModel(Atom[] ca){ List<Chain> model = new ArrayList<Chain>(); for ( Atom a: ca){ Group g = a.getGroup(); Chain parentC = g.getChain(); Chain newChain = null; for ( Chain c : model) { if ( c.getId().equals(parentC.getId())){ newChain = c; break;...
java
public static final List<Chain> getAlignedModel(Atom[] ca){ List<Chain> model = new ArrayList<Chain>(); for ( Atom a: ca){ Group g = a.getGroup(); Chain parentC = g.getChain(); Chain newChain = null; for ( Chain c : model) { if ( c.getId().equals(parentC.getId())){ newChain = c; break;...
[ "public", "static", "final", "List", "<", "Chain", ">", "getAlignedModel", "(", "Atom", "[", "]", "ca", ")", "{", "List", "<", "Chain", ">", "model", "=", "new", "ArrayList", "<", "Chain", ">", "(", ")", ";", "for", "(", "Atom", "a", ":", "ca", "...
get an artificial List of chains containing the Atoms and groups. Does NOT rotate anything. @param ca @return a list of Chains that is built up from the Atoms in the ca array @throws StructureException
[ "get", "an", "artificial", "List", "of", "chains", "containing", "the", "Atoms", "and", "groups", ".", "Does", "NOT", "rotate", "anything", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1202-L1231
31,647
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.getAlignedStructure
public static final Structure getAlignedStructure(Atom[] ca1, Atom[] ca2) throws StructureException{ /* Previous implementation commented Structure s = new StructureImpl(); List<Chain>model1 = getAlignedModel(ca1); List<Chain>model2 = getAlignedModel(ca2); s.addModel(model1); s.addModel(model2); retu...
java
public static final Structure getAlignedStructure(Atom[] ca1, Atom[] ca2) throws StructureException{ /* Previous implementation commented Structure s = new StructureImpl(); List<Chain>model1 = getAlignedModel(ca1); List<Chain>model2 = getAlignedModel(ca2); s.addModel(model1); s.addModel(model2); retu...
[ "public", "static", "final", "Structure", "getAlignedStructure", "(", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ")", "throws", "StructureException", "{", "/* Previous implementation commented\n\n\t\tStructure s = new StructureImpl();\n\n\n\t\tList<Chain>model1 = ge...
Get an artifical Structure containing both chains. Does NOT rotate anything @param ca1 @param ca2 @return a structure object containing two models, one for each set of Atoms. @throws StructureException
[ "Get", "an", "artifical", "Structure", "containing", "both", "chains", ".", "Does", "NOT", "rotate", "anything" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1241-L1263
31,648
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.shiftCA2
public static void shiftCA2(AFPChain afpChain, Atom[] ca2, Matrix m, Atom shift, Group[] twistedGroups) { int i = -1; for (Atom a: ca2){ i++; Group g = a.getGroup(); Calc.rotate(g,m); Calc.shift(g, shift); if (g.hasAltLoc()){ for (Group alt: g.getAltLocs()){ for (Atom alta : alt.getAtoms...
java
public static void shiftCA2(AFPChain afpChain, Atom[] ca2, Matrix m, Atom shift, Group[] twistedGroups) { int i = -1; for (Atom a: ca2){ i++; Group g = a.getGroup(); Calc.rotate(g,m); Calc.shift(g, shift); if (g.hasAltLoc()){ for (Group alt: g.getAltLocs()){ for (Atom alta : alt.getAtoms...
[ "public", "static", "void", "shiftCA2", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca2", ",", "Matrix", "m", ",", "Atom", "shift", ",", "Group", "[", "]", "twistedGroups", ")", "{", "int", "i", "=", "-", "1", ";", "for", "(", "Atom", "a",...
only shift CA positions.
[ "only", "shift", "CA", "positions", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1340-L1362
31,649
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.fillAlignedAtomArrays
public static void fillAlignedAtomArrays(AFPChain afpChain, Atom[] ca1, Atom[] ca2, Atom[] ca1aligned, Atom[] ca2aligned) { int pos=0; int[] blockLens = afpChain.getOptLen(); int[][][] optAln = afpChain.getOptAln(); assert(afpChain.getBlockNum() <= optAln.length); for (int block=0; block < afpChain.getBl...
java
public static void fillAlignedAtomArrays(AFPChain afpChain, Atom[] ca1, Atom[] ca2, Atom[] ca1aligned, Atom[] ca2aligned) { int pos=0; int[] blockLens = afpChain.getOptLen(); int[][][] optAln = afpChain.getOptAln(); assert(afpChain.getBlockNum() <= optAln.length); for (int block=0; block < afpChain.getBl...
[ "public", "static", "void", "fillAlignedAtomArrays", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "Atom", "[", "]", "ca1aligned", ",", "Atom", "[", "]", "ca2aligned", ")", "{", "int", "pos", "=", "0", ...
Fill the aligned Atom arrays with the equivalent residues in the afpChain. @param afpChain @param ca1 @param ca2 @param ca1aligned @param ca2aligned
[ "Fill", "the", "aligned", "Atom", "arrays", "with", "the", "equivalent", "residues", "in", "the", "afpChain", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1372-L1400
31,650
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.deleteHighestDistanceColumn
public static AFPChain deleteHighestDistanceColumn(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException { int[][][] optAln = afpChain.getOptAln(); int maxBlock = 0; int maxPos = 0; double maxDistance = Double.MIN_VALUE; for (int b = 0; b < optAln.length; b++) { for (int p = 0; p < opt...
java
public static AFPChain deleteHighestDistanceColumn(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException { int[][][] optAln = afpChain.getOptAln(); int maxBlock = 0; int maxPos = 0; double maxDistance = Double.MIN_VALUE; for (int b = 0; b < optAln.length; b++) { for (int p = 0; p < opt...
[ "public", "static", "AFPChain", "deleteHighestDistanceColumn", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ")", "throws", "StructureException", "{", "int", "[", "]", "[", "]", "[", "]", "optAln", "=", "afpChain"...
Find the alignment position with the highest atomic distance between the equivalent atomic positions of the arrays and remove it from the alignment. @param afpChain original alignment, will be modified @param ca1 atom array, will not be modified @param ca2 atom array, will not be modified @return the original alignmen...
[ "Find", "the", "alignment", "position", "with", "the", "highest", "atomic", "distance", "between", "the", "equivalent", "atomic", "positions", "of", "the", "arrays", "and", "remove", "it", "from", "the", "alignment", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1417-L1443
31,651
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
AlignmentTools.deleteColumn
public static AFPChain deleteColumn(AFPChain afpChain, Atom[] ca1, Atom[] ca2, int block, int pos) throws StructureException { // Check validity of the inputs if (afpChain.getBlockNum() <= block) { throw new IndexOutOfBoundsException(String.format( "Block index requested (%d) is higher than the total nu...
java
public static AFPChain deleteColumn(AFPChain afpChain, Atom[] ca1, Atom[] ca2, int block, int pos) throws StructureException { // Check validity of the inputs if (afpChain.getBlockNum() <= block) { throw new IndexOutOfBoundsException(String.format( "Block index requested (%d) is higher than the total nu...
[ "public", "static", "AFPChain", "deleteColumn", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "int", "block", ",", "int", "pos", ")", "throws", "StructureException", "{", "// Check validity of the inputs", "if", ...
Delete an alignment position from the original alignment object. @param afpChain original alignment, will be modified @param ca1 atom array, will not be modified @param ca2 atom array, will not be modified @param block block of the alignment position @param pos position index in the block @return the original alignmen...
[ "Delete", "an", "alignment", "position", "from", "the", "original", "alignment", "object", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1461-L1497
31,652
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.identify
public void identify(final Structure structure, final Set<ProteinModification> potentialModifications) { if (structure==null) { throw new IllegalArgumentException("Null structure."); } identify(structure.getChains(), potentialModifications); }
java
public void identify(final Structure structure, final Set<ProteinModification> potentialModifications) { if (structure==null) { throw new IllegalArgumentException("Null structure."); } identify(structure.getChains(), potentialModifications); }
[ "public", "void", "identify", "(", "final", "Structure", "structure", ",", "final", "Set", "<", "ProteinModification", ">", "potentialModifications", ")", "{", "if", "(", "structure", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Nu...
Identify a set of modifications in a structure. @param structure query {@link Structure}. @param potentialModifications query {@link ProteinModification}s.
[ "Identify", "a", "set", "of", "modifications", "in", "a", "structure", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L211-L218
31,653
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.identify
public void identify(final Chain chain, final Set<ProteinModification> potentialModifications) { identify(Collections.singletonList(chain), potentialModifications); }
java
public void identify(final Chain chain, final Set<ProteinModification> potentialModifications) { identify(Collections.singletonList(chain), potentialModifications); }
[ "public", "void", "identify", "(", "final", "Chain", "chain", ",", "final", "Set", "<", "ProteinModification", ">", "potentialModifications", ")", "{", "identify", "(", "Collections", ".", "singletonList", "(", "chain", ")", ",", "potentialModifications", ")", "...
Identify a set of modifications in a a chains. @param chain query {@link Chain}. @param potentialModifications query {@link ProteinModification}s.
[ "Identify", "a", "set", "of", "modifications", "in", "a", "a", "chains", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L241-L244
31,654
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.identify
public void identify(final List<Chain> chains, final Set<ProteinModification> potentialModifications) { if (chains==null) { throw new IllegalArgumentException("Null structure."); } if (potentialModifications==null) { throw new IllegalArgumentException("Null potentialModifications."); } reset(); ...
java
public void identify(final List<Chain> chains, final Set<ProteinModification> potentialModifications) { if (chains==null) { throw new IllegalArgumentException("Null structure."); } if (potentialModifications==null) { throw new IllegalArgumentException("Null potentialModifications."); } reset(); ...
[ "public", "void", "identify", "(", "final", "List", "<", "Chain", ">", "chains", ",", "final", "Set", "<", "ProteinModification", ">", "potentialModifications", ")", "{", "if", "(", "chains", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", ...
Identify a set of modifications in a a list of chains. @param chains query {@link Chain}s. @param potentialModifications query {@link ProteinModification}s.
[ "Identify", "a", "set", "of", "modifications", "in", "a", "a", "list", "of", "chains", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L251-L333
31,655
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.identifyAdditionalAttachments
private void identifyAdditionalAttachments(ModifiedCompound mc, List<Group> ligands, List<Chain> chains) { if (ligands.isEmpty()) { return; } // TODO: should the additional groups only be allowed to the identified // ligands or both amino acids and ligands? Currently only on ligands // ligands to amino...
java
private void identifyAdditionalAttachments(ModifiedCompound mc, List<Group> ligands, List<Chain> chains) { if (ligands.isEmpty()) { return; } // TODO: should the additional groups only be allowed to the identified // ligands or both amino acids and ligands? Currently only on ligands // ligands to amino...
[ "private", "void", "identifyAdditionalAttachments", "(", "ModifiedCompound", "mc", ",", "List", "<", "Group", ">", "ligands", ",", "List", "<", "Chain", ">", "chains", ")", "{", "if", "(", "ligands", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}"...
identify additional groups that are not directly attached to amino acids. @param mc {@link ModifiedCompound} @param ligands {@link Group} @param chains List of {@link Chain}s @return a list of added groups
[ "identify", "additional", "groups", "that", "are", "not", "directly", "attached", "to", "amino", "acids", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L384-L444
31,656
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.mergeModComps
private void mergeModComps(List<ModifiedCompound> modComps) { TreeSet<Integer> remove = new TreeSet<Integer>(); int n = modComps.size(); for (int icurr=1; icurr<n; icurr++) { ModifiedCompound curr = modComps.get(icurr); String id = curr.getModification().getId(); if (ProteinModificationRegistry.getById(...
java
private void mergeModComps(List<ModifiedCompound> modComps) { TreeSet<Integer> remove = new TreeSet<Integer>(); int n = modComps.size(); for (int icurr=1; icurr<n; icurr++) { ModifiedCompound curr = modComps.get(icurr); String id = curr.getModification().getId(); if (ProteinModificationRegistry.getById(...
[ "private", "void", "mergeModComps", "(", "List", "<", "ModifiedCompound", ">", "modComps", ")", "{", "TreeSet", "<", "Integer", ">", "remove", "=", "new", "TreeSet", "<", "Integer", ">", "(", ")", ";", "int", "n", "=", "modComps", ".", "size", "(", ")"...
Merge identified modified compounds if linked.
[ "Merge", "identified", "modified", "compounds", "if", "linked", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L466-L505
31,657
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.recordUnidentifiableAtomLinkages
private void recordUnidentifiableAtomLinkages(List<ModifiedCompound> modComps, List<Group> ligands) { // first put identified linkages in a map for fast query Set<StructureAtomLinkage> identifiedLinkages = new HashSet<StructureAtomLinkage>(); for (ModifiedCompound mc : modComps) { identifiedLinkages.addAll...
java
private void recordUnidentifiableAtomLinkages(List<ModifiedCompound> modComps, List<Group> ligands) { // first put identified linkages in a map for fast query Set<StructureAtomLinkage> identifiedLinkages = new HashSet<StructureAtomLinkage>(); for (ModifiedCompound mc : modComps) { identifiedLinkages.addAll...
[ "private", "void", "recordUnidentifiableAtomLinkages", "(", "List", "<", "ModifiedCompound", ">", "modComps", ",", "List", "<", "Group", ">", "ligands", ")", "{", "// first put identified linkages in a map for fast query", "Set", "<", "StructureAtomLinkage", ">", "identif...
Record unidentifiable atom linkages in a chain. Only linkages between two residues or one residue and one ligand will be recorded.
[ "Record", "unidentifiable", "atom", "linkages", "in", "a", "chain", ".", "Only", "linkages", "between", "two", "residues", "or", "one", "residue", "and", "one", "ligand", "will", "be", "recorded", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L511-L555
31,658
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.getMatchedAtomsOfLinkages
private List<List<Atom[]>> getMatchedAtomsOfLinkages( ModificationCondition condition, Map<Component, Set<Group>> mapCompGroups) { List<ModificationLinkage> linkages = condition.getLinkages(); int nLink = linkages.size(); List<List<Atom[]>> matchedAtomsOfLinkages = new ArrayList<List<Atom[]>>(nLink); f...
java
private List<List<Atom[]>> getMatchedAtomsOfLinkages( ModificationCondition condition, Map<Component, Set<Group>> mapCompGroups) { List<ModificationLinkage> linkages = condition.getLinkages(); int nLink = linkages.size(); List<List<Atom[]>> matchedAtomsOfLinkages = new ArrayList<List<Atom[]>>(nLink); f...
[ "private", "List", "<", "List", "<", "Atom", "[", "]", ">", ">", "getMatchedAtomsOfLinkages", "(", "ModificationCondition", "condition", ",", "Map", "<", "Component", ",", "Set", "<", "Group", ">", ">", "mapCompGroups", ")", "{", "List", "<", "ModificationLi...
Get matched atoms for all linkages.
[ "Get", "matched", "atoms", "for", "all", "linkages", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L725-L798
31,659
biojava/biojava
biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
ProteinModificationIdentifier.assembleLinkages
private void assembleLinkages(List<List<Atom[]>> matchedAtomsOfLinkages, ProteinModification mod, List<ModifiedCompound> ret) { ModificationCondition condition = mod.getCondition(); List<ModificationLinkage> modLinks = condition.getLinkages(); int nLink = matchedAtomsOfLinkages.size(); int[] indices = new i...
java
private void assembleLinkages(List<List<Atom[]>> matchedAtomsOfLinkages, ProteinModification mod, List<ModifiedCompound> ret) { ModificationCondition condition = mod.getCondition(); List<ModificationLinkage> modLinks = condition.getLinkages(); int nLink = matchedAtomsOfLinkages.size(); int[] indices = new i...
[ "private", "void", "assembleLinkages", "(", "List", "<", "List", "<", "Atom", "[", "]", ">", ">", "matchedAtomsOfLinkages", ",", "ProteinModification", "mod", ",", "List", "<", "ModifiedCompound", ">", "ret", ")", "{", "ModificationCondition", "condition", "=", ...
Assembly the matched linkages @param matchedAtomsOfLinkages @param mod @param ret ModifiedCompound will be stored here
[ "Assembly", "the", "matched", "linkages" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java#L806-L852
31,660
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/CoordManager.java
CoordManager.getSeqPos
protected int getSeqPos(int panelPos){ int seqPos = Math.round((panelPos - SequenceScalePanel.DEFAULT_X_START) / scale) ; if ( seqPos < 0) seqPos = 0; //int length = chainLength; //if ( seqPos >= length) // seqPos = length-1; return seqPos; }
java
protected int getSeqPos(int panelPos){ int seqPos = Math.round((panelPos - SequenceScalePanel.DEFAULT_X_START) / scale) ; if ( seqPos < 0) seqPos = 0; //int length = chainLength; //if ( seqPos >= length) // seqPos = length-1; return seqPos; }
[ "protected", "int", "getSeqPos", "(", "int", "panelPos", ")", "{", "int", "seqPos", "=", "Math", ".", "round", "(", "(", "panelPos", "-", "SequenceScalePanel", ".", "DEFAULT_X_START", ")", "/", "scale", ")", ";", "if", "(", "seqPos", "<", "0", ")", "se...
start counting at 0... @param panelPos @return the sequence position
[ "start", "counting", "at", "0", "..." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/CoordManager.java#L59-L69
31,661
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorCn.java
JmolSymmetryScriptGeneratorCn.getOrientationName
@Override public String getOrientationName(int index) { if (getAxisTransformation().getRotationGroup().getPointGroup().equals("C2")) { if (index == 0) { return "Front C2 axis"; } else if (index == 2) { return "Back C2 axis"; } } return getPolyhedron().getViewName(index); }
java
@Override public String getOrientationName(int index) { if (getAxisTransformation().getRotationGroup().getPointGroup().equals("C2")) { if (index == 0) { return "Front C2 axis"; } else if (index == 2) { return "Back C2 axis"; } } return getPolyhedron().getViewName(index); }
[ "@", "Override", "public", "String", "getOrientationName", "(", "int", "index", ")", "{", "if", "(", "getAxisTransformation", "(", ")", ".", "getRotationGroup", "(", ")", ".", "getPointGroup", "(", ")", ".", "equals", "(", "\"C2\"", ")", ")", "{", "if", ...
Returns the name of a specific orientation @param index orientation index @return name of orientation
[ "Returns", "the", "name", "of", "a", "specific", "orientation" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorCn.java#L78-L88
31,662
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/UserConfiguration.java
UserConfiguration.toXML
public XMLWriter toXML(PrintWriter pw) throws IOException { XMLWriter xw = new PrettyXMLWriter( pw); toXML(xw); return xw ; }
java
public XMLWriter toXML(PrintWriter pw) throws IOException { XMLWriter xw = new PrettyXMLWriter( pw); toXML(xw); return xw ; }
[ "public", "XMLWriter", "toXML", "(", "PrintWriter", "pw", ")", "throws", "IOException", "{", "XMLWriter", "xw", "=", "new", "PrettyXMLWriter", "(", "pw", ")", ";", "toXML", "(", "xw", ")", ";", "return", "xw", ";", "}" ]
convert Configuration to an XML file so it can be serialized @param pw @return XMLWriter @throws IOException
[ "convert", "Configuration", "to", "an", "XML", "file", "so", "it", "can", "be", "serialized" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/UserConfiguration.java#L290-L298
31,663
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/UserConfiguration.java
UserConfiguration.toXML
public XMLWriter toXML(XMLWriter xw) throws IOException { xw.printRaw("<?xml version='1.0' standalone='no' ?>"); //xw.printRaw("<!DOCTYPE " + XML_CONTENT_TYPE + " SYSTEM '" + XML_DTD + "' >"); xw.openTag("JFatCatConfig"); xw.openTag("PDBFILEPATH"); // we don;t serialize the tempdir... String tempdir ...
java
public XMLWriter toXML(XMLWriter xw) throws IOException { xw.printRaw("<?xml version='1.0' standalone='no' ?>"); //xw.printRaw("<!DOCTYPE " + XML_CONTENT_TYPE + " SYSTEM '" + XML_DTD + "' >"); xw.openTag("JFatCatConfig"); xw.openTag("PDBFILEPATH"); // we don;t serialize the tempdir... String tempdir ...
[ "public", "XMLWriter", "toXML", "(", "XMLWriter", "xw", ")", "throws", "IOException", "{", "xw", ".", "printRaw", "(", "\"<?xml version='1.0' standalone='no' ?>\"", ")", ";", "//xw.printRaw(\"<!DOCTYPE \" + XML_CONTENT_TYPE + \" SYSTEM '\" + XML_DTD + \"' >\");", "xw", ".", "...
convert Configuration to an XML file so it can be serialized add to an already existing xml file. @param xw the XML writer to use @return the writer again @throws IOException @see org.biojava.nbio.structure.align.webstart.ConfigXMLHandler
[ "convert", "Configuration", "to", "an", "XML", "file", "so", "it", "can", "be", "serialized", "add", "to", "an", "already", "existing", "xml", "file", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/UserConfiguration.java#L310-L331
31,664
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/search/io/blast/BlastXMLParser.java
BlastXMLParser.mapIds
private void mapIds() { if (queryReferences != null) { queryReferencesMap = new HashMap<String,Sequence>(queryReferences.size()); for (int counter=0; counter < queryReferences.size() ; counter ++){ String id = "Query_"+(counter+1); queryReferencesMap.put(id, queryReferences.get(counter)); } } if...
java
private void mapIds() { if (queryReferences != null) { queryReferencesMap = new HashMap<String,Sequence>(queryReferences.size()); for (int counter=0; counter < queryReferences.size() ; counter ++){ String id = "Query_"+(counter+1); queryReferencesMap.put(id, queryReferences.get(counter)); } } if...
[ "private", "void", "mapIds", "(", ")", "{", "if", "(", "queryReferences", "!=", "null", ")", "{", "queryReferencesMap", "=", "new", "HashMap", "<", "String", ",", "Sequence", ">", "(", "queryReferences", ".", "size", "(", ")", ")", ";", "for", "(", "in...
fill the map association between sequences an a unique id
[ "fill", "the", "map", "association", "between", "sequences", "an", "a", "unique", "id" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/search/io/blast/BlastXMLParser.java#L216-L233
31,665
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java
StructureInterfaceList.sort
public void sort() { Collections.sort(list); int i=1; for (StructureInterface interf:list) { interf.setId(i); i++; } }
java
public void sort() { Collections.sort(list); int i=1; for (StructureInterface interf:list) { interf.setId(i); i++; } }
[ "public", "void", "sort", "(", ")", "{", "Collections", ".", "sort", "(", "list", ")", ";", "int", "i", "=", "1", ";", "for", "(", "StructureInterface", "interf", ":", "list", ")", "{", "interf", ".", "setId", "(", "i", ")", ";", "i", "++", ";", ...
Sorts the interface list and reassigns ids based on new sorting
[ "Sorts", "the", "interface", "list", "and", "reassigns", "ids", "based", "on", "new", "sorting" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java#L248-L255
31,666
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java
StructureInterfaceList.addNcsEquivalent
public void addNcsEquivalent(StructureInterface interfaceNew, StructureInterface interfaceRef) { this.add(interfaceNew); if (clustersNcs == null) { clustersNcs = new ArrayList<>(); } if (interfaceRef == null) { StructureInterfaceCluster newCluster = new StructureInterfaceCluster(); newCluster.addMemb...
java
public void addNcsEquivalent(StructureInterface interfaceNew, StructureInterface interfaceRef) { this.add(interfaceNew); if (clustersNcs == null) { clustersNcs = new ArrayList<>(); } if (interfaceRef == null) { StructureInterfaceCluster newCluster = new StructureInterfaceCluster(); newCluster.addMemb...
[ "public", "void", "addNcsEquivalent", "(", "StructureInterface", "interfaceNew", ",", "StructureInterface", "interfaceRef", ")", "{", "this", ".", "add", "(", "interfaceNew", ")", ";", "if", "(", "clustersNcs", "==", "null", ")", "{", "clustersNcs", "=", "new", ...
Add an interface to the list, possibly defining it as NCS-equivalent to an interface already in the list. Used to build up the NCS clustering. @param interfaceNew an interface to be added to the list. @param interfaceRef interfaceNew will be added to the cluster which contains interfaceRef. If interfaceRef is null, new...
[ "Add", "an", "interface", "to", "the", "list", "possibly", "defining", "it", "as", "NCS", "-", "equivalent", "to", "an", "interface", "already", "in", "the", "list", ".", "Used", "to", "build", "up", "the", "NCS", "clustering", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java#L279-L311
31,667
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java
StructureInterfaceList.calculateInterfaces
public static StructureInterfaceList calculateInterfaces(Structure struc) { CrystalBuilder builder = new CrystalBuilder(struc); StructureInterfaceList interfaces = builder.getUniqueInterfaces(); logger.debug("Calculating ASA for "+interfaces.size()+" potential interfaces"); interfaces.calcAsas(StructureInterfac...
java
public static StructureInterfaceList calculateInterfaces(Structure struc) { CrystalBuilder builder = new CrystalBuilder(struc); StructureInterfaceList interfaces = builder.getUniqueInterfaces(); logger.debug("Calculating ASA for "+interfaces.size()+" potential interfaces"); interfaces.calcAsas(StructureInterfac...
[ "public", "static", "StructureInterfaceList", "calculateInterfaces", "(", "Structure", "struc", ")", "{", "CrystalBuilder", "builder", "=", "new", "CrystalBuilder", "(", "struc", ")", ";", "StructureInterfaceList", "interfaces", "=", "builder", ".", "getUniqueInterfaces...
Calculates the interfaces for a structure using default parameters @param struc @return
[ "Calculates", "the", "interfaces", "for", "a", "structure", "using", "default", "parameters" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java#L462-L473
31,668
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/phylo/ForesterWrapper.java
ForesterWrapper.getNewickString
public static String getNewickString(Phylogeny phylo, boolean writeDistances) throws IOException { PhylogenyWriter w = new PhylogenyWriter(); StringBuffer newickString = w.toNewHampshire(phylo, writeDistances); return newickString.toString(); }
java
public static String getNewickString(Phylogeny phylo, boolean writeDistances) throws IOException { PhylogenyWriter w = new PhylogenyWriter(); StringBuffer newickString = w.toNewHampshire(phylo, writeDistances); return newickString.toString(); }
[ "public", "static", "String", "getNewickString", "(", "Phylogeny", "phylo", ",", "boolean", "writeDistances", ")", "throws", "IOException", "{", "PhylogenyWriter", "w", "=", "new", "PhylogenyWriter", "(", ")", ";", "StringBuffer", "newickString", "=", "w", ".", ...
Convert a Phylogenetic tree to its Newick representation, so that it can be exported to an external application. @param phylo Phylogeny phylogenetic tree @param writeDistances write the branch lengths if true @return @throws IOException
[ "Convert", "a", "Phylogenetic", "tree", "to", "its", "Newick", "representation", "so", "that", "it", "can", "be", "exported", "to", "an", "external", "application", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/phylo/ForesterWrapper.java#L94-L100
31,669
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/phylo/ForesterWrapper.java
ForesterWrapper.cloneDM
public static BasicSymmetricalDistanceMatrix cloneDM( BasicSymmetricalDistanceMatrix distM) { int n = distM.getSize(); BasicSymmetricalDistanceMatrix cloneDM = new BasicSymmetricalDistanceMatrix(n); for (int i = 0; i < n; i++) { cloneDM.setIdentifier(i, distM.getIdentifier(i)); for (int j = i + 1; ...
java
public static BasicSymmetricalDistanceMatrix cloneDM( BasicSymmetricalDistanceMatrix distM) { int n = distM.getSize(); BasicSymmetricalDistanceMatrix cloneDM = new BasicSymmetricalDistanceMatrix(n); for (int i = 0; i < n; i++) { cloneDM.setIdentifier(i, distM.getIdentifier(i)); for (int j = i + 1; ...
[ "public", "static", "BasicSymmetricalDistanceMatrix", "cloneDM", "(", "BasicSymmetricalDistanceMatrix", "distM", ")", "{", "int", "n", "=", "distM", ".", "getSize", "(", ")", ";", "BasicSymmetricalDistanceMatrix", "cloneDM", "=", "new", "BasicSymmetricalDistanceMatrix", ...
Helper function to clone a forester symmetrical DistanceMatrix. @param distM forester symmetrical DistanceMatrix @return identical copy of the forester symmetrical DistanceMatrix
[ "Helper", "function", "to", "clone", "a", "forester", "symmetrical", "DistanceMatrix", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/phylo/ForesterWrapper.java#L109-L123
31,670
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContact.java
GroupContact.getContactsWithinDistance
public List<AtomContact> getContactsWithinDistance(double distance) { List<AtomContact> list = new ArrayList<AtomContact>(); for (AtomContact contact:this.atomContacts) { if (contact.getDistance()<distance) { list.add(contact); } } return list; }
java
public List<AtomContact> getContactsWithinDistance(double distance) { List<AtomContact> list = new ArrayList<AtomContact>(); for (AtomContact contact:this.atomContacts) { if (contact.getDistance()<distance) { list.add(contact); } } return list; }
[ "public", "List", "<", "AtomContact", ">", "getContactsWithinDistance", "(", "double", "distance", ")", "{", "List", "<", "AtomContact", ">", "list", "=", "new", "ArrayList", "<", "AtomContact", ">", "(", ")", ";", "for", "(", "AtomContact", "contact", ":", ...
Returns the list of atom contacts in this GroupContact that are within the given distance. @param distance @return
[ "Returns", "the", "list", "of", "atom", "contacts", "in", "this", "GroupContact", "that", "are", "within", "the", "given", "distance", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContact.java#L83-L92
31,671
biojava/biojava
biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/xml/AminoAcidCompositionTable.java
AminoAcidCompositionTable.computeMolecularWeight
public void computeMolecularWeight(ElementTable eTable){ this.aaSymbol2MolecularWeight = new HashMap<Character, Double>(); for(AminoAcidComposition a:aminoacid){ //Check to ensure that the symbol is of single character if(a.getSymbol().length() != 1){ throw new Error(a.getSymbol() + " is not allowed. Symb...
java
public void computeMolecularWeight(ElementTable eTable){ this.aaSymbol2MolecularWeight = new HashMap<Character, Double>(); for(AminoAcidComposition a:aminoacid){ //Check to ensure that the symbol is of single character if(a.getSymbol().length() != 1){ throw new Error(a.getSymbol() + " is not allowed. Symb...
[ "public", "void", "computeMolecularWeight", "(", "ElementTable", "eTable", ")", "{", "this", ".", "aaSymbol2MolecularWeight", "=", "new", "HashMap", "<", "Character", ",", "Double", ">", "(", ")", ";", "for", "(", "AminoAcidComposition", "a", ":", "aminoacid", ...
Computes and store the molecular weight of each amino acid by its symbol in aaSymbol2MolecularWeight. @param eTable Stores the mass of elements and isotopes
[ "Computes", "and", "store", "the", "molecular", "weight", "of", "each", "amino", "acid", "by", "its", "symbol", "in", "aaSymbol2MolecularWeight", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/xml/AminoAcidCompositionTable.java#L85-L126
31,672
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContactSet.java
GroupContactSet.hasContact
public boolean hasContact(Group group1, Group group2) { return hasContact(group1.getResidueNumber(),group2.getResidueNumber()); }
java
public boolean hasContact(Group group1, Group group2) { return hasContact(group1.getResidueNumber(),group2.getResidueNumber()); }
[ "public", "boolean", "hasContact", "(", "Group", "group1", ",", "Group", "group2", ")", "{", "return", "hasContact", "(", "group1", ".", "getResidueNumber", "(", ")", ",", "group2", ".", "getResidueNumber", "(", ")", ")", ";", "}" ]
Tell whether the given group pair is a contact in this GroupContactSet, the comparison is done by matching residue numbers and chain identifiers @param group1 @param group2 @return
[ "Tell", "whether", "the", "given", "group", "pair", "is", "a", "contact", "in", "this", "GroupContactSet", "the", "comparison", "is", "done", "by", "matching", "residue", "numbers", "and", "chain", "identifiers" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContactSet.java#L105-L107
31,673
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContactSet.java
GroupContactSet.hasContact
public boolean hasContact(ResidueNumber resNumber1, ResidueNumber resNumber2) { return contacts.containsKey(new Pair<ResidueNumber>(resNumber1, resNumber2)); }
java
public boolean hasContact(ResidueNumber resNumber1, ResidueNumber resNumber2) { return contacts.containsKey(new Pair<ResidueNumber>(resNumber1, resNumber2)); }
[ "public", "boolean", "hasContact", "(", "ResidueNumber", "resNumber1", ",", "ResidueNumber", "resNumber2", ")", "{", "return", "contacts", ".", "containsKey", "(", "new", "Pair", "<", "ResidueNumber", ">", "(", "resNumber1", ",", "resNumber2", ")", ")", ";", "...
Tell whether the given pair is a contact in this GroupContactSet, the comparison is done by matching residue numbers and chain identifiers @param resNumber1 @param resNumber2 @return
[ "Tell", "whether", "the", "given", "pair", "is", "a", "contact", "in", "this", "GroupContactSet", "the", "comparison", "is", "done", "by", "matching", "residue", "numbers", "and", "chain", "identifiers" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContactSet.java#L116-L118
31,674
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContactSet.java
GroupContactSet.getContact
public GroupContact getContact(Group group1, Group group2) { return contacts.get( new Pair<ResidueNumber>(group1.getResidueNumber(),group2.getResidueNumber())); }
java
public GroupContact getContact(Group group1, Group group2) { return contacts.get( new Pair<ResidueNumber>(group1.getResidueNumber(),group2.getResidueNumber())); }
[ "public", "GroupContact", "getContact", "(", "Group", "group1", ",", "Group", "group2", ")", "{", "return", "contacts", ".", "get", "(", "new", "Pair", "<", "ResidueNumber", ">", "(", "group1", ".", "getResidueNumber", "(", ")", ",", "group2", ".", "getRes...
Returns the corresponding GroupContact or null if no contact exists between the 2 given groups @param group1 @param group2 @return
[ "Returns", "the", "corresponding", "GroupContact", "or", "null", "if", "no", "contact", "exists", "between", "the", "2", "given", "groups" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContactSet.java#L140-L143
31,675
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/Mutator.java
Mutator.mutate
public Structure mutate(Structure struc, String chainId, String pdbResnum, String newType) throws PDBParseException{ // create a container for the new structure Structure newstruc = new StructureImpl(); // first we need to find our corresponding chain // get the chains for model nr. 0 // if structure i...
java
public Structure mutate(Structure struc, String chainId, String pdbResnum, String newType) throws PDBParseException{ // create a container for the new structure Structure newstruc = new StructureImpl(); // first we need to find our corresponding chain // get the chains for model nr. 0 // if structure i...
[ "public", "Structure", "mutate", "(", "Structure", "struc", ",", "String", "chainId", ",", "String", "pdbResnum", ",", "String", "newType", ")", "throws", "PDBParseException", "{", "// create a container for the new structure", "Structure", "newstruc", "=", "new", "S...
creates a new structure which is identical with the original one. only one amino acid will be different. @param struc the structure object that is the container for the residue to be mutated @param chainId the id (name) of the chain to be mutated. @see Chain.getName() @param pdbResnum the PDB residue number of the ...
[ "creates", "a", "new", "structure", "which", "is", "identical", "with", "the", "original", "one", ".", "only", "one", "amino", "acid", "will", "be", "different", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Mutator.java#L83-L134
31,676
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/Mutator.java
Mutator.mutateResidue
public AminoAcid mutateResidue(AminoAcid oldAmino, String newType) throws PDBParseException { AminoAcid newgroup = new AminoAcidImpl(); newgroup.setResidueNumber(oldAmino.getResidueNumber()); newgroup.setPDBName(newType); AtomIterator aiter =new AtomIterator(oldAmino); while (aiter.hasNext()){ Atom a ...
java
public AminoAcid mutateResidue(AminoAcid oldAmino, String newType) throws PDBParseException { AminoAcid newgroup = new AminoAcidImpl(); newgroup.setResidueNumber(oldAmino.getResidueNumber()); newgroup.setPDBName(newType); AtomIterator aiter =new AtomIterator(oldAmino); while (aiter.hasNext()){ Atom a ...
[ "public", "AminoAcid", "mutateResidue", "(", "AminoAcid", "oldAmino", ",", "String", "newType", ")", "throws", "PDBParseException", "{", "AminoAcid", "newgroup", "=", "new", "AminoAcidImpl", "(", ")", ";", "newgroup", ".", "setResidueNumber", "(", "oldAmino", ".",...
create a new residue which is of the new type. Only the atoms N, Ca, C, O, Cb will be considered. @param oldAmino @param newType @return a new, mutated, residue @throws PDBParseException
[ "create", "a", "new", "residue", "which", "is", "of", "the", "new", "type", ".", "Only", "the", "atoms", "N", "Ca", "C", "O", "Cb", "will", "be", "considered", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Mutator.java#L143-L162
31,677
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/phylo/Comparison.java
Comparison.PID
public final static float PID(String seq1, String seq2) { return PID(seq1, seq2, 0, seq1.length()); }
java
public final static float PID(String seq1, String seq2) { return PID(seq1, seq2, 0, seq1.length()); }
[ "public", "final", "static", "float", "PID", "(", "String", "seq1", ",", "String", "seq2", ")", "{", "return", "PID", "(", "seq1", ",", "seq2", ",", "0", ",", "seq1", ".", "length", "(", ")", ")", ";", "}" ]
this is a gapped PID calculation @param s1 SequenceI @param s2 SequenceI @return float
[ "this", "is", "a", "gapped", "PID", "calculation" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/phylo/Comparison.java#L47-L49
31,678
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/phylo/Comparison.java
Comparison.PID
public final static float PID(String seq1, String seq2, int start, int end) { int s1len = seq1.length(); int s2len = seq2.length(); int len = Math.min(s1len, s2len); if (end < len) { len = end; } if (len < start) { start = len - 1; // we just use a single residue for the difference } int bad ...
java
public final static float PID(String seq1, String seq2, int start, int end) { int s1len = seq1.length(); int s2len = seq2.length(); int len = Math.min(s1len, s2len); if (end < len) { len = end; } if (len < start) { start = len - 1; // we just use a single residue for the difference } int bad ...
[ "public", "final", "static", "float", "PID", "(", "String", "seq1", ",", "String", "seq2", ",", "int", "start", ",", "int", "end", ")", "{", "int", "s1len", "=", "seq1", ".", "length", "(", ")", ";", "int", "s2len", "=", "seq2", ".", "length", "(",...
Another pid with region specification
[ "Another", "pid", "with", "region", "specification" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/phylo/Comparison.java#L52-L93
31,679
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
RotationSolver.completeRotationGroup
private boolean completeRotationGroup(Rotation... additionalRots) { PermutationGroup g = new PermutationGroup(); for (Rotation s : rotations) { g.addPermutation(s.getPermutation()); } for( Rotation s : additionalRots) { g.addPermutation(s.getPermutation()); // inputs should not have been added already ...
java
private boolean completeRotationGroup(Rotation... additionalRots) { PermutationGroup g = new PermutationGroup(); for (Rotation s : rotations) { g.addPermutation(s.getPermutation()); } for( Rotation s : additionalRots) { g.addPermutation(s.getPermutation()); // inputs should not have been added already ...
[ "private", "boolean", "completeRotationGroup", "(", "Rotation", "...", "additionalRots", ")", "{", "PermutationGroup", "g", "=", "new", "PermutationGroup", "(", ")", ";", "for", "(", "Rotation", "s", ":", "rotations", ")", "{", "g", ".", "addPermutation", "(",...
Combine current rotations to make all possible permutations. If these are all valid, add them to the rotations @param additionalRots Additional rotations we are considering adding to this.rotations @return whether the rotations were valid and added
[ "Combine", "current", "rotations", "to", "make", "all", "possible", "permutations", ".", "If", "these", "are", "all", "valid", "add", "them", "to", "the", "rotations" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java#L151-L208
31,680
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
RotationSolver.getAngles
private List<Double> getAngles() { int n = subunits.getSubunitCount(); // for spherical symmetric cases, n cannot be higher than 60 if (n % 60 == 0 && isSpherical()) { n = 60; } List<Integer> folds = subunits.getFolds(); List<Double> angles = new ArrayList<Double>(folds.size()-1); // note this loop s...
java
private List<Double> getAngles() { int n = subunits.getSubunitCount(); // for spherical symmetric cases, n cannot be higher than 60 if (n % 60 == 0 && isSpherical()) { n = 60; } List<Integer> folds = subunits.getFolds(); List<Double> angles = new ArrayList<Double>(folds.size()-1); // note this loop s...
[ "private", "List", "<", "Double", ">", "getAngles", "(", ")", "{", "int", "n", "=", "subunits", ".", "getSubunitCount", "(", ")", ";", "// for spherical symmetric cases, n cannot be higher than 60", "if", "(", "n", "%", "60", "==", "0", "&&", "isSpherical", "(...
Get valid rotation angles given the number of subunits @return The rotation angle corresponding to each fold of {@link Subunits#getFolds()}
[ "Get", "valid", "rotation", "angles", "given", "the", "number", "of", "subunits" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java#L276-L292
31,681
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
RotationSolver.isValidPermutation
private Rotation isValidPermutation(List<Integer> permutation) { if (permutation.size() == 0) { return null; } // cached value if (evaluatedPermutations.containsKey(permutation)) { return evaluatedPermutations.get(permutation); } // check if permutation is allowed if (! isAllowedPermutation(permut...
java
private Rotation isValidPermutation(List<Integer> permutation) { if (permutation.size() == 0) { return null; } // cached value if (evaluatedPermutations.containsKey(permutation)) { return evaluatedPermutations.get(permutation); } // check if permutation is allowed if (! isAllowedPermutation(permut...
[ "private", "Rotation", "isValidPermutation", "(", "List", "<", "Integer", ">", "permutation", ")", "{", "if", "(", "permutation", ".", "size", "(", ")", "==", "0", ")", "{", "return", "null", ";", "}", "// cached value", "if", "(", "evaluatedPermutations", ...
Checks if a particular permutation is allowed and superimposes well. Caches results. @param permutation @return null if invalid, or a rotation if valid
[ "Checks", "if", "a", "particular", "permutation", "is", "allowed", "and", "superimposes", "well", ".", "Caches", "results", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java#L305-L324
31,682
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
RotationSolver.isAllowedPermutation
private boolean isAllowedPermutation(List<Integer> permutation) { List<Integer> seqClusterId = subunits.getClusterIds(); int selfaligned = 0; for (int i = 0; i < permutation.size(); i++) { int j = permutation.get(i); if ( seqClusterId.get(i) != seqClusterId.get(j)) { return false; } if(i == j ) { ...
java
private boolean isAllowedPermutation(List<Integer> permutation) { List<Integer> seqClusterId = subunits.getClusterIds(); int selfaligned = 0; for (int i = 0; i < permutation.size(); i++) { int j = permutation.get(i); if ( seqClusterId.get(i) != seqClusterId.get(j)) { return false; } if(i == j ) { ...
[ "private", "boolean", "isAllowedPermutation", "(", "List", "<", "Integer", ">", "permutation", ")", "{", "List", "<", "Integer", ">", "seqClusterId", "=", "subunits", ".", "getClusterIds", "(", ")", ";", "int", "selfaligned", "=", "0", ";", "for", "(", "in...
The permutation must map all subunits onto an equivalent subunit and no subunit onto itself @param permutation @return
[ "The", "permutation", "must", "map", "all", "subunits", "onto", "an", "equivalent", "subunit", "and", "no", "subunit", "onto", "itself" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java#L332-L346
31,683
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
RotationSolver.getPermutation
private List<Integer> getPermutation() { List<Integer> permutation = new ArrayList<Integer>(transformedCoords.length); double sum = 0.0f; for (Point3d t: transformedCoords) { List<Integer> neighbors = box.getNeighborsWithCache(t); int closest = -1; double minDist = Double.MAX_VALUE; for (int j : ne...
java
private List<Integer> getPermutation() { List<Integer> permutation = new ArrayList<Integer>(transformedCoords.length); double sum = 0.0f; for (Point3d t: transformedCoords) { List<Integer> neighbors = box.getNeighborsWithCache(t); int closest = -1; double minDist = Double.MAX_VALUE; for (int j : ne...
[ "private", "List", "<", "Integer", ">", "getPermutation", "(", ")", "{", "List", "<", "Integer", ">", "permutation", "=", "new", "ArrayList", "<", "Integer", ">", "(", "transformedCoords", ".", "length", ")", ";", "double", "sum", "=", "0.0f", ";", "for"...
Compare this.transformedCoords with the original coords. For each subunit, return the transformed subunit with the closest position. @return A list mapping each subunit to the closest transformed subunit
[ "Compare", "this", ".", "transformedCoords", "with", "the", "original", "coords", ".", "For", "each", "subunit", "return", "the", "transformed", "subunit", "with", "the", "closest", "position", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java#L401-L440
31,684
biojava/biojava
biojava-structure-gui/src/main/java/demo/DemoShowLargeAssembly.java
DemoShowLargeAssembly.readStructure
public static Structure readStructure(String pdbId, int bioAssemblyId) { // pre-computed files use lower case PDB IDs pdbId = pdbId.toLowerCase(); // we just need this to track where to store PDB files // this checks the PDB_DIR property (and uses a tmp location if not set) AtomCache cache = new AtomCache(...
java
public static Structure readStructure(String pdbId, int bioAssemblyId) { // pre-computed files use lower case PDB IDs pdbId = pdbId.toLowerCase(); // we just need this to track where to store PDB files // this checks the PDB_DIR property (and uses a tmp location if not set) AtomCache cache = new AtomCache(...
[ "public", "static", "Structure", "readStructure", "(", "String", "pdbId", ",", "int", "bioAssemblyId", ")", "{", "// pre-computed files use lower case PDB IDs", "pdbId", "=", "pdbId", ".", "toLowerCase", "(", ")", ";", "// we just need this to track where to store PDB files...
Load a specific biological assembly for a PDB entry @param pdbId .. the PDB ID @param bioAssemblyId .. the first assembly has the bioAssemblyId 1 @return a Structure object or null if something went wrong.
[ "Load", "a", "specific", "biological", "assembly", "for", "a", "PDB", "entry" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/demo/DemoShowLargeAssembly.java#L72-L101
31,685
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.calculate
public List<SecStrucState> calculate(Structure s, boolean assign) throws StructureException { List<SecStrucState> secstruc = new ArrayList<SecStrucState>(); for(int i=0; i<s.nrModels(); i++) { // Reinitialise the global vars ladders = new ArrayList<Ladder>(); bridges = new ArrayList<BetaBridge>(); g...
java
public List<SecStrucState> calculate(Structure s, boolean assign) throws StructureException { List<SecStrucState> secstruc = new ArrayList<SecStrucState>(); for(int i=0; i<s.nrModels(); i++) { // Reinitialise the global vars ladders = new ArrayList<Ladder>(); bridges = new ArrayList<BetaBridge>(); g...
[ "public", "List", "<", "SecStrucState", ">", "calculate", "(", "Structure", "s", ",", "boolean", "assign", ")", "throws", "StructureException", "{", "List", "<", "SecStrucState", ">", "secstruc", "=", "new", "ArrayList", "<", "SecStrucState", ">", "(", ")", ...
Predicts the secondary structure of this Structure object, using a DSSP implementation. @param s Structure to predict the SS @param assign sets the SS information to the Groups of s @return a List of SS annotation objects
[ "Predicts", "the", "secondary", "structure", "of", "this", "Structure", "object", "using", "a", "DSSP", "implementation", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L119-L154
31,686
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.initContactSet
private void initContactSet() { // Initialise an array of atoms atoms = new Atom[groups.length]; // Remake this local var indResMap = new HashMap<>(); for (int i=0 ; i < groups.length ; i++){ SecStrucGroup one = groups[i]; indResMap.put(one.getResidueNumber(), i); atoms[i] = one.getCA(); } Grid ...
java
private void initContactSet() { // Initialise an array of atoms atoms = new Atom[groups.length]; // Remake this local var indResMap = new HashMap<>(); for (int i=0 ; i < groups.length ; i++){ SecStrucGroup one = groups[i]; indResMap.put(one.getResidueNumber(), i); atoms[i] = one.getCA(); } Grid ...
[ "private", "void", "initContactSet", "(", ")", "{", "// Initialise an array of atoms", "atoms", "=", "new", "Atom", "[", "groups", ".", "length", "]", ";", "// Remake this local var", "indResMap", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "int", ...
Function to generate the contact sets
[ "Function", "to", "generate", "the", "contact", "sets" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L159-L178
31,687
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.printDSSP
public String printDSSP() { StringBuffer buf = new StringBuffer(); String nl = System.getProperty("line.separator"); //Header Line buf.append("==== Secondary Structure Definition by BioJava" + " DSSP implementation, Version October 2015 ===="+nl); //First line with column definition buf.append(" # ...
java
public String printDSSP() { StringBuffer buf = new StringBuffer(); String nl = System.getProperty("line.separator"); //Header Line buf.append("==== Secondary Structure Definition by BioJava" + " DSSP implementation, Version October 2015 ===="+nl); //First line with column definition buf.append(" # ...
[ "public", "String", "printDSSP", "(", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "String", "nl", "=", "System", ".", "getProperty", "(", "\"line.separator\"", ")", ";", "//Header Line", "buf", ".", "append", "(", "\"==== Seco...
Generate a DSSP file format ouput String of this SS prediction. @return String in DSSP output file format
[ "Generate", "a", "DSSP", "file", "format", "ouput", "String", "of", "this", "SS", "prediction", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L602-L624
31,688
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.printFASTA
public String printFASTA() { StringBuffer buf = new StringBuffer(); String nl = System.getProperty("line.separator"); buf.append(">"+groups[0].getChain().getStructure().getIdentifier()+nl); for (int g = 0; g < groups.length; g++){ buf.append(getSecStrucState(g).getType()); } return buf.toString(); }
java
public String printFASTA() { StringBuffer buf = new StringBuffer(); String nl = System.getProperty("line.separator"); buf.append(">"+groups[0].getChain().getStructure().getIdentifier()+nl); for (int g = 0; g < groups.length; g++){ buf.append(getSecStrucState(g).getType()); } return buf.toString(); }
[ "public", "String", "printFASTA", "(", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "String", "nl", "=", "System", ".", "getProperty", "(", "\"line.separator\"", ")", ";", "buf", ".", "append", "(", "\">\"", "+", "groups", ...
Generate a FASTA sequence with the SS annotation letters in the aminoacid sequence order. @return String in FASTA sequence format
[ "Generate", "a", "FASTA", "sequence", "with", "the", "SS", "annotation", "letters", "in", "the", "aminoacid", "sequence", "order", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L669-L679
31,689
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.calculateHAtoms
private void calculateHAtoms() throws StructureException { for ( int i = 0 ; i < groups.length-1 ; i++) { SecStrucGroup a = groups[i]; SecStrucGroup b = groups[i+1]; if ( !b.hasAtom("H") ) { //Atom H = calc_H(a.getC(), b.getN(), b.getCA()); Atom H = calcSimple_H(a.getC(), a.getO(), b.getN()); ...
java
private void calculateHAtoms() throws StructureException { for ( int i = 0 ; i < groups.length-1 ; i++) { SecStrucGroup a = groups[i]; SecStrucGroup b = groups[i+1]; if ( !b.hasAtom("H") ) { //Atom H = calc_H(a.getC(), b.getN(), b.getCA()); Atom H = calcSimple_H(a.getC(), a.getO(), b.getN()); ...
[ "private", "void", "calculateHAtoms", "(", ")", "throws", "StructureException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "groups", ".", "length", "-", "1", ";", "i", "++", ")", "{", "SecStrucGroup", "a", "=", "groups", "[", "i", "]", "...
Calculate the coordinates of the H atoms. They are usually missing in the PDB files as only few experimental methods allow to resolve their location.
[ "Calculate", "the", "coordinates", "of", "the", "H", "atoms", ".", "They", "are", "usually", "missing", "in", "the", "PDB", "files", "as", "only", "few", "experimental", "methods", "allow", "to", "resolve", "their", "location", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L753-L766
31,690
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.calculateHBonds
private void calculateHBonds() { /** * More efficient method for calculating C-Alpha pairs */ if (groups.length < 5) return; Iterator<AtomContact> otu = contactSet.iterator(); while(otu.hasNext()){ AtomContact ac = otu.next(); Pair<Atom> pair = ac.getPair(); Group g1 = pair.getFirst().getGroup();...
java
private void calculateHBonds() { /** * More efficient method for calculating C-Alpha pairs */ if (groups.length < 5) return; Iterator<AtomContact> otu = contactSet.iterator(); while(otu.hasNext()){ AtomContact ac = otu.next(); Pair<Atom> pair = ac.getPair(); Group g1 = pair.getFirst().getGroup();...
[ "private", "void", "calculateHBonds", "(", ")", "{", "/**\n\t\t * More efficient method for calculating C-Alpha pairs\n\t\t */", "if", "(", "groups", ".", "length", "<", "5", ")", "return", ";", "Iterator", "<", "AtomContact", ">", "otu", "=", "contactSet", ".", "it...
Calculate the HBonds between different groups. see Creighton page 147 f Modified to use only the contact map
[ "Calculate", "the", "HBonds", "between", "different", "groups", ".", "see", "Creighton", "page", "147", "f", "Modified", "to", "use", "only", "the", "contact", "map" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L775-L794
31,691
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.trackHBondEnergy
private void trackHBondEnergy(int i, int j, double energy) { if (groups[i].getPDBName().equals("PRO")) { logger.debug("Ignore: PRO {}",groups[i].getResidueNumber()); return; } SecStrucState stateOne = getSecStrucState(i); SecStrucState stateTwo = getSecStrucState(j); double acc1e = stateOne.getAccep...
java
private void trackHBondEnergy(int i, int j, double energy) { if (groups[i].getPDBName().equals("PRO")) { logger.debug("Ignore: PRO {}",groups[i].getResidueNumber()); return; } SecStrucState stateOne = getSecStrucState(i); SecStrucState stateTwo = getSecStrucState(j); double acc1e = stateOne.getAccep...
[ "private", "void", "trackHBondEnergy", "(", "int", "i", ",", "int", "j", ",", "double", "energy", ")", "{", "if", "(", "groups", "[", "i", "]", ".", "getPDBName", "(", ")", ".", "equals", "(", "\"PRO\"", ")", ")", "{", "logger", ".", "debug", "(", ...
Store Hbonds in the Groups. DSSP allows two HBonds per aminoacids to allow bifurcated bonds.
[ "Store", "Hbonds", "in", "the", "Groups", ".", "DSSP", "allows", "two", "HBonds", "per", "aminoacids", "to", "allow", "bifurcated", "bonds", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L877-L935
31,692
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.calculateTurns
private void calculateTurns(){ for (int i = 0 ; i< groups.length; i++){ for (int turn = 3; turn <= 5; turn++) { if (i+turn >= groups.length) continue; //Check for H bond from NH(i+n) to CO(i) if (isBonded(i, i+turn)) { logger.debug("Turn at ({},{}) turn {}",i,(i+turn),turn); getSecStrucSta...
java
private void calculateTurns(){ for (int i = 0 ; i< groups.length; i++){ for (int turn = 3; turn <= 5; turn++) { if (i+turn >= groups.length) continue; //Check for H bond from NH(i+n) to CO(i) if (isBonded(i, i+turn)) { logger.debug("Turn at ({},{}) turn {}",i,(i+turn),turn); getSecStrucSta...
[ "private", "void", "calculateTurns", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "groups", ".", "length", ";", "i", "++", ")", "{", "for", "(", "int", "turn", "=", "3", ";", "turn", "<=", "5", ";", "turn", "++", ")", "{", ...
Detect helical turn patterns.
[ "Detect", "helical", "turn", "patterns", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L940-L961
31,693
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.calc_H
@SuppressWarnings("unused") private static Atom calc_H(Atom C, Atom N, Atom CA) throws StructureException { Atom nc = Calc.subtract(N,C); Atom nca = Calc.subtract(N,CA); Atom u_nc = Calc.unitVector(nc) ; Atom u_nca = Calc.unitVector(nca); Atom added = Calc.add(u_nc,u_nca); Atom U = Calc.unitVect...
java
@SuppressWarnings("unused") private static Atom calc_H(Atom C, Atom N, Atom CA) throws StructureException { Atom nc = Calc.subtract(N,C); Atom nca = Calc.subtract(N,CA); Atom u_nc = Calc.unitVector(nc) ; Atom u_nca = Calc.unitVector(nca); Atom added = Calc.add(u_nc,u_nca); Atom U = Calc.unitVect...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "private", "static", "Atom", "calc_H", "(", "Atom", "C", ",", "Atom", "N", ",", "Atom", "CA", ")", "throws", "StructureException", "{", "Atom", "nc", "=", "Calc", ".", "subtract", "(", "N", ",", "C", ")"...
Use unit vectors NC and NCalpha Add them. Calc unit vector and substract it from N. C coordinates are from amino acid i-1 N, CA atoms from amino acid i @link http://openbioinformatics.blogspot.com/ 2009/08/how-to-calculate-h-atoms-for-nitrogens.html
[ "Use", "unit", "vectors", "NC", "and", "NCalpha", "Add", "them", ".", "Calc", "unit", "vector", "and", "substract", "it", "from", "N", ".", "C", "coordinates", "are", "from", "amino", "acid", "i", "-", "1", "N", "CA", "atoms", "from", "amino", "acid", ...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L1011-L1032
31,694
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java
SecStrucCalc.setSecStrucType
private void setSecStrucType(int pos, SecStrucType type){ SecStrucState ss = getSecStrucState(pos); if (type.compareTo(ss.getType()) < 0) ss.setType(type); }
java
private void setSecStrucType(int pos, SecStrucType type){ SecStrucState ss = getSecStrucState(pos); if (type.compareTo(ss.getType()) < 0) ss.setType(type); }
[ "private", "void", "setSecStrucType", "(", "int", "pos", ",", "SecStrucType", "type", ")", "{", "SecStrucState", "ss", "=", "getSecStrucState", "(", "pos", ")", ";", "if", "(", "type", ".", "compareTo", "(", "ss", ".", "getType", "(", ")", ")", "<", "0...
Set the new type only if it has more preference than the current residue SS type. @param pos @param type
[ "Set", "the", "new", "type", "only", "if", "it", "has", "more", "preference", "than", "the", "current", "residue", "SS", "type", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L1137-L1140
31,695
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeMain.java
CeMain.align
@Override public AFPChain align(Atom[] ca1, Atom[] ca2, Object param) throws StructureException{ if ( ! (param instanceof CeParameters)) throw new IllegalArgumentException("CE algorithm needs an object of call CeParameters as argument."); params = (CeParameters) param; // we don't want to rotate input atoms...
java
@Override public AFPChain align(Atom[] ca1, Atom[] ca2, Object param) throws StructureException{ if ( ! (param instanceof CeParameters)) throw new IllegalArgumentException("CE algorithm needs an object of call CeParameters as argument."); params = (CeParameters) param; // we don't want to rotate input atoms...
[ "@", "Override", "public", "AFPChain", "align", "(", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "Object", "param", ")", "throws", "StructureException", "{", "if", "(", "!", "(", "param", "instanceof", "CeParameters", ")", ")", "throw", ...
Align ca2 onto ca1.
[ "Align", "ca2", "onto", "ca1", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeMain.java#L86-L136
31,696
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/Site.java
Site.remark800toPDB
public void remark800toPDB(StringBuffer stringBuffer) { //REMARK 800 SITE_IDENTIFIER: CAT //REMARK 800 EVIDENCE_CODE: UNKNOWN //REMARK 800 SITE_DESCRIPTION: ACTIVE SITE stringBuffer.append(String.format(Locale.UK, "REMARK 800 SITE_IDENTIFIER: %-52s%s", siteID, lineEnd)); stringBuffer.append(String.format(Loc...
java
public void remark800toPDB(StringBuffer stringBuffer) { //REMARK 800 SITE_IDENTIFIER: CAT //REMARK 800 EVIDENCE_CODE: UNKNOWN //REMARK 800 SITE_DESCRIPTION: ACTIVE SITE stringBuffer.append(String.format(Locale.UK, "REMARK 800 SITE_IDENTIFIER: %-52s%s", siteID, lineEnd)); stringBuffer.append(String.format(Loc...
[ "public", "void", "remark800toPDB", "(", "StringBuffer", "stringBuffer", ")", "{", "//REMARK 800 SITE_IDENTIFIER: CAT", "//REMARK 800 EVIDENCE_CODE: UNKNOWN", "//REMARK 800 SITE_DESCRIPTION: ACTIVE SITE", "stringBuffer", ".", "append", "(", "String", ".", "format", "(", "Locale...
Appends the REMARK 800 section pertaining to the site onto the end of the StringBuffer provided. For example in pdb 1a4w: REMARK 800 SITE_IDENTIFIER: CAT REMARK 800 EVIDENCE_CODE: UNKNOWN REMARK 800 SITE_DESCRIPTION: ACTIVE SITE @param stringBuffer
[ "Appends", "the", "REMARK", "800", "section", "pertaining", "to", "the", "site", "onto", "the", "end", "of", "the", "StringBuffer", "provided", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Site.java#L139-L148
31,697
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/SigEva.java
SigEva.normScore
private double normScore(double score, double rmsd, int optLen, int r) { //double score1 = modScore(score, r); double score1 = score; if(r > 0) score1 /= Math.sqrt(r + 1); //it is tested that flexible score is more linear relevant to 1/r2 than 1/r if(rmsd < 0.5) score1 *= Math.sqrt((optLen) /...
java
private double normScore(double score, double rmsd, int optLen, int r) { //double score1 = modScore(score, r); double score1 = score; if(r > 0) score1 /= Math.sqrt(r + 1); //it is tested that flexible score is more linear relevant to 1/r2 than 1/r if(rmsd < 0.5) score1 *= Math.sqrt((optLen) /...
[ "private", "double", "normScore", "(", "double", "score", ",", "double", "rmsd", ",", "int", "optLen", ",", "int", "r", ")", "{", "//double score1 = modScore(score, r);", "double", "score1", "=", "score", ";", "if", "(", "r", ">", "0", ")", "score1", ...
the chaining score is normalized by rmsd, twist and optimal alignment length
[ "the", "chaining", "score", "is", "normalized", "by", "rmsd", "twist", "and", "optimal", "alignment", "length" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/SigEva.java#L201-L210
31,698
biojava/biojava
biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java
SequenceUtil.cleanSequence
public static String cleanSequence(String sequence) { assert sequence != null; final Matcher m = SequenceUtil.WHITE_SPACE.matcher(sequence); sequence = m.replaceAll("").toUpperCase(); return sequence; }
java
public static String cleanSequence(String sequence) { assert sequence != null; final Matcher m = SequenceUtil.WHITE_SPACE.matcher(sequence); sequence = m.replaceAll("").toUpperCase(); return sequence; }
[ "public", "static", "String", "cleanSequence", "(", "String", "sequence", ")", "{", "assert", "sequence", "!=", "null", ";", "final", "Matcher", "m", "=", "SequenceUtil", ".", "WHITE_SPACE", ".", "matcher", "(", "sequence", ")", ";", "sequence", "=", "m", ...
Removes all whitespace chars in the sequence string @param sequence @return cleaned up sequence
[ "Removes", "all", "whitespace", "chars", "in", "the", "sequence", "string" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java#L149-L154
31,699
biojava/biojava
biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java
SequenceUtil.deepCleanSequence
public static String deepCleanSequence(String sequence) { sequence = SequenceUtil.cleanSequence(sequence); sequence = SequenceUtil.DIGIT.matcher(sequence).replaceAll(""); sequence = SequenceUtil.NONWORD.matcher(sequence).replaceAll(""); final Pattern othernonSeqChars = Pattern.compile("[_-]+"); sequence = othernon...
java
public static String deepCleanSequence(String sequence) { sequence = SequenceUtil.cleanSequence(sequence); sequence = SequenceUtil.DIGIT.matcher(sequence).replaceAll(""); sequence = SequenceUtil.NONWORD.matcher(sequence).replaceAll(""); final Pattern othernonSeqChars = Pattern.compile("[_-]+"); sequence = othernon...
[ "public", "static", "String", "deepCleanSequence", "(", "String", "sequence", ")", "{", "sequence", "=", "SequenceUtil", ".", "cleanSequence", "(", "sequence", ")", ";", "sequence", "=", "SequenceUtil", ".", "DIGIT", ".", "matcher", "(", "sequence", ")", ".", ...
Removes all special characters and digits as well as whitespace chars from the sequence @param sequence @return cleaned up sequence
[ "Removes", "all", "special", "characters", "and", "digits", "as", "well", "as", "whitespace", "chars", "from", "the", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java#L163-L170