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,800
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java
EcodInstallation.domainsAvailable
private boolean domainsAvailable() { domainsFileLock.readLock().lock(); logger.trace("LOCK readlock"); try { File f = getDomainFile(); if (!f.exists() || f.length() <= 0 ) return false; // Re-download old copies of "latest" if(updateFrequency != null && requestedVersion == DEFAULT_VERSION ) { ...
java
private boolean domainsAvailable() { domainsFileLock.readLock().lock(); logger.trace("LOCK readlock"); try { File f = getDomainFile(); if (!f.exists() || f.length() <= 0 ) return false; // Re-download old copies of "latest" if(updateFrequency != null && requestedVersion == DEFAULT_VERSION ) { ...
[ "private", "boolean", "domainsAvailable", "(", ")", "{", "domainsFileLock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "logger", ".", "trace", "(", "\"LOCK readlock\"", ")", ";", "try", "{", "File", "f", "=", "getDomainFile", "(", ")", ";", ...
Checks that the domains file has been downloaded @return
[ "Checks", "that", "the", "domains", "file", "has", "been", "downloaded" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L361-L390
31,801
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java
EcodInstallation.downloadDomains
private void downloadDomains() throws IOException { domainsFileLock.writeLock().lock(); logger.trace("LOCK writelock"); try { URL domainsURL = new URL( url + DOMAINS_PATH + getDomainFilename()); File localFile = getDomainFile(); logger.info("Downloading {} to: {}",domainsURL, localFile); FileDownload...
java
private void downloadDomains() throws IOException { domainsFileLock.writeLock().lock(); logger.trace("LOCK writelock"); try { URL domainsURL = new URL( url + DOMAINS_PATH + getDomainFilename()); File localFile = getDomainFile(); logger.info("Downloading {} to: {}",domainsURL, localFile); FileDownload...
[ "private", "void", "downloadDomains", "(", ")", "throws", "IOException", "{", "domainsFileLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "logger", ".", "trace", "(", "\"LOCK writelock\"", ")", ";", "try", "{", "URL", "domainsURL", "=", "new...
Downloads the domains file, overwriting any existing file @throws IOException
[ "Downloads", "the", "domains", "file", "overwriting", "any", "existing", "file" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L396-L411
31,802
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java
EcodInstallation.parseDomains
private void parseDomains() throws IOException { domainsFileLock.writeLock().lock(); logger.trace("LOCK writelock"); try { EcodParser parser = new EcodParser(getDomainFile()); allDomains = parser.getDomains(); parsedVersion = parser.getVersion(); } finally { logger.trace("UNLOCK writelock"); doma...
java
private void parseDomains() throws IOException { domainsFileLock.writeLock().lock(); logger.trace("LOCK writelock"); try { EcodParser parser = new EcodParser(getDomainFile()); allDomains = parser.getDomains(); parsedVersion = parser.getVersion(); } finally { logger.trace("UNLOCK writelock"); doma...
[ "private", "void", "parseDomains", "(", ")", "throws", "IOException", "{", "domainsFileLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "logger", ".", "trace", "(", "\"LOCK writelock\"", ")", ";", "try", "{", "EcodParser", "parser", "=", "new...
Parses the domains from the local file @throws IOException
[ "Parses", "the", "domains", "from", "the", "local", "file" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L454-L465
31,803
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java
EcodInstallation.indexDomains
private void indexDomains() throws IOException { domainsFileLock.writeLock().lock(); logger.trace("LOCK writelock"); try { if( allDomains == null) { ensureDomainsFileInstalled(); } // Leave enough space for all PDBs as of 2015 domainMap = new HashMap<String, List<EcodDomain>>((int) (150000/.85),....
java
private void indexDomains() throws IOException { domainsFileLock.writeLock().lock(); logger.trace("LOCK writelock"); try { if( allDomains == null) { ensureDomainsFileInstalled(); } // Leave enough space for all PDBs as of 2015 domainMap = new HashMap<String, List<EcodDomain>>((int) (150000/.85),....
[ "private", "void", "indexDomains", "(", ")", "throws", "IOException", "{", "domainsFileLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "logger", ".", "trace", "(", "\"LOCK writelock\"", ")", ";", "try", "{", "if", "(", "allDomains", "==", ...
Populates domainMap from allDomains @throws IOException
[ "Populates", "domainMap", "from", "allDomains" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L471-L509
31,804
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java
AbstractUserArgumentProcessor.runDbSearch
private void runDbSearch(AtomCache cache, String searchFile, String outputFile,int useNrCPUs, StartupParameters params) throws ConfigurationException { System.out.println("will use " + useNrCPUs + " CPUs."); PDBFileReader reader = new PDBFileReader(); Structure structure1 = null ; try { structure1 = re...
java
private void runDbSearch(AtomCache cache, String searchFile, String outputFile,int useNrCPUs, StartupParameters params) throws ConfigurationException { System.out.println("will use " + useNrCPUs + " CPUs."); PDBFileReader reader = new PDBFileReader(); Structure structure1 = null ; try { structure1 = re...
[ "private", "void", "runDbSearch", "(", "AtomCache", "cache", ",", "String", "searchFile", ",", "String", "outputFile", ",", "int", "useNrCPUs", ",", "StartupParameters", "params", ")", "throws", "ConfigurationException", "{", "System", ".", "out", ".", "println", ...
Do a DB search with the input file against representative PDB domains @param cache @param searchFile @param outputFile @throws ConfigurationException
[ "Do", "a", "DB", "search", "with", "the", "input", "file", "against", "representative", "PDB", "domains" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java#L299-L332
31,805
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java
AbstractUserArgumentProcessor.checkWriteFile
private void checkWriteFile( AFPChain afpChain, Atom[] ca1, Atom[] ca2, boolean dbsearch) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, StructureException { String output = null; if ( params.isOutputPDB()){ if (! GuiWrapper.isGuiModuleIns...
java
private void checkWriteFile( AFPChain afpChain, Atom[] ca1, Atom[] ca2, boolean dbsearch) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, StructureException { String output = null; if ( params.isOutputPDB()){ if (! GuiWrapper.isGuiModuleIns...
[ "private", "void", "checkWriteFile", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "boolean", "dbsearch", ")", "throws", "IOException", ",", "ClassNotFoundException", ",", "NoSuchMethodException", ",", "InvocationT...
check if the result should be written to the local file system @param params2 @param afpChain @param ca1 @param ca2 @throws IOException If an error occurs when writing the afpChain to XML @throws ClassNotFoundException If an error occurs when invoking jmol @throws NoSuchMethodException If an error occurs when invoking...
[ "check", "if", "the", "result", "should", "be", "written", "to", "the", "local", "file", "system" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java#L583-L658
31,806
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java
AbstractUserArgumentProcessor.fixStructureName
private Structure fixStructureName(Structure s, String file) { if ( s.getName() != null && (! s.getName().equals(""))) return s; s.setName(s.getPDBCode()); if ( s.getName() == null || s.getName().equals("")){ File f = new File(file); s.setName(f.getName()); } return s; }
java
private Structure fixStructureName(Structure s, String file) { if ( s.getName() != null && (! s.getName().equals(""))) return s; s.setName(s.getPDBCode()); if ( s.getName() == null || s.getName().equals("")){ File f = new File(file); s.setName(f.getName()); } return s; }
[ "private", "Structure", "fixStructureName", "(", "Structure", "s", ",", "String", "file", ")", "{", "if", "(", "s", ".", "getName", "(", ")", "!=", "null", "&&", "(", "!", "s", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ")", ")", ...
apply a number of rules to fix the name of the structure if it did not get set during loading. @param s @param file @return
[ "apply", "a", "number", "of", "rules", "to", "fix", "the", "name", "of", "the", "structure", "if", "it", "did", "not", "get", "set", "during", "loading", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/AbstractUserArgumentProcessor.java#L717-L729
31,807
biojava/biojava
biojava-structure/src/main/java/demo/DemoMmtfReader.java
DemoMmtfReader.main
public static void main(String[] args) throws IOException, StructureException { Structure structure = MmtfActions.readFromWeb("4cup"); System.out.println(structure.getChains().size()); }
java
public static void main(String[] args) throws IOException, StructureException { Structure structure = MmtfActions.readFromWeb("4cup"); System.out.println(structure.getChains().size()); }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "IOException", ",", "StructureException", "{", "Structure", "structure", "=", "MmtfActions", ".", "readFromWeb", "(", "\"4cup\"", ")", ";", "System", ".", "out", ".", "printl...
Main function to run the demo @param args no args to specify @throws IOException @throws StructureException
[ "Main", "function", "to", "run", "the", "demo" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/demo/DemoMmtfReader.java#L42-L45
31,808
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/StructureAlignmentOptimizer.java
StructureAlignmentOptimizer.runOptimization
public void runOptimization(int maxi) throws StructureException{ superimposeBySet(); if ( debug) System.err.println(" initial rmsd " + rmsd); // if (showAlig) // showCurrentAlignment(equLen, equSet, "after initial superimposeBySet Len:" +equLen + " rmsd:" +rmsd); maxKeepStep = 4; keepStep = ...
java
public void runOptimization(int maxi) throws StructureException{ superimposeBySet(); if ( debug) System.err.println(" initial rmsd " + rmsd); // if (showAlig) // showCurrentAlignment(equLen, equSet, "after initial superimposeBySet Len:" +equLen + " rmsd:" +rmsd); maxKeepStep = 4; keepStep = ...
[ "public", "void", "runOptimization", "(", "int", "maxi", ")", "throws", "StructureException", "{", "superimposeBySet", "(", ")", ";", "if", "(", "debug", ")", "System", ".", "err", ".", "println", "(", "\" initial rmsd \"", "+", "rmsd", ")", ";", "// ...
run the optimization @param maxi maximum nr. of iterations @throws StructureException
[ "run", "the", "optimization" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/StructureAlignmentOptimizer.java#L199-L211
31,809
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/StructureAlignmentOptimizer.java
StructureAlignmentOptimizer.superimposeBySet
private void superimposeBySet () throws StructureException { //extract the coordinations of equivalent residues Atom[] tmp1 = new Atom[equLen]; Atom[] tmp2 = new Atom[equLen]; int i, r1, r2; for(i = 0; i < equLen; i ++) { r1 = equSet[0][i]; r2 = equSet[1][i]; tmp1[i] = cod1[ r1 ];...
java
private void superimposeBySet () throws StructureException { //extract the coordinations of equivalent residues Atom[] tmp1 = new Atom[equLen]; Atom[] tmp2 = new Atom[equLen]; int i, r1, r2; for(i = 0; i < equLen; i ++) { r1 = equSet[0][i]; r2 = equSet[1][i]; tmp1[i] = cod1[ r1 ];...
[ "private", "void", "superimposeBySet", "(", ")", "throws", "StructureException", "{", "//extract the coordinations of equivalent residues", "Atom", "[", "]", "tmp1", "=", "new", "Atom", "[", "equLen", "]", ";", "Atom", "[", "]", "tmp2", "=", "new", "Atom", "[", ...
superimpose two structures according to the equivalent residues
[ "superimpose", "two", "structures", "according", "to", "the", "equivalent", "residues" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/StructureAlignmentOptimizer.java#L235-L284
31,810
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBBioAssemblyParser.java
PDBBioAssemblyParser.saveMatrix
private void saveMatrix() { for (String chainId : currentChainIDs) { BiologicalAssemblyTransformation transformation = new BiologicalAssemblyTransformation(); transformation.setRotationMatrix(currentMatrix.getArray()); transformation.setTranslation(shift); transformation.setId(String.valueOf(modelNumber)...
java
private void saveMatrix() { for (String chainId : currentChainIDs) { BiologicalAssemblyTransformation transformation = new BiologicalAssemblyTransformation(); transformation.setRotationMatrix(currentMatrix.getArray()); transformation.setTranslation(shift); transformation.setId(String.valueOf(modelNumber)...
[ "private", "void", "saveMatrix", "(", ")", "{", "for", "(", "String", "chainId", ":", "currentChainIDs", ")", "{", "BiologicalAssemblyTransformation", "transformation", "=", "new", "BiologicalAssemblyTransformation", "(", ")", ";", "transformation", ".", "setRotationM...
Saves transformation matrix for the list of current chains
[ "Saves", "transformation", "matrix", "for", "the", "list", "of", "current", "chains" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBBioAssemblyParser.java#L131-L148
31,811
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBBioAssemblyParser.java
PDBBioAssemblyParser.setMacromolecularSizes
public void setMacromolecularSizes() { for (BioAssemblyInfo bioAssembly : transformationMap.values()) { bioAssembly.setMacromolecularSize(bioAssembly.getTransforms().size()); } }
java
public void setMacromolecularSizes() { for (BioAssemblyInfo bioAssembly : transformationMap.values()) { bioAssembly.setMacromolecularSize(bioAssembly.getTransforms().size()); } }
[ "public", "void", "setMacromolecularSizes", "(", ")", "{", "for", "(", "BioAssemblyInfo", "bioAssembly", ":", "transformationMap", ".", "values", "(", ")", ")", "{", "bioAssembly", ".", "setMacromolecularSize", "(", "bioAssembly", ".", "getTransforms", "(", ")", ...
Set the macromolecularSize fields of the parsed bioassemblies. This can only be called after the full PDB file has been read so that all the info for all bioassemblies has been gathered. Note that an explicit method to set the field is necessary here because in PDB files the transformations contain only the author chai...
[ "Set", "the", "macromolecularSize", "fields", "of", "the", "parsed", "bioassemblies", ".", "This", "can", "only", "be", "called", "after", "the", "full", "PDB", "file", "has", "been", "read", "so", "that", "all", "the", "info", "for", "all", "bioassemblies",...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBBioAssemblyParser.java#L178-L182
31,812
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.parseUniprotXMLString
public static <C extends Compound> UniprotProxySequenceReader<C> parseUniprotXMLString(String xml, CompoundSet<C> compoundSet) { try { Document document = XMLHelper.inputStreamToDocument(new ByteArrayInputStream(xml.getBytes())); return new UniprotProxySequenceReader<C>(document, compoundSet); } catch (Except...
java
public static <C extends Compound> UniprotProxySequenceReader<C> parseUniprotXMLString(String xml, CompoundSet<C> compoundSet) { try { Document document = XMLHelper.inputStreamToDocument(new ByteArrayInputStream(xml.getBytes())); return new UniprotProxySequenceReader<C>(document, compoundSet); } catch (Except...
[ "public", "static", "<", "C", "extends", "Compound", ">", "UniprotProxySequenceReader", "<", "C", ">", "parseUniprotXMLString", "(", "String", "xml", ",", "CompoundSet", "<", "C", ">", "compoundSet", ")", "{", "try", "{", "Document", "document", "=", "XMLHelpe...
The passed in xml is parsed as a DOM object so we know everything about the protein. If an error occurs throw an exception. We could have a bad uniprot id @param xml @param compoundSet @return UniprotProxySequenceReader @throws Exception
[ "The", "passed", "in", "xml", "is", "parsed", "as", "a", "DOM", "object", "so", "we", "know", "everything", "about", "the", "protein", ".", "If", "an", "error", "occurs", "throw", "an", "exception", ".", "We", "could", "have", "a", "bad", "uniprot", "i...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L128-L136
31,813
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.getAccessions
public ArrayList<AccessionID> getAccessions() throws XPathExpressionException { ArrayList<AccessionID> accessionList = new ArrayList<AccessionID>(); if (uniprotDoc == null) { return accessionList; } Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleEleme...
java
public ArrayList<AccessionID> getAccessions() throws XPathExpressionException { ArrayList<AccessionID> accessionList = new ArrayList<AccessionID>(); if (uniprotDoc == null) { return accessionList; } Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleEleme...
[ "public", "ArrayList", "<", "AccessionID", ">", "getAccessions", "(", ")", "throws", "XPathExpressionException", "{", "ArrayList", "<", "AccessionID", ">", "accessionList", "=", "new", "ArrayList", "<", "AccessionID", ">", "(", ")", ";", "if", "(", "uniprotDoc",...
Pull uniprot accessions associated with this sequence @return @throws XPathExpressionException
[ "Pull", "uniprot", "accessions", "associated", "with", "this", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L346-L360
31,814
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.getProteinAliases
public ArrayList<String> getProteinAliases() throws XPathExpressionException { ArrayList<String> aliasList = new ArrayList<String>(); if (uniprotDoc == null) { return aliasList; } Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, ...
java
public ArrayList<String> getProteinAliases() throws XPathExpressionException { ArrayList<String> aliasList = new ArrayList<String>(); if (uniprotDoc == null) { return aliasList; } Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, ...
[ "public", "ArrayList", "<", "String", ">", "getProteinAliases", "(", ")", "throws", "XPathExpressionException", "{", "ArrayList", "<", "String", ">", "aliasList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "if", "(", "uniprotDoc", "==", "nul...
Pull uniprot protein aliases associated with this sequence @return @throws XPathExpressionException
[ "Pull", "uniprot", "protein", "aliases", "associated", "with", "this", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L378-L425
31,815
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.getGeneAliases
public ArrayList<String> getGeneAliases() throws XPathExpressionException { ArrayList<String> aliasList = new ArrayList<String>(); if (uniprotDoc == null) { return aliasList; } Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "en...
java
public ArrayList<String> getGeneAliases() throws XPathExpressionException { ArrayList<String> aliasList = new ArrayList<String>(); if (uniprotDoc == null) { return aliasList; } Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "en...
[ "public", "ArrayList", "<", "String", ">", "getGeneAliases", "(", ")", "throws", "XPathExpressionException", "{", "ArrayList", "<", "String", ">", "aliasList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "if", "(", "uniprotDoc", "==", "null",...
Pull uniprot gene aliases associated with this sequence @return @throws XPathExpressionException
[ "Pull", "uniprot", "gene", "aliases", "associated", "with", "this", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L432-L447
31,816
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.openURLConnection
private static HttpURLConnection openURLConnection(URL url) throws IOException { // This method should be moved to a utility class in BioJava 5.0 final int timeout = 5000; final String useragent = "BioJava"; HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("User-Age...
java
private static HttpURLConnection openURLConnection(URL url) throws IOException { // This method should be moved to a utility class in BioJava 5.0 final int timeout = 5000; final String useragent = "BioJava"; HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("User-Age...
[ "private", "static", "HttpURLConnection", "openURLConnection", "(", "URL", "url", ")", "throws", "IOException", "{", "// This method should be moved to a utility class in BioJava 5.0", "final", "int", "timeout", "=", "5000", ";", "final", "String", "useragent", "=", "\"Bi...
Open a URL connection. Follows redirects. @param url @throws IOException
[ "Open", "a", "URL", "connection", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L514-L560
31,817
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.getGeneName
public String getGeneName() { if (uniprotDoc == null) { return ""; } try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); Element geneElement = XMLHelper.selectSingleElement(entryElement, "gene"); if (geneElem...
java
public String getGeneName() { if (uniprotDoc == null) { return ""; } try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); Element geneElement = XMLHelper.selectSingleElement(entryElement, "gene"); if (geneElem...
[ "public", "String", "getGeneName", "(", ")", "{", "if", "(", "uniprotDoc", "==", "null", ")", "{", "return", "\"\"", ";", "}", "try", "{", "Element", "uniprotElement", "=", "uniprotDoc", ".", "getDocumentElement", "(", ")", ";", "Element", "entryElement", ...
Get the gene name associated with this sequence. @return
[ "Get", "the", "gene", "name", "associated", "with", "this", "sequence", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L690-L710
31,818
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.getKeyWords
@Override public ArrayList<String> getKeyWords() { ArrayList<String> keyWordsList = new ArrayList<String>(); if (uniprotDoc == null) { return keyWordsList; } try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ...
java
@Override public ArrayList<String> getKeyWords() { ArrayList<String> keyWordsList = new ArrayList<String>(); if (uniprotDoc == null) { return keyWordsList; } try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ...
[ "@", "Override", "public", "ArrayList", "<", "String", ">", "getKeyWords", "(", ")", "{", "ArrayList", "<", "String", ">", "keyWordsList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "if", "(", "uniprotDoc", "==", "null", ")", "{", "ret...
Pull UniProt key words which is a mixed bag of words associated with this sequence @return
[ "Pull", "UniProt", "key", "words", "which", "is", "a", "mixed", "bag", "of", "words", "associated", "with", "this", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L743-L763
31,819
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java
UniprotProxySequenceReader.getDatabaseReferences
@Override public LinkedHashMap<String, ArrayList<DBReferenceInfo>> getDatabaseReferences() { LinkedHashMap<String, ArrayList<DBReferenceInfo>> databaseReferencesHashMap = new LinkedHashMap<String, ArrayList<DBReferenceInfo>>(); if (uniprotDoc == null) { return databaseReferencesHashMap; } try { Element...
java
@Override public LinkedHashMap<String, ArrayList<DBReferenceInfo>> getDatabaseReferences() { LinkedHashMap<String, ArrayList<DBReferenceInfo>> databaseReferencesHashMap = new LinkedHashMap<String, ArrayList<DBReferenceInfo>>(); if (uniprotDoc == null) { return databaseReferencesHashMap; } try { Element...
[ "@", "Override", "public", "LinkedHashMap", "<", "String", ",", "ArrayList", "<", "DBReferenceInfo", ">", ">", "getDatabaseReferences", "(", ")", "{", "LinkedHashMap", "<", "String", ",", "ArrayList", "<", "DBReferenceInfo", ">", ">", "databaseReferencesHashMap", ...
The Uniprot mappings to other database identifiers for this sequence @return
[ "The", "Uniprot", "mappings", "to", "other", "database", "identifiers", "for", "this", "sequence" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L769-L804
31,820
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java
FastaAFPChainConverter.fastaToAfpChain
public static AFPChain fastaToAfpChain(Map<String, ProteinSequence> sequences, Structure structure1, Structure structure2) throws StructureException { if (sequences.size() != 2) { throw new IllegalArgumentException("There must be exactly 2 sequences, but there were " + sequences.size()); } if (structure1 ...
java
public static AFPChain fastaToAfpChain(Map<String, ProteinSequence> sequences, Structure structure1, Structure structure2) throws StructureException { if (sequences.size() != 2) { throw new IllegalArgumentException("There must be exactly 2 sequences, but there were " + sequences.size()); } if (structure1 ...
[ "public", "static", "AFPChain", "fastaToAfpChain", "(", "Map", "<", "String", ",", "ProteinSequence", ">", "sequences", ",", "Structure", "structure1", ",", "Structure", "structure2", ")", "throws", "StructureException", "{", "if", "(", "sequences", ".", "size", ...
Uses two sequences each with a corresponding structure to create an AFPChain corresponding to the alignment. Provided only for convenience since FastaReaders return such maps. @param sequences A Map containing exactly two entries from sequence names as Strings to gapped ProteinSequences; the name is ignored @see #fast...
[ "Uses", "two", "sequences", "each", "with", "a", "corresponding", "structure", "to", "create", "an", "AFPChain", "corresponding", "to", "the", "alignment", ".", "Provided", "only", "for", "convenience", "since", "FastaReaders", "return", "such", "maps", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java#L228-L247
31,821
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java
FastaAFPChainConverter.fastaToAfpChain
public static AFPChain fastaToAfpChain(SequencePair<Sequence<AminoAcidCompound>, AminoAcidCompound> alignment, Structure structure1, Structure structure2) throws StructureException { List<AlignedSequence<Sequence<AminoAcidCompound>, AminoAcidCompound>> seqs = alignment.getAlignedSequences(); StringBuilder sb1 = ...
java
public static AFPChain fastaToAfpChain(SequencePair<Sequence<AminoAcidCompound>, AminoAcidCompound> alignment, Structure structure1, Structure structure2) throws StructureException { List<AlignedSequence<Sequence<AminoAcidCompound>, AminoAcidCompound>> seqs = alignment.getAlignedSequences(); StringBuilder sb1 = ...
[ "public", "static", "AFPChain", "fastaToAfpChain", "(", "SequencePair", "<", "Sequence", "<", "AminoAcidCompound", ">", ",", "AminoAcidCompound", ">", "alignment", ",", "Structure", "structure1", ",", "Structure", "structure2", ")", "throws", "StructureException", "{"...
Provided only for convenience. @see #fastaToAfpChain(ProteinSequence, ProteinSequence, Structure, Structure) @throws StructureException
[ "Provided", "only", "for", "convenience", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java#L310-L332
31,822
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java
FastaAFPChainConverter.main
public static void main(String[] args) throws StructureException, IOException { if (args.length != 3) { System.err.println("Usage: FastaAFPChainConverter fasta-file structure-1-name structure-2-name"); return; } File fasta = new File(args[0]); Structure structure1 = StructureTools.getStructure(args[1]); ...
java
public static void main(String[] args) throws StructureException, IOException { if (args.length != 3) { System.err.println("Usage: FastaAFPChainConverter fasta-file structure-1-name structure-2-name"); return; } File fasta = new File(args[0]); Structure structure1 = StructureTools.getStructure(args[1]); ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "StructureException", ",", "IOException", "{", "if", "(", "args", ".", "length", "!=", "3", ")", "{", "System", ".", "err", ".", "println", "(", "\"Usage: FastaAFPChainConv...
Prints out the XML representation of an AFPChain from a file containing exactly two FASTA sequences. @param args A String array of fasta-file structure-1-name structure-2-name @throws StructureException @throws IOException
[ "Prints", "out", "the", "XML", "representation", "of", "an", "AFPChain", "from", "a", "file", "containing", "exactly", "two", "FASTA", "sequences", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java#L397-L410
31,823
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/math/SymbolTable.java
SymbolTable.put
public void put(Key key, Value val) { if (val == null) st.remove(key); else st.put(key, val); }
java
public void put(Key key, Value val) { if (val == null) st.remove(key); else st.put(key, val); }
[ "public", "void", "put", "(", "Key", "key", ",", "Value", "val", ")", "{", "if", "(", "val", "==", "null", ")", "st", ".", "remove", "(", "key", ")", ";", "else", "st", ".", "put", "(", "key", ",", "val", ")", ";", "}" ]
Put key-value pair into the symbol table. Remove key from table if value is null.
[ "Put", "key", "-", "value", "pair", "into", "the", "symbol", "table", ".", "Remove", "key", "from", "table", "if", "value", "is", "null", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SymbolTable.java#L79-L82
31,824
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/math/SymbolTable.java
SymbolTable.ceil
public Key ceil(Key k) { SortedMap<Key, Value> tail = st.tailMap(k); if (tail.isEmpty()) return null; else return tail.firstKey(); }
java
public Key ceil(Key k) { SortedMap<Key, Value> tail = st.tailMap(k); if (tail.isEmpty()) return null; else return tail.firstKey(); }
[ "public", "Key", "ceil", "(", "Key", "k", ")", "{", "SortedMap", "<", "Key", ",", "Value", ">", "tail", "=", "st", ".", "tailMap", "(", "k", ")", ";", "if", "(", "tail", ".", "isEmpty", "(", ")", ")", "return", "null", ";", "else", "return", "t...
Return the smallest key in the table >= k.
[ "Return", "the", "smallest", "key", "in", "the", "table", ">", "=", "k", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SymbolTable.java#L149-L153
31,825
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/math/SymbolTable.java
SymbolTable.floor
public Key floor(Key k) { if (st.containsKey(k)) return k; // does not include key if present (!) SortedMap<Key, Value> head = st.headMap(k); if (head.isEmpty()) return null; else return head.lastKey(); }
java
public Key floor(Key k) { if (st.containsKey(k)) return k; // does not include key if present (!) SortedMap<Key, Value> head = st.headMap(k); if (head.isEmpty()) return null; else return head.lastKey(); }
[ "public", "Key", "floor", "(", "Key", "k", ")", "{", "if", "(", "st", ".", "containsKey", "(", "k", ")", ")", "return", "k", ";", "// does not include key if present (!)", "SortedMap", "<", "Key", ",", "Value", ">", "head", "=", "st", ".", "headMap", "...
Return the largest key in the table <= k.
[ "Return", "the", "largest", "key", "in", "the", "table", "<", "=", "k", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SymbolTable.java#L158-L165
31,826
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericFastaHeaderParser.java
GenericFastaHeaderParser.getHeaderValues
private String[] getHeaderValues(String header) { String[] data = new String[0]; ArrayList<String> values = new ArrayList<String>(); StringBuffer sb = new StringBuffer(); //commented out 1/11/2012 to resolve an issue where headers do contain a length= at the end that are not recognized //if(header.indexOf("le...
java
private String[] getHeaderValues(String header) { String[] data = new String[0]; ArrayList<String> values = new ArrayList<String>(); StringBuffer sb = new StringBuffer(); //commented out 1/11/2012 to resolve an issue where headers do contain a length= at the end that are not recognized //if(header.indexOf("le...
[ "private", "String", "[", "]", "getHeaderValues", "(", "String", "header", ")", "{", "String", "[", "]", "data", "=", "new", "String", "[", "0", "]", ";", "ArrayList", "<", "String", ">", "values", "=", "new", "ArrayList", "<", "String", ">", "(", ")...
Parse out the components where some have a | and others do not @param header @return
[ "Parse", "out", "the", "components", "where", "some", "have", "a", "|", "and", "others", "do", "not" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericFastaHeaderParser.java#L72-L103
31,827
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java
Alignments.getListFromFutures
static <E> List<E> getListFromFutures(List<Future<E>> futures) { List<E> list = new ArrayList<E>(); for (Future<E> f : futures) { // TODO when added to ConcurrencyTools, log completions and exceptions instead of printing stack traces try { list.add(f.get()); } catch (InterruptedException e) { logge...
java
static <E> List<E> getListFromFutures(List<Future<E>> futures) { List<E> list = new ArrayList<E>(); for (Future<E> f : futures) { // TODO when added to ConcurrencyTools, log completions and exceptions instead of printing stack traces try { list.add(f.get()); } catch (InterruptedException e) { logge...
[ "static", "<", "E", ">", "List", "<", "E", ">", "getListFromFutures", "(", "List", "<", "Future", "<", "E", ">", ">", "futures", ")", "{", "List", "<", "E", ">", "list", "=", "new", "ArrayList", "<", "E", ">", "(", ")", ";", "for", "(", "Future...
Factory method which retrieves calculated elements from a list of tasks on the concurrent execution queue. @param <E> each task calculates a value of type E @param futures list of tasks @return calculated elements
[ "Factory", "method", "which", "retrieves", "calculated", "elements", "from", "a", "list", "of", "tasks", "on", "the", "concurrent", "execution", "queue", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L293-L306
31,828
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java
Alignments.getPairwiseAligner
public static <S extends Sequence<C>, C extends Compound> PairwiseSequenceAligner<S, C> getPairwiseAligner( S query, S target, PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) { if (!query.getCompoundSet().equals(target.getCompoundSet())) { throw new IllegalArgumentEx...
java
public static <S extends Sequence<C>, C extends Compound> PairwiseSequenceAligner<S, C> getPairwiseAligner( S query, S target, PairwiseSequenceAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) { if (!query.getCompoundSet().equals(target.getCompoundSet())) { throw new IllegalArgumentEx...
[ "public", "static", "<", "S", "extends", "Sequence", "<", "C", ">", ",", "C", "extends", "Compound", ">", "PairwiseSequenceAligner", "<", "S", ",", "C", ">", "getPairwiseAligner", "(", "S", "query", ",", "S", "target", ",", "PairwiseSequenceAlignerType", "ty...
Factory method which constructs a pairwise sequence aligner. @param <S> each {@link Sequence} of an alignment pair is of type S @param <C> each element of an {@link AlignedSequence} is a {@link Compound} of type C @param query the first {@link Sequence} to align @param target the second {@link Sequence} to align @para...
[ "Factory", "method", "which", "constructs", "a", "pairwise", "sequence", "aligner", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L320-L338
31,829
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java
Alignments.getPairwiseScorer
static <S extends Sequence<C>, C extends Compound> PairwiseSequenceScorer<S, C> getPairwiseScorer( S query, S target, PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) { switch (type) { default: case GLOBAL: return getPairwiseAligner(query, target, PairwiseSequenceA...
java
static <S extends Sequence<C>, C extends Compound> PairwiseSequenceScorer<S, C> getPairwiseScorer( S query, S target, PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) { switch (type) { default: case GLOBAL: return getPairwiseAligner(query, target, PairwiseSequenceA...
[ "static", "<", "S", "extends", "Sequence", "<", "C", ">", ",", "C", "extends", "Compound", ">", "PairwiseSequenceScorer", "<", "S", ",", "C", ">", "getPairwiseScorer", "(", "S", "query", ",", "S", "target", ",", "PairwiseSequenceScorerType", "type", ",", "...
Factory method which constructs a pairwise sequence scorer. @param <S> each {@link Sequence} of a pair is of type S @param <C> each element of a {@link Sequence} is a {@link Compound} of type C @param query the first {@link Sequence} to score @param target the second {@link Sequence} to score @param type chosen type f...
[ "Factory", "method", "which", "constructs", "a", "pairwise", "sequence", "scorer", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L369-L396
31,830
biojava/biojava
biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java
Alignments.getProfileProfileAligner
static <S extends Sequence<C>, C extends Compound> ProfileProfileAligner<S, C> getProfileProfileAligner( Future<ProfilePair<S, C>> profile1, Future<ProfilePair<S, C>> profile2, ProfileProfileAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) { switch (type) { default: case GLOBAL: ...
java
static <S extends Sequence<C>, C extends Compound> ProfileProfileAligner<S, C> getProfileProfileAligner( Future<ProfilePair<S, C>> profile1, Future<ProfilePair<S, C>> profile2, ProfileProfileAlignerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) { switch (type) { default: case GLOBAL: ...
[ "static", "<", "S", "extends", "Sequence", "<", "C", ">", ",", "C", "extends", "Compound", ">", "ProfileProfileAligner", "<", "S", ",", "C", ">", "getProfileProfileAligner", "(", "Future", "<", "ProfilePair", "<", "S", ",", "C", ">", ">", "profile1", ","...
Factory method which constructs a profile-profile aligner. @param <S> each {@link Sequence} of an alignment profile is of type S @param <C> each element of an {@link AlignedSequence} is a {@link Compound} of type C @param profile1 the first {@link Profile} to align @param profile2 the second {@link Profile} to align @...
[ "Factory", "method", "which", "constructs", "a", "profile", "-", "profile", "aligner", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L440-L456
31,831
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaStructureParser.java
FastaStructureParser.process
public void process() throws IOException, StructureException { if(sequences == null) { // only process once, then return cached values LinkedHashMap<String, ProteinSequence> sequenceMap = reader.process(); sequences = sequenceMap.values().toArray(new ProteinSequence[0]); accessions = new String[sequences.le...
java
public void process() throws IOException, StructureException { if(sequences == null) { // only process once, then return cached values LinkedHashMap<String, ProteinSequence> sequenceMap = reader.process(); sequences = sequenceMap.values().toArray(new ProteinSequence[0]); accessions = new String[sequences.le...
[ "public", "void", "process", "(", ")", "throws", "IOException", ",", "StructureException", "{", "if", "(", "sequences", "==", "null", ")", "{", "// only process once, then return cached values", "LinkedHashMap", "<", "String", ",", "ProteinSequence", ">", "sequenceMap...
Parses the fasta file and loads it into memory. Information can be subsequently accessed through {@link #getSequences()}, {@link #getStructures()}, {@link #getResidues()}, and {@link #getAccessions()}. @throws IOException @throws StructureException
[ "Parses", "the", "fasta", "file", "and", "loads", "it", "into", "memory", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaStructureParser.java#L110-L131
31,832
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java
FileDownloadUtils.downloadFile
public static void downloadFile(URL url, File destination) throws IOException { int count = 0; int maxTries = 10; int timeout = 60000; //60 sec File tempFile = File.createTempFile(getFilePrefix(destination), "." + getFileExtension(destination)); // Took following recipe from stackoverflow: // http://stack...
java
public static void downloadFile(URL url, File destination) throws IOException { int count = 0; int maxTries = 10; int timeout = 60000; //60 sec File tempFile = File.createTempFile(getFilePrefix(destination), "." + getFileExtension(destination)); // Took following recipe from stackoverflow: // http://stack...
[ "public", "static", "void", "downloadFile", "(", "URL", "url", ",", "File", "destination", ")", "throws", "IOException", "{", "int", "count", "=", "0", ";", "int", "maxTries", "=", "10", ";", "int", "timeout", "=", "60000", ";", "//60 sec", "File", "temp...
Download the content provided at URL url and store the result to a local file, using a temp file to cache the content in case something goes wrong in download @param url @param destination @throws IOException
[ "Download", "the", "content", "provided", "at", "URL", "url", "and", "store", "the", "result", "to", "a", "local", "file", "using", "a", "temp", "file", "to", "cache", "the", "content", "in", "case", "something", "goes", "wrong", "in", "download" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java#L110-L151
31,833
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java
FileDownloadUtils.toUnixPath
public static String toUnixPath(String path) { String uPath = path; if (uPath.contains("\\")) { uPath = uPath.replaceAll("\\\\", "/"); } // this should be removed, it's need since "\" is added AtomCache code if (uPath.endsWith("//")) { uPath = uPath.substring(0, uPath.length() - 1); } if (!uPath.end...
java
public static String toUnixPath(String path) { String uPath = path; if (uPath.contains("\\")) { uPath = uPath.replaceAll("\\\\", "/"); } // this should be removed, it's need since "\" is added AtomCache code if (uPath.endsWith("//")) { uPath = uPath.substring(0, uPath.length() - 1); } if (!uPath.end...
[ "public", "static", "String", "toUnixPath", "(", "String", "path", ")", "{", "String", "uPath", "=", "path", ";", "if", "(", "uPath", ".", "contains", "(", "\"\\\\\"", ")", ")", "{", "uPath", "=", "uPath", ".", "replaceAll", "(", "\"\\\\\\\\\"", ",", "...
Converts path to Unix convention and adds a terminating slash if it was omitted @param path original platform dependent path @return path in Unix convention @author Peter Rose @since 3.2
[ "Converts", "path", "to", "Unix", "convention", "and", "adds", "a", "terminating", "slash", "if", "it", "was", "omitted" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java#L162-L175
31,834
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java
FileDownloadUtils.expandUserHome
public static String expandUserHome(String file) { if (file.startsWith("~" + File.separator)) { file = System.getProperty("user.home") + file.substring(1); } return file; }
java
public static String expandUserHome(String file) { if (file.startsWith("~" + File.separator)) { file = System.getProperty("user.home") + file.substring(1); } return file; }
[ "public", "static", "String", "expandUserHome", "(", "String", "file", ")", "{", "if", "(", "file", ".", "startsWith", "(", "\"~\"", "+", "File", ".", "separator", ")", ")", "{", "file", "=", "System", ".", "getProperty", "(", "\"user.home\"", ")", "+", ...
Expands ~ in paths to the user's home directory. <p> This does not work for some special cases for paths: Other users' homes (~user/...), and Tilde expansion within the path (/.../~/...) @param file @return
[ "Expands", "~", "in", "paths", "to", "the", "user", "s", "home", "directory", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java#L187-L192
31,835
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java
FileDownloadUtils.deleteDirectory
public static void deleteDirectory(Path dir) throws IOException { if(dir == null || !Files.exists(dir)) return; Files.walkFileTree(dir, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Files.delete...
java
public static void deleteDirectory(Path dir) throws IOException { if(dir == null || !Files.exists(dir)) return; Files.walkFileTree(dir, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Files.delete...
[ "public", "static", "void", "deleteDirectory", "(", "Path", "dir", ")", "throws", "IOException", "{", "if", "(", "dir", "==", "null", "||", "!", "Files", ".", "exists", "(", "dir", ")", ")", "return", ";", "Files", ".", "walkFileTree", "(", "dir", ",",...
Recursively delete a folder & contents @param dir directory to delete
[ "Recursively", "delete", "a", "folder", "&", "contents" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java#L255-L274
31,836
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ChemicalComponentDictionary.java
ChemicalComponentDictionary.getParent
public ChemComp getParent(ChemComp c){ if (c.hasParent()){ return dictionary.get(c.getMon_nstd_parent_comp_id()); } return null; }
java
public ChemComp getParent(ChemComp c){ if (c.hasParent()){ return dictionary.get(c.getMon_nstd_parent_comp_id()); } return null; }
[ "public", "ChemComp", "getParent", "(", "ChemComp", "c", ")", "{", "if", "(", "c", ".", "hasParent", "(", ")", ")", "{", "return", "dictionary", ".", "get", "(", "c", ".", "getMon_nstd_parent_comp_id", "(", ")", ")", ";", "}", "return", "null", ";", ...
Get the parent of a component. If component has no parent, return null @param c @return get the parent component or null if ChemComp has no parent.
[ "Get", "the", "parent", "of", "a", "component", ".", "If", "component", "has", "no", "parent", "return", "null" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ChemicalComponentDictionary.java#L102-L108
31,837
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ChemicalComponentDictionary.java
ChemicalComponentDictionary.addChemComp
public void addChemComp(ChemComp comp){ dictionary.put(comp.getId(),comp); String rep = comp.getPdbx_replaces(); if ( (rep != null) && ( ! rep.equals("?"))){ replaces.put(comp.getId(),rep); } String isrep = comp.getPdbx_replaced_by(); if ( (isrep != null) && ( ! isrep.equals("?"))){ isreplacedby.put...
java
public void addChemComp(ChemComp comp){ dictionary.put(comp.getId(),comp); String rep = comp.getPdbx_replaces(); if ( (rep != null) && ( ! rep.equals("?"))){ replaces.put(comp.getId(),rep); } String isrep = comp.getPdbx_replaced_by(); if ( (isrep != null) && ( ! isrep.equals("?"))){ isreplacedby.put...
[ "public", "void", "addChemComp", "(", "ChemComp", "comp", ")", "{", "dictionary", ".", "put", "(", "comp", ".", "getId", "(", ")", ",", "comp", ")", ";", "String", "rep", "=", "comp", ".", "getPdbx_replaces", "(", ")", ";", "if", "(", "(", "rep", "...
add a new component to the dictionary @param comp
[ "add", "a", "new", "component", "to", "the", "dictionary" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ChemicalComponentDictionary.java#L116-L128
31,838
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java
GeneFeatureHelper.loadFastaAddGeneFeaturesFromGeneIDGFF2
static public LinkedHashMap<String, ChromosomeSequence> loadFastaAddGeneFeaturesFromGeneIDGFF2(File fastaSequenceFile, File gffFile) throws Exception { LinkedHashMap<String, DNASequence> dnaSequenceList = FastaReaderHelper.readFastaDNASequence(fastaSequenceFile); LinkedHashMap<String, ChromosomeSequence> chromosome...
java
static public LinkedHashMap<String, ChromosomeSequence> loadFastaAddGeneFeaturesFromGeneIDGFF2(File fastaSequenceFile, File gffFile) throws Exception { LinkedHashMap<String, DNASequence> dnaSequenceList = FastaReaderHelper.readFastaDNASequence(fastaSequenceFile); LinkedHashMap<String, ChromosomeSequence> chromosome...
[ "static", "public", "LinkedHashMap", "<", "String", ",", "ChromosomeSequence", ">", "loadFastaAddGeneFeaturesFromGeneIDGFF2", "(", "File", "fastaSequenceFile", ",", "File", "gffFile", ")", "throws", "Exception", "{", "LinkedHashMap", "<", "String", ",", "DNASequence", ...
Loads Fasta file and GFF2 feature file generated from the geneid prediction algorithm @param fastaSequenceFile @param gffFile @return @throws Exception
[ "Loads", "Fasta", "file", "and", "GFF2", "feature", "file", "generated", "from", "the", "geneid", "prediction", "algorithm" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java#L185-L191
31,839
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java
GeneFeatureHelper.loadFastaAddGeneFeaturesFromGmodGFF3
static public LinkedHashMap<String, ChromosomeSequence> loadFastaAddGeneFeaturesFromGmodGFF3(File fastaSequenceFile, File gffFile,boolean lazyloadsequences) throws Exception { LinkedHashMap<String, DNASequence> dnaSequenceList = FastaReaderHelper.readFastaDNASequence(fastaSequenceFile,lazyloadsequences); LinkedHash...
java
static public LinkedHashMap<String, ChromosomeSequence> loadFastaAddGeneFeaturesFromGmodGFF3(File fastaSequenceFile, File gffFile,boolean lazyloadsequences) throws Exception { LinkedHashMap<String, DNASequence> dnaSequenceList = FastaReaderHelper.readFastaDNASequence(fastaSequenceFile,lazyloadsequences); LinkedHash...
[ "static", "public", "LinkedHashMap", "<", "String", ",", "ChromosomeSequence", ">", "loadFastaAddGeneFeaturesFromGmodGFF3", "(", "File", "fastaSequenceFile", ",", "File", "gffFile", ",", "boolean", "lazyloadsequences", ")", "throws", "Exception", "{", "LinkedHashMap", "...
Lots of variations in the ontology or descriptors that can be used in GFF3 which requires writing a custom parser to handle a GFF3 generated or used by a specific application. Probably could be abstracted out but for now easier to handle with custom code to deal with gff3 elements that are not included but can be extra...
[ "Lots", "of", "variations", "in", "the", "ontology", "or", "descriptors", "that", "can", "be", "used", "in", "GFF3", "which", "requires", "writing", "a", "custom", "parser", "to", "handle", "a", "GFF3", "generated", "or", "used", "by", "a", "specific", "ap...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java#L337-L343
31,840
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/TwoBitFacade.java
TwoBitFacade.setChromosome
public void setChromosome(String chr) throws Exception { if ( twoBitParser == null){ } twoBitParser.close(); String[] names = twoBitParser.getSequenceNames(); for(int i=0;i<names.length;i++) { if ( names[i].equalsIgnoreCase(chr) ) { twoBitParser.setCurrentSequence(names[i]); break; } } }
java
public void setChromosome(String chr) throws Exception { if ( twoBitParser == null){ } twoBitParser.close(); String[] names = twoBitParser.getSequenceNames(); for(int i=0;i<names.length;i++) { if ( names[i].equalsIgnoreCase(chr) ) { twoBitParser.setCurrentSequence(names[i]); break; } } }
[ "public", "void", "setChromosome", "(", "String", "chr", ")", "throws", "Exception", "{", "if", "(", "twoBitParser", "==", "null", ")", "{", "}", "twoBitParser", ".", "close", "(", ")", ";", "String", "[", "]", "names", "=", "twoBitParser", ".", "getSequ...
Sets a chromosome for TwoBitParser. @param chr The chromosome name (e.g. chr21)
[ "Sets", "a", "chromosome", "for", "TwoBitParser", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/TwoBitFacade.java#L56-L68
31,841
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/TwoBitFacade.java
TwoBitFacade.getSequence
public String getSequence(String chromosomeName, int start, int end) throws Exception { twoBitParser.close(); twoBitParser.setCurrentSequence(chromosomeName); return twoBitParser.loadFragment(start,end-start); }
java
public String getSequence(String chromosomeName, int start, int end) throws Exception { twoBitParser.close(); twoBitParser.setCurrentSequence(chromosomeName); return twoBitParser.loadFragment(start,end-start); }
[ "public", "String", "getSequence", "(", "String", "chromosomeName", ",", "int", "start", ",", "int", "end", ")", "throws", "Exception", "{", "twoBitParser", ".", "close", "(", ")", ";", "twoBitParser", ".", "setCurrentSequence", "(", "chromosomeName", ")", ";"...
Extract a sequence from a chromosome, using chromosomal coordinates @param chromosomeName @param start @param end @return the DNASequence from the requested coordinates. @throws Exception
[ "Extract", "a", "sequence", "from", "a", "chromosome", "using", "chromosomal", "coordinates" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/TwoBitFacade.java#L78-L82
31,842
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/client/StructureName.java
StructureName.compareTo
@Override public int compareTo(StructureName o) { if ( this.equals(o)) return 0; String pdb1 = null; String pdb2 = null; try { pdb1 = this.getPdbId(); } catch (StructureException e) {} try { pdb2 = this.getPdbId(); } catch (StructureException e) {} int comp = 0; // Sort those with PDBIDs ...
java
@Override public int compareTo(StructureName o) { if ( this.equals(o)) return 0; String pdb1 = null; String pdb2 = null; try { pdb1 = this.getPdbId(); } catch (StructureException e) {} try { pdb2 = this.getPdbId(); } catch (StructureException e) {} int comp = 0; // Sort those with PDBIDs ...
[ "@", "Override", "public", "int", "compareTo", "(", "StructureName", "o", ")", "{", "if", "(", "this", ".", "equals", "(", "o", ")", ")", "return", "0", ";", "String", "pdb1", "=", "null", ";", "String", "pdb2", "=", "null", ";", "try", "{", "pdb1"...
Orders identifiers lexicographically by PDB ID and then full Identifier
[ "Orders", "identifiers", "lexicographically", "by", "PDB", "ID", "and", "then", "full", "Identifier" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/client/StructureName.java#L570-L608
31,843
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java
FileConvert.printPDBConnections
private String printPDBConnections(){ StringBuilder str = new StringBuilder(); for (Chain c:structure.getChains()) { for (Group g:c.getAtomGroups()) { for (Atom a:g.getAtoms()) { if (a.getBonds()!=null) { for (Bond b:a.getBonds()) { //7890123456789012345678901234567890123456789012345678901234...
java
private String printPDBConnections(){ StringBuilder str = new StringBuilder(); for (Chain c:structure.getChains()) { for (Group g:c.getAtomGroups()) { for (Atom a:g.getAtoms()) { if (a.getBonds()!=null) { for (Bond b:a.getBonds()) { //7890123456789012345678901234567890123456789012345678901234...
[ "private", "String", "printPDBConnections", "(", ")", "{", "StringBuilder", "str", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Chain", "c", ":", "structure", ".", "getChains", "(", ")", ")", "{", "for", "(", "Group", "g", ":", "c", ".", ...
Prints the connections in PDB style Rewritten since 5.0 to use {@link Bond}s Will produce strictly one CONECT record per bond (won't group several bonds in one line)
[ "Prints", "the", "connections", "in", "PDB", "style" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java#L117-L134
31,844
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java
FileConvert.toPDB
public static String toPDB(Atom a){ StringBuffer w = new StringBuffer(); toPDB(a,w); return w.toString(); }
java
public static String toPDB(Atom a){ StringBuffer w = new StringBuffer(); toPDB(a,w); return w.toString(); }
[ "public", "static", "String", "toPDB", "(", "Atom", "a", ")", "{", "StringBuffer", "w", "=", "new", "StringBuffer", "(", ")", ";", "toPDB", "(", "a", ",", "w", ")", ";", "return", "w", ".", "toString", "(", ")", ";", "}" ]
Prints the content of an Atom object as a PDB formatted line. @param a @return
[ "Prints", "the", "content", "of", "an", "Atom", "object", "as", "a", "PDB", "formatted", "line", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java#L303-L310
31,845
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java
FileConvert.toPDB
public static String toPDB(Chain chain){ StringBuffer w = new StringBuffer(); int nrGroups = chain.getAtomLength(); for ( int h=0; h<nrGroups;h++){ Group g= chain.getAtomGroup(h); toPDB(g,w); } return w.toString(); }
java
public static String toPDB(Chain chain){ StringBuffer w = new StringBuffer(); int nrGroups = chain.getAtomLength(); for ( int h=0; h<nrGroups;h++){ Group g= chain.getAtomGroup(h); toPDB(g,w); } return w.toString(); }
[ "public", "static", "String", "toPDB", "(", "Chain", "chain", ")", "{", "StringBuffer", "w", "=", "new", "StringBuffer", "(", ")", ";", "int", "nrGroups", "=", "chain", ".", "getAtomLength", "(", ")", ";", "for", "(", "int", "h", "=", "0", ";", "h", ...
Convert a Chain object to PDB representation @param chain @return
[ "Convert", "a", "Chain", "object", "to", "PDB", "representation" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java#L327-L342
31,846
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java
FileConvert.toPDB
public static String toPDB(Group g){ StringBuffer w = new StringBuffer(); toPDB(g,w); return w.toString(); }
java
public static String toPDB(Group g){ StringBuffer w = new StringBuffer(); toPDB(g,w); return w.toString(); }
[ "public", "static", "String", "toPDB", "(", "Group", "g", ")", "{", "StringBuffer", "w", "=", "new", "StringBuffer", "(", ")", ";", "toPDB", "(", "g", ",", "w", ")", ";", "return", "w", ".", "toString", "(", ")", ";", "}" ]
Convert a Group object to PDB representation @param g @return
[ "Convert", "a", "Group", "object", "to", "PDB", "representation" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java#L350-L354
31,847
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java
FileConvert.hasInsertionCode
private static boolean hasInsertionCode(String pdbserial) { try { Integer.parseInt(pdbserial) ; } catch (NumberFormatException e) { return true ; } return false ; }
java
private static boolean hasInsertionCode(String pdbserial) { try { Integer.parseInt(pdbserial) ; } catch (NumberFormatException e) { return true ; } return false ; }
[ "private", "static", "boolean", "hasInsertionCode", "(", "String", "pdbserial", ")", "{", "try", "{", "Integer", ".", "parseInt", "(", "pdbserial", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "true", ";", "}", "return", "...
test if pdbserial has an insertion code
[ "test", "if", "pdbserial", "has", "an", "insertion", "code" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FileConvert.java#L464-L471
31,848
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java
MMCIFFileTools.toSingleLoopLineMmCifString
private static String toSingleLoopLineMmCifString(Object record, Field[] fields, int[] sizes) { StringBuilder str = new StringBuilder(); Class<?> c = record.getClass(); if(fields == null) fields = getFields(c); if (sizes.length!=fields.length) throw new IllegalArgumentException("The given sizes of fie...
java
private static String toSingleLoopLineMmCifString(Object record, Field[] fields, int[] sizes) { StringBuilder str = new StringBuilder(); Class<?> c = record.getClass(); if(fields == null) fields = getFields(c); if (sizes.length!=fields.length) throw new IllegalArgumentException("The given sizes of fie...
[ "private", "static", "String", "toSingleLoopLineMmCifString", "(", "Object", "record", ",", "Field", "[", "]", "fields", ",", "int", "[", "]", "sizes", ")", "{", "StringBuilder", "str", "=", "new", "StringBuilder", "(", ")", ";", "Class", "<", "?", ">", ...
Given a mmCIF bean produces a String representing it in mmCIF loop format as a single record line @param record @param fields Set of fields for the record. If null, will be calculated from the class of the record @param sizes the size of each of the fields @return
[ "Given", "a", "mmCIF", "bean", "produces", "a", "String", "representing", "it", "in", "mmCIF", "loop", "format", "as", "a", "single", "record", "line" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java#L235-L278
31,849
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java
MMCIFFileTools.getFieldSizes
private static <T> int[] getFieldSizes(List<T> list, Field[] fields) { if (list.isEmpty()) throw new IllegalArgumentException("List of beans is empty!"); if(fields == null) fields = getFields(list.get(0).getClass()); int[] sizes = new int [fields.length]; for (T a:list) { int i = -1; for (Field f ...
java
private static <T> int[] getFieldSizes(List<T> list, Field[] fields) { if (list.isEmpty()) throw new IllegalArgumentException("List of beans is empty!"); if(fields == null) fields = getFields(list.get(0).getClass()); int[] sizes = new int [fields.length]; for (T a:list) { int i = -1; for (Field f ...
[ "private", "static", "<", "T", ">", "int", "[", "]", "getFieldSizes", "(", "List", "<", "T", ">", "list", ",", "Field", "[", "]", "fields", ")", "{", "if", "(", "list", ".", "isEmpty", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", ...
Finds the max length of each of the String values contained in each of the fields of the given list of beans. Useful for producing mmCIF loop data that is aligned for all columns. @param list list of objects. All objects should have the same class. @param fields Set of fields for the record. If null, will be calculated...
[ "Finds", "the", "max", "length", "of", "each", "of", "the", "String", "values", "contained", "in", "each", "of", "the", "fields", "of", "the", "given", "list", "of", "beans", ".", "Useful", "for", "producing", "mmCIF", "loop", "data", "that", "is", "alig...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java#L518-L557
31,850
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java
MMCIFFileTools.getMaxStringLength
private static int getMaxStringLength(String[] names) { int size = 0; for(String s : names) { if(s.length()>size) { size = s.length(); } } return size; }
java
private static int getMaxStringLength(String[] names) { int size = 0; for(String s : names) { if(s.length()>size) { size = s.length(); } } return size; }
[ "private", "static", "int", "getMaxStringLength", "(", "String", "[", "]", "names", ")", "{", "int", "size", "=", "0", ";", "for", "(", "String", "s", ":", "names", ")", "{", "if", "(", "s", ".", "length", "(", ")", ">", "size", ")", "{", "size",...
Finds the max length of a list of strings Useful for producing mmCIF single-record data that is aligned for all values. @param names @return @see #toMMCIF(String, Object)
[ "Finds", "the", "max", "length", "of", "a", "list", "of", "strings", "Useful", "for", "producing", "mmCIF", "single", "-", "record", "data", "that", "is", "aligned", "for", "all", "values", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java#L566-L574
31,851
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/HasResultXMLConverter.java
HasResultXMLConverter.toXML
public String toXML(boolean hasResult) throws IOException{ StringWriter swriter = new StringWriter(); PrintWriter writer = new PrintWriter(swriter); PrettyXMLWriter xml = new PrettyXMLWriter(writer); xml.openTag("alignment"); xml.attribute("hasResult", String.valueOf(hasResult)); xml.closeTag("alignment")...
java
public String toXML(boolean hasResult) throws IOException{ StringWriter swriter = new StringWriter(); PrintWriter writer = new PrintWriter(swriter); PrettyXMLWriter xml = new PrettyXMLWriter(writer); xml.openTag("alignment"); xml.attribute("hasResult", String.valueOf(hasResult)); xml.closeTag("alignment")...
[ "public", "String", "toXML", "(", "boolean", "hasResult", ")", "throws", "IOException", "{", "StringWriter", "swriter", "=", "new", "StringWriter", "(", ")", ";", "PrintWriter", "writer", "=", "new", "PrintWriter", "(", "swriter", ")", ";", "PrettyXMLWriter", ...
return flag if the server has a result @param hasResult @return flag if there is a result
[ "return", "flag", "if", "the", "server", "has", "a", "result" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/HasResultXMLConverter.java#L54-L65
31,852
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmResult.java
CeSymmResult.getRepeatsID
public List<StructureIdentifier> getRepeatsID() throws StructureException { if (!isRefined()) return null; List<StructureIdentifier> repeats = new ArrayList<StructureIdentifier>( numRepeats); String pdbId = structureId.toCanonical().getPdbId(); Block align = multipleAlignment.getBlocks().get(0); fo...
java
public List<StructureIdentifier> getRepeatsID() throws StructureException { if (!isRefined()) return null; List<StructureIdentifier> repeats = new ArrayList<StructureIdentifier>( numRepeats); String pdbId = structureId.toCanonical().getPdbId(); Block align = multipleAlignment.getBlocks().get(0); fo...
[ "public", "List", "<", "StructureIdentifier", ">", "getRepeatsID", "(", ")", "throws", "StructureException", "{", "if", "(", "!", "isRefined", "(", ")", ")", "return", "null", ";", "List", "<", "StructureIdentifier", ">", "repeats", "=", "new", "ArrayList", ...
Return the symmetric repeats as structure identifiers, if the result is symmetric and it was refined, return null otherwise. @return List of StructureIdentifiers or null if not defined @throws StructureException
[ "Return", "the", "symmetric", "repeats", "as", "structure", "identifiers", "if", "the", "result", "is", "symmetric", "and", "it", "was", "refined", "return", "null", "otherwise", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmResult.java#L103-L128
31,853
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmResult.java
CeSymmResult.getReason
public String getReason() { // Cases: // 1. Asymmetric because insignificant self-alignment (1itb.A_1-100) double tm = selfAlignment.getTMScore(); if (tm < params.getUnrefinedScoreThreshold()) { return String.format("Insignificant self-alignment (TM=%.2f)", tm); } // 2. Asymmetric because order detector ...
java
public String getReason() { // Cases: // 1. Asymmetric because insignificant self-alignment (1itb.A_1-100) double tm = selfAlignment.getTMScore(); if (tm < params.getUnrefinedScoreThreshold()) { return String.format("Insignificant self-alignment (TM=%.2f)", tm); } // 2. Asymmetric because order detector ...
[ "public", "String", "getReason", "(", ")", "{", "// Cases:", "// 1. Asymmetric because insignificant self-alignment (1itb.A_1-100)", "double", "tm", "=", "selfAlignment", ".", "getTMScore", "(", ")", ";", "if", "(", "tm", "<", "params", ".", "getUnrefinedScoreThreshold"...
Return a String describing the reasons for the CE-Symm final decision in this particular result. @return String decision reason
[ "Return", "a", "String", "describing", "the", "reasons", "for", "the", "CE", "-", "Symm", "final", "decision", "in", "this", "particular", "result", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmResult.java#L252-L301
31,854
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java
SequenceFunctionRefiner.initializeEligible
private static List<Integer> initializeEligible(Map<Integer, Integer> alignment, Map<Integer, Double> scores, List<Integer> eligible, int k, NavigableSet<Integer> forwardLoops, NavigableSet<Integer> backwardLoops) { // Eligible if: // 1. score(x)>0 // 2. f^K-1(x) is defined // 3. score(f^K-1(x))>0 // 4. Fo...
java
private static List<Integer> initializeEligible(Map<Integer, Integer> alignment, Map<Integer, Double> scores, List<Integer> eligible, int k, NavigableSet<Integer> forwardLoops, NavigableSet<Integer> backwardLoops) { // Eligible if: // 1. score(x)>0 // 2. f^K-1(x) is defined // 3. score(f^K-1(x))>0 // 4. Fo...
[ "private", "static", "List", "<", "Integer", ">", "initializeEligible", "(", "Map", "<", "Integer", ",", "Integer", ">", "alignment", ",", "Map", "<", "Integer", ",", "Double", ">", "scores", ",", "List", "<", "Integer", ">", "eligible", ",", "int", "k",...
Helper method to initialize eligible residues. Eligible if: 1. score(x)>0 2. f^K-1(x) is defined 3. score(f^K-1(x))>0 4. For all y, score(y)==0 implies sign(f^K-1(x)-y) == sign(x-f(y) ) @param alignment The alignment with respect to which to calculate eligibility @param scores An up-to-date map from residues to their ...
[ "Helper", "method", "to", "initialize", "eligible", "residues", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java#L232-L320
31,855
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java
SequenceFunctionRefiner.initializeScores
private static Map<Integer, Double> initializeScores(Map<Integer, Integer> alignment, Map<Integer, Double> scores, int k) { if(scores == null) { scores = new HashMap<Integer, Double>(alignment.size()); } else { scores.clear(); } Map<Integer,Integer> alignK = AlignmentTools.applyAlignment(alignment, k);...
java
private static Map<Integer, Double> initializeScores(Map<Integer, Integer> alignment, Map<Integer, Double> scores, int k) { if(scores == null) { scores = new HashMap<Integer, Double>(alignment.size()); } else { scores.clear(); } Map<Integer,Integer> alignK = AlignmentTools.applyAlignment(alignment, k);...
[ "private", "static", "Map", "<", "Integer", ",", "Double", ">", "initializeScores", "(", "Map", "<", "Integer", ",", "Integer", ">", "alignment", ",", "Map", "<", "Integer", ",", "Double", ">", "scores", ",", "int", "k", ")", "{", "if", "(", "scores", ...
Calculates all scores for an alignment @param alignment @param scores A mapping from residues to scores, which will be updated or created if null @return scores
[ "Calculates", "all", "scores", "for", "an", "alignment" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java#L372-L397
31,856
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java
SequenceFunctionRefiner.partitionAFPchain
private static AFPChain partitionAFPchain(AFPChain afpChain, Atom[] ca1, Atom[] ca2, int order) throws StructureException{ int[][][] newAlgn = new int[order][][]; int repeatLen = afpChain.getOptLength()/order; //Extract all the residues considered in the first chain of the alignment List<Integer> alignedRe...
java
private static AFPChain partitionAFPchain(AFPChain afpChain, Atom[] ca1, Atom[] ca2, int order) throws StructureException{ int[][][] newAlgn = new int[order][][]; int repeatLen = afpChain.getOptLength()/order; //Extract all the residues considered in the first chain of the alignment List<Integer> alignedRe...
[ "private", "static", "AFPChain", "partitionAFPchain", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ",", "int", "order", ")", "throws", "StructureException", "{", "int", "[", "]", "[", "]", "[", "]", "newAlgn", ...
Partitions an afpChain alignment into order blocks of aligned residues. @param afpChain @param ca1 @param ca2 @param order @return @throws StructureException
[ "Partitions", "an", "afpChain", "alignment", "into", "order", "blocks", "of", "aligned", "residues", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java#L440-L467
31,857
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SubstitutionMatrixHelper.java
SubstitutionMatrixHelper.getAminoAcidMatrix
private static SubstitutionMatrix<AminoAcidCompound> getAminoAcidMatrix(String file) { if (!aminoAcidMatrices.containsKey(file)) { aminoAcidMatrices.put(file, new SimpleSubstitutionMatrix<AminoAcidCompound>( AminoAcidCompoundSet.getAminoAcidCompoundSet(), getReader(file), file)); } return aminoAcidMatrice...
java
private static SubstitutionMatrix<AminoAcidCompound> getAminoAcidMatrix(String file) { if (!aminoAcidMatrices.containsKey(file)) { aminoAcidMatrices.put(file, new SimpleSubstitutionMatrix<AminoAcidCompound>( AminoAcidCompoundSet.getAminoAcidCompoundSet(), getReader(file), file)); } return aminoAcidMatrice...
[ "private", "static", "SubstitutionMatrix", "<", "AminoAcidCompound", ">", "getAminoAcidMatrix", "(", "String", "file", ")", "{", "if", "(", "!", "aminoAcidMatrices", ".", "containsKey", "(", "file", ")", ")", "{", "aminoAcidMatrices", ".", "put", "(", "file", ...
reads in an amino acid substitution matrix, if necessary
[ "reads", "in", "an", "amino", "acid", "substitution", "matrix", "if", "necessary" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SubstitutionMatrixHelper.java#L252-L258
31,858
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SubstitutionMatrixHelper.java
SubstitutionMatrixHelper.getNucleotideMatrix
private static SubstitutionMatrix<NucleotideCompound> getNucleotideMatrix(String file) { if (!nucleotideMatrices.containsKey(file)) { nucleotideMatrices.put(file, new SimpleSubstitutionMatrix<NucleotideCompound>( AmbiguityDNACompoundSet.getDNACompoundSet(), getReader(file), file)); } return nucleotideMatr...
java
private static SubstitutionMatrix<NucleotideCompound> getNucleotideMatrix(String file) { if (!nucleotideMatrices.containsKey(file)) { nucleotideMatrices.put(file, new SimpleSubstitutionMatrix<NucleotideCompound>( AmbiguityDNACompoundSet.getDNACompoundSet(), getReader(file), file)); } return nucleotideMatr...
[ "private", "static", "SubstitutionMatrix", "<", "NucleotideCompound", ">", "getNucleotideMatrix", "(", "String", "file", ")", "{", "if", "(", "!", "nucleotideMatrices", ".", "containsKey", "(", "file", ")", ")", "{", "nucleotideMatrices", ".", "put", "(", "file"...
reads in a nucleotide substitution matrix, if necessary
[ "reads", "in", "a", "nucleotide", "substitution", "matrix", "if", "necessary" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SubstitutionMatrixHelper.java#L261-L267
31,859
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SubstitutionMatrixHelper.java
SubstitutionMatrixHelper.getReader
private static InputStreamReader getReader(String file) { String resourcePathPrefix = "matrices/"; return new InputStreamReader(SubstitutionMatrixHelper.class.getResourceAsStream(String.format("/%s.txt", resourcePathPrefix+file))); }
java
private static InputStreamReader getReader(String file) { String resourcePathPrefix = "matrices/"; return new InputStreamReader(SubstitutionMatrixHelper.class.getResourceAsStream(String.format("/%s.txt", resourcePathPrefix+file))); }
[ "private", "static", "InputStreamReader", "getReader", "(", "String", "file", ")", "{", "String", "resourcePathPrefix", "=", "\"matrices/\"", ";", "return", "new", "InputStreamReader", "(", "SubstitutionMatrixHelper", ".", "class", ".", "getResourceAsStream", "(", "St...
reads in a substitution matrix from a resource file
[ "reads", "in", "a", "substitution", "matrix", "from", "a", "resource", "file" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/SubstitutionMatrixHelper.java#L270-L274
31,860
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.getNewGroup
private Group getNewGroup(String recordName,Character aminoCode1, String aminoCode3) { Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(aminoCode3); if ( g != null && !g.getChemComp().isEmpty()) return g; Group group; if (aminoCode1 == null || StructureTools.UNKNOWN_GROUP_LABEL == aminoCode1...
java
private Group getNewGroup(String recordName,Character aminoCode1, String aminoCode3) { Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(aminoCode3); if ( g != null && !g.getChemComp().isEmpty()) return g; Group group; if (aminoCode1 == null || StructureTools.UNKNOWN_GROUP_LABEL == aminoCode1...
[ "private", "Group", "getNewGroup", "(", "String", "recordName", ",", "Character", "aminoCode1", ",", "String", "aminoCode3", ")", "{", "Group", "g", "=", "ChemCompGroupFactory", ".", "getGroupFromChemCompDictionary", "(", "aminoCode3", ")", ";", "if", "(", "g", ...
initiate new resNum, either Hetatom, Nucleotide, or AminoAcid
[ "initiate", "new", "resNum", "either", "Hetatom", "Nucleotide", "or", "AminoAcid" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L302-L326
31,861
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.pdb_JRNL_Handler
private void pdb_JRNL_Handler(String line) { //add the strings to the journalLines //the actual JournalArticle is then built when the whole entry is being //finalized with triggerEndFileChecks() //JRNL TITL NMR SOLUTION STRUCTURE OF RECOMBINANT TICK 1TAP 10 if (line.substring(line.length()...
java
private void pdb_JRNL_Handler(String line) { //add the strings to the journalLines //the actual JournalArticle is then built when the whole entry is being //finalized with triggerEndFileChecks() //JRNL TITL NMR SOLUTION STRUCTURE OF RECOMBINANT TICK 1TAP 10 if (line.substring(line.length()...
[ "private", "void", "pdb_JRNL_Handler", "(", "String", "line", ")", "{", "//add the strings to the journalLines", "//the actual JournalArticle is then built when the whole entry is being", "//finalized with triggerEndFileChecks()", "//JRNL TITL NMR SOLUTION STRUCTURE OF RECOMBINANT TIC...
JRNL handler. The JRNL record contains the primary literature citation that describes the experiment which resulted in the deposited coordinate set. There is at most one JRNL reference per entry. If there is no primary reference, then there is no JRNL reference. Other references are given in REMARK 1. Record Format <p...
[ "JRNL", "handler", ".", "The", "JRNL", "record", "contains", "the", "primary", "literature", "citation", "that", "describes", "the", "experiment", "which", "resulted", "in", "the", "deposited", "coordinate", "set", ".", "There", "is", "at", "most", "one", "JRN...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L881-L897
31,862
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.pdb_SOURCE_Handler
private void pdb_SOURCE_Handler(String line) { // works in the same way as the pdb_COMPND_Handler. String continuationNr = line.substring(9, 10).trim(); logger.debug("current continuationNo is " + continuationNr); logger.debug("previousContinuationField is " + previousContinuationField); logge...
java
private void pdb_SOURCE_Handler(String line) { // works in the same way as the pdb_COMPND_Handler. String continuationNr = line.substring(9, 10).trim(); logger.debug("current continuationNo is " + continuationNr); logger.debug("previousContinuationField is " + previousContinuationField); logge...
[ "private", "void", "pdb_SOURCE_Handler", "(", "String", "line", ")", "{", "// works in the same way as the pdb_COMPND_Handler.", "String", "continuationNr", "=", "line", ".", "substring", "(", "9", ",", "10", ")", ".", "trim", "(", ")", ";", "logger", ".", "debu...
Handler for SOURCE Record format The SOURCE record specifies the biological and/or chemical source of each biological molecule in the entry. Sources are described by both the common name and the scientific name, e.g., genus and species. Strain and/or cell-line for immortalized cells are given when they help to uniquel...
[ "Handler", "for", "SOURCE", "Record", "format" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L1133-L1239
31,863
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.pdb_REMARK_Handler
private void pdb_REMARK_Handler(String line) { if ( line == null || line.length() < 11) return; if (line.startsWith("REMARK 800")) { pdb_REMARK_800_Handler(line); } else if ( line.startsWith("REMARK 350")){ if ( params.isParseBioAssembly()) { if (bioAssemblyParser == null){ bioAssemblyPar...
java
private void pdb_REMARK_Handler(String line) { if ( line == null || line.length() < 11) return; if (line.startsWith("REMARK 800")) { pdb_REMARK_800_Handler(line); } else if ( line.startsWith("REMARK 350")){ if ( params.isParseBioAssembly()) { if (bioAssemblyParser == null){ bioAssemblyPar...
[ "private", "void", "pdb_REMARK_Handler", "(", "String", "line", ")", "{", "if", "(", "line", "==", "null", "||", "line", ".", "length", "(", ")", "<", "11", ")", "return", ";", "if", "(", "line", ".", "startsWith", "(", "\"REMARK 800\"", ")", ")", "{...
Handler for REMARK lines
[ "Handler", "for", "REMARK", "lines" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L1336-L1405
31,864
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.conect_helper
private Integer conect_helper (String line,int start,int end) { if (line.length() < end) return null; String sbond = line.substring(start,end).trim(); int bond = -1 ; Integer b = null ; if ( ! sbond.equals("")) { bond = Integer.parseInt(sbond); b = new Integer(bond); } return b ; }
java
private Integer conect_helper (String line,int start,int end) { if (line.length() < end) return null; String sbond = line.substring(start,end).trim(); int bond = -1 ; Integer b = null ; if ( ! sbond.equals("")) { bond = Integer.parseInt(sbond); b = new Integer(bond); } return b ; }
[ "private", "Integer", "conect_helper", "(", "String", "line", ",", "int", "start", ",", "int", "end", ")", "{", "if", "(", "line", ".", "length", "(", ")", "<", "end", ")", "return", "null", ";", "String", "sbond", "=", "line", ".", "substring", "(",...
safes repeating a few lines ...
[ "safes", "repeating", "a", "few", "lines", "..." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L2004-L2017
31,865
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.pdb_SSBOND_Handler
private void pdb_SSBOND_Handler(String line){ if (params.isHeaderOnly()) return; if (line.length()<36) { logger.info("SSBOND line has length under 36. Ignoring it."); return; } String chain1 = line.substring(15,16); String seqNum1 = line.substring(17,21).trim(); String icode1 = line.s...
java
private void pdb_SSBOND_Handler(String line){ if (params.isHeaderOnly()) return; if (line.length()<36) { logger.info("SSBOND line has length under 36. Ignoring it."); return; } String chain1 = line.substring(15,16); String seqNum1 = line.substring(17,21).trim(); String icode1 = line.s...
[ "private", "void", "pdb_SSBOND_Handler", "(", "String", "line", ")", "{", "if", "(", "params", ".", "isHeaderOnly", "(", ")", ")", "return", ";", "if", "(", "line", ".", "length", "(", ")", "<", "36", ")", "{", "logger", ".", "info", "(", "\"SSBOND l...
Process the disulfide bond info provided by an SSBOND record <pre> COLUMNS DATA TYPE FIELD DEFINITION ------------------------------------------------------------------- 1 - 6 Record name "SSBOND" 8 - 10 Integer serNum Serial number. 12 - 14 LString(3) ...
[ "Process", "the", "disulfide", "bond", "info", "provided", "by", "an", "SSBOND", "record" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L2214-L2256
31,866
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.isKnownChain
private static Chain isKnownChain(String chainID, List<Chain> chains){ for (int i = 0; i< chains.size();i++){ Chain testchain = chains.get(i); if (chainID.equals(testchain.getName())) { return testchain; } } return null; }
java
private static Chain isKnownChain(String chainID, List<Chain> chains){ for (int i = 0; i< chains.size();i++){ Chain testchain = chains.get(i); if (chainID.equals(testchain.getName())) { return testchain; } } return null; }
[ "private", "static", "Chain", "isKnownChain", "(", "String", "chainID", ",", "List", "<", "Chain", ">", "chains", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "chains", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Chain", "test...
Finds in the given list of chains the first one that has as name the given chainID. If no such Chain can be found it returns null.
[ "Finds", "in", "the", "given", "list", "of", "chains", "the", "first", "one", "that", "has", "as", "name", "the", "given", "chainID", ".", "If", "no", "such", "Chain", "can", "be", "found", "it", "returns", "null", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L2514-L2524
31,867
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.makeCompounds
private void makeCompounds(List<String> compoundList, List<String> sourceList) { // System.out.println("[makeCompounds] making compounds from compoundLines"); for (String line : compoundList) { if (compoundList.indexOf(line) + 1 == compoundList.size()) { // System.out.println("[makeCompounds] Final l...
java
private void makeCompounds(List<String> compoundList, List<String> sourceList) { // System.out.println("[makeCompounds] making compounds from compoundLines"); for (String line : compoundList) { if (compoundList.indexOf(line) + 1 == compoundList.size()) { // System.out.println("[makeCompounds] Final l...
[ "private", "void", "makeCompounds", "(", "List", "<", "String", ">", "compoundList", ",", "List", "<", "String", ">", "sourceList", ")", "{", "//\t\tSystem.out.println(\"[makeCompounds] making compounds from compoundLines\");", "for", "(", "String", "line", ":", "compou...
This is the new method for building the COMPND and SOURCE records. Now each method is self-contained. @author Jules Jacobsen @param compoundList @param sourceList
[ "This", "is", "the", "new", "method", "for", "building", "the", "COMPND", "and", "SOURCE", "records", ".", "Now", "each", "method", "is", "self", "-", "contained", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L2731-L2758
31,868
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.findChains
private static List<List<Chain>> findChains(String chainName, List<List<Chain>> polyModels) { List<List<Chain>> models = new ArrayList<>(); for (List<Chain> chains:polyModels) { List<Chain> matchingChains = new ArrayList<>(); models.add(matchingChains); for (Chain c:chains) { if (c.getName().equals(ch...
java
private static List<List<Chain>> findChains(String chainName, List<List<Chain>> polyModels) { List<List<Chain>> models = new ArrayList<>(); for (List<Chain> chains:polyModels) { List<Chain> matchingChains = new ArrayList<>(); models.add(matchingChains); for (Chain c:chains) { if (c.getName().equals(ch...
[ "private", "static", "List", "<", "List", "<", "Chain", ">", ">", "findChains", "(", "String", "chainName", ",", "List", "<", "List", "<", "Chain", ">", ">", "polyModels", ")", "{", "List", "<", "List", "<", "Chain", ">>", "models", "=", "new", "Arra...
Gets all chains with given chainName from given models list @param chainName @param polyModels @return
[ "Gets", "all", "chains", "with", "given", "chainName", "from", "given", "models", "list" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L2968-L2981
31,869
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.assignAsymIds
private void assignAsymIds(List<List<Chain>> polys, List<List<Chain>> nonPolys, List<List<Chain>> waters) { for (int i=0; i<polys.size(); i++) { String asymId = "A"; for (Chain poly:polys.get(i)) { poly.setId(asymId); asymId = getNextAsymId(asymId); } for (Chain nonPoly:nonPolys.get(i)) { no...
java
private void assignAsymIds(List<List<Chain>> polys, List<List<Chain>> nonPolys, List<List<Chain>> waters) { for (int i=0; i<polys.size(); i++) { String asymId = "A"; for (Chain poly:polys.get(i)) { poly.setId(asymId); asymId = getNextAsymId(asymId); } for (Chain nonPoly:nonPolys.get(i)) { no...
[ "private", "void", "assignAsymIds", "(", "List", "<", "List", "<", "Chain", ">", ">", "polys", ",", "List", "<", "List", "<", "Chain", ">", ">", "nonPolys", ",", "List", "<", "List", "<", "Chain", ">", ">", "waters", ")", "{", "for", "(", "int", ...
Assign asym ids following the rules used by the PDB to assign asym ids in mmCIF files @param polys @param nonPolys @param waters
[ "Assign", "asym", "ids", "following", "the", "rules", "used", "by", "the", "PDB", "to", "assign", "asym", "ids", "in", "mmCIF", "files" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L3047-L3065
31,870
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
PDBFileParser.linkSitesToGroups
private void linkSitesToGroups() { //System.out.println("LINK SITES TO GROUPS:" + siteToResidueMap.keySet().size()); //link the map of siteIds : <ResidueNumber> with the sites by using ResidueNumber to get the correct group back. //the return list if ( siteMap == null || siteToResidueMap == null){ logger....
java
private void linkSitesToGroups() { //System.out.println("LINK SITES TO GROUPS:" + siteToResidueMap.keySet().size()); //link the map of siteIds : <ResidueNumber> with the sites by using ResidueNumber to get the correct group back. //the return list if ( siteMap == null || siteToResidueMap == null){ logger....
[ "private", "void", "linkSitesToGroups", "(", ")", "{", "//System.out.println(\"LINK SITES TO GROUPS:\" + siteToResidueMap.keySet().size());", "//link the map of siteIds : <ResidueNumber> with the sites by using ResidueNumber to get the correct group back.", "//the return list", "if", "(", "sit...
Links the Sites in the siteMap to the Groups in the Structure via the siteToResidueMap ResidueNumber. @author Jules Jacobsen @return
[ "Links", "the", "Sites", "in", "the", "siteMap", "to", "the", "Groups", "in", "the", "Structure", "via", "the", "siteToResidueMap", "ResidueNumber", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L3239-L3306
31,871
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/transcription/TranscriptionEngine.java
TranscriptionEngine.translate
public Sequence<AminoAcidCompound> translate( Sequence<NucleotideCompound> dna) { Map<Frame, Sequence<AminoAcidCompound>> trans = multipleFrameTranslation( dna, Frame.ONE); return trans.get(Frame.ONE); }
java
public Sequence<AminoAcidCompound> translate( Sequence<NucleotideCompound> dna) { Map<Frame, Sequence<AminoAcidCompound>> trans = multipleFrameTranslation( dna, Frame.ONE); return trans.get(Frame.ONE); }
[ "public", "Sequence", "<", "AminoAcidCompound", ">", "translate", "(", "Sequence", "<", "NucleotideCompound", ">", "dna", ")", "{", "Map", "<", "Frame", ",", "Sequence", "<", "AminoAcidCompound", ">", ">", "trans", "=", "multipleFrameTranslation", "(", "dna", ...
Quick method to let you go from a CDS to a Peptide quickly. It assumes you are translating only in the first frame @param dna The CDS to translate @return The Protein Sequence
[ "Quick", "method", "to", "let", "you", "go", "from", "a", "CDS", "to", "a", "Peptide", "quickly", ".", "It", "assumes", "you", "are", "translating", "only", "in", "the", "first", "frame" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/transcription/TranscriptionEngine.java#L109-L114
31,872
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/transcription/TranscriptionEngine.java
TranscriptionEngine.multipleFrameTranslation
public Map<Frame, Sequence<AminoAcidCompound>> multipleFrameTranslation( Sequence<NucleotideCompound> dna, Frame... frames) { Map<Frame, Sequence<AminoAcidCompound>> results = new EnumMap<Frame, Sequence<AminoAcidCompound>>( Frame.class); for (Frame frame : frames) { Sequence<NucleotideCompound> rna = get...
java
public Map<Frame, Sequence<AminoAcidCompound>> multipleFrameTranslation( Sequence<NucleotideCompound> dna, Frame... frames) { Map<Frame, Sequence<AminoAcidCompound>> results = new EnumMap<Frame, Sequence<AminoAcidCompound>>( Frame.class); for (Frame frame : frames) { Sequence<NucleotideCompound> rna = get...
[ "public", "Map", "<", "Frame", ",", "Sequence", "<", "AminoAcidCompound", ">", ">", "multipleFrameTranslation", "(", "Sequence", "<", "NucleotideCompound", ">", "dna", ",", "Frame", "...", "frames", ")", "{", "Map", "<", "Frame", ",", "Sequence", "<", "Amino...
A way of translating DNA in a number of frames @param dna The CDS to translate @param frames The Frames to translate in @return All generated protein sequences in the given frames. Can have null entries
[ "A", "way", "of", "translating", "DNA", "in", "a", "number", "of", "frames" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/transcription/TranscriptionEngine.java#L126-L138
31,873
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java
SubunitCluster.isIdenticalTo
public boolean isIdenticalTo(SubunitCluster other) { String thisSequence = this.subunits.get(this.representative) .getProteinSequenceString(); String otherSequence = other.subunits.get(other.representative) .getProteinSequenceString(); return thisSequence.equals(otherSequence); }
java
public boolean isIdenticalTo(SubunitCluster other) { String thisSequence = this.subunits.get(this.representative) .getProteinSequenceString(); String otherSequence = other.subunits.get(other.representative) .getProteinSequenceString(); return thisSequence.equals(otherSequence); }
[ "public", "boolean", "isIdenticalTo", "(", "SubunitCluster", "other", ")", "{", "String", "thisSequence", "=", "this", ".", "subunits", ".", "get", "(", "this", ".", "representative", ")", ".", "getProteinSequenceString", "(", ")", ";", "String", "otherSequence"...
Tells whether the other SubunitCluster contains exactly the same Subunit. This is checked by String equality of their residue one-letter sequences. @param other SubunitCluster @return true if the SubunitClusters are identical, false otherwise
[ "Tells", "whether", "the", "other", "SubunitCluster", "contains", "exactly", "the", "same", "Subunit", ".", "This", "is", "checked", "by", "String", "equality", "of", "their", "residue", "one", "-", "letter", "sequences", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java#L174-L180
31,874
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/GUIAlignmentProgressListener.java
GUIAlignmentProgressListener.actionPerformed
@Override public void actionPerformed(ActionEvent evt) { //System.out.println("stopping!"); logStatus("terminating"); logStatus(" Total alignments processed: " + alignmentsProcessed); stopButton.setEnabled(false); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); progressBar.setIndeterminate(true...
java
@Override public void actionPerformed(ActionEvent evt) { //System.out.println("stopping!"); logStatus("terminating"); logStatus(" Total alignments processed: " + alignmentsProcessed); stopButton.setEnabled(false); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); progressBar.setIndeterminate(true...
[ "@", "Override", "public", "void", "actionPerformed", "(", "ActionEvent", "evt", ")", "{", "//System.out.println(\"stopping!\");", "logStatus", "(", "\"terminating\"", ")", ";", "logStatus", "(", "\" Total alignments processed: \"", "+", "alignmentsProcessed", ")", ";", ...
Invoked when the user presses the stop button.
[ "Invoked", "when", "the", "user", "presses", "the", "stop", "button", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/GUIAlignmentProgressListener.java#L96-L113
31,875
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java
OptimalCECPMain.permuteArray
private static <T> void permuteArray(T[] arr, int cp) { // Allow negative cp points for convenience. if(cp == 0) { return; } if(cp < 0) { cp = arr.length+cp; } if(cp < 0 || cp >= arr.length) { throw new ArrayIndexOutOfBoundsException( "Permutation point ("+cp+") must be between -ca2.length and...
java
private static <T> void permuteArray(T[] arr, int cp) { // Allow negative cp points for convenience. if(cp == 0) { return; } if(cp < 0) { cp = arr.length+cp; } if(cp < 0 || cp >= arr.length) { throw new ArrayIndexOutOfBoundsException( "Permutation point ("+cp+") must be between -ca2.length and...
[ "private", "static", "<", "T", ">", "void", "permuteArray", "(", "T", "[", "]", "arr", ",", "int", "cp", ")", "{", "// Allow negative cp points for convenience.", "if", "(", "cp", "==", "0", ")", "{", "return", ";", "}", "if", "(", "cp", "<", "0", ")...
Circularly permutes arr in place. <p>Similar to {@link Collections#rotate(List, int)} but with reversed direction. Perhaps it would be more efficient to use the Collections version? @param <T> @param arr The array to be permuted @param cp The number of residues to shift leftward, or equivalently, the index of the firs...
[ "Circularly", "permutes", "arr", "in", "place", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java#L116-L141
31,876
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java
OptimalCECPMain.permuteAFPChain
private static void permuteAFPChain(AFPChain afpChain, int cp) { int ca2len = afpChain.getCa2Length(); //fix up cp to be positive if(cp == 0) { return; } if(cp < 0) { cp = ca2len+cp; } if(cp < 0 || cp >= ca2len) { throw new ArrayIndexOutOfBoundsException( "Permutation point ("+cp+") must b...
java
private static void permuteAFPChain(AFPChain afpChain, int cp) { int ca2len = afpChain.getCa2Length(); //fix up cp to be positive if(cp == 0) { return; } if(cp < 0) { cp = ca2len+cp; } if(cp < 0 || cp >= ca2len) { throw new ArrayIndexOutOfBoundsException( "Permutation point ("+cp+") must b...
[ "private", "static", "void", "permuteAFPChain", "(", "AFPChain", "afpChain", ",", "int", "cp", ")", "{", "int", "ca2len", "=", "afpChain", ".", "getCa2Length", "(", ")", ";", "//fix up cp to be positive", "if", "(", "cp", "==", "0", ")", "{", "return", ";"...
Permute the second protein of afpChain by the specified number of residues. @param afpChain Input alignment @param cp Amount leftwards (or rightward, if negative) to shift the @return A new alignment equivalent to afpChain after the permutations
[ "Permute", "the", "second", "protein", "of", "afpChain", "by", "the", "specified", "number", "of", "residues", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java#L217-L246
31,877
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java
MultipleAlignmentCoordManager.getSeqPos
public int getSeqPos(int aligSeq, Point p) { int x = p.x - DEFAULT_X_SPACE - DEFAULT_LEGEND_SIZE; int y = p.y - DEFAULT_Y_SPACE ; y -= (DEFAULT_LINE_SEPARATION * aligSeq) - DEFAULT_CHAR_SIZE; int lineNr = y / DEFAULT_Y_STEP; int linePos = x / DEFAULT_CHAR_SIZE; return lineNr * DEFAULT_LINE_LENGTH + line...
java
public int getSeqPos(int aligSeq, Point p) { int x = p.x - DEFAULT_X_SPACE - DEFAULT_LEGEND_SIZE; int y = p.y - DEFAULT_Y_SPACE ; y -= (DEFAULT_LINE_SEPARATION * aligSeq) - DEFAULT_CHAR_SIZE; int lineNr = y / DEFAULT_Y_STEP; int linePos = x / DEFAULT_CHAR_SIZE; return lineNr * DEFAULT_LINE_LENGTH + line...
[ "public", "int", "getSeqPos", "(", "int", "aligSeq", ",", "Point", "p", ")", "{", "int", "x", "=", "p", ".", "x", "-", "DEFAULT_X_SPACE", "-", "DEFAULT_LEGEND_SIZE", ";", "int", "y", "=", "p", ".", "y", "-", "DEFAULT_Y_SPACE", ";", "y", "-=", "(", ...
Convert from an X position in the JPanel to the position in the sequence alignment. @param aligSeq sequence number @param p point on panel @return the sequence position for a point on the Panel
[ "Convert", "from", "an", "X", "position", "in", "the", "JPanel", "to", "the", "position", "in", "the", "sequence", "alignment", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java#L125-L136
31,878
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java
MultipleAlignmentCoordManager.getPanelPos
public Point getPanelPos(int structure, int pos) { Point p = new Point(); int lineNr = pos / DEFAULT_LINE_LENGTH; int linePos = pos % DEFAULT_LINE_LENGTH; int x = linePos * DEFAULT_CHAR_SIZE + DEFAULT_X_SPACE + DEFAULT_LEGEND_SIZE; int y = lineNr * DEFAULT_Y_STEP + DEFAULT_Y_SPACE; y += DEFAULT_LINE_...
java
public Point getPanelPos(int structure, int pos) { Point p = new Point(); int lineNr = pos / DEFAULT_LINE_LENGTH; int linePos = pos % DEFAULT_LINE_LENGTH; int x = linePos * DEFAULT_CHAR_SIZE + DEFAULT_X_SPACE + DEFAULT_LEGEND_SIZE; int y = lineNr * DEFAULT_Y_STEP + DEFAULT_Y_SPACE; y += DEFAULT_LINE_...
[ "public", "Point", "getPanelPos", "(", "int", "structure", ",", "int", "pos", ")", "{", "Point", "p", "=", "new", "Point", "(", ")", ";", "int", "lineNr", "=", "pos", "/", "DEFAULT_LINE_LENGTH", ";", "int", "linePos", "=", "pos", "%", "DEFAULT_LINE_LENGT...
Get the X position on the Panel of a particular sequence position. @param structure index of the structure for the sequence position. @param pos sequence position, the aligned position index @return the point on a panel for a sequence position
[ "Get", "the", "X", "position", "on", "the", "Panel", "of", "a", "particular", "sequence", "position", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java#L145-L159
31,879
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java
MultipleAlignmentCoordManager.getAligSeq
public int getAligSeq(Point point) { for (int pos=0; pos<alignmentSize; pos++){ int i = getSeqPos(pos, point); Point t = getPanelPos(pos,i); if ( Math.abs(t.x - point.x) <= DEFAULT_CHAR_SIZE && Math.abs(t.y-point.y) < DEFAULT_CHAR_SIZE ) return pos; } return -1; }
java
public int getAligSeq(Point point) { for (int pos=0; pos<alignmentSize; pos++){ int i = getSeqPos(pos, point); Point t = getPanelPos(pos,i); if ( Math.abs(t.x - point.x) <= DEFAULT_CHAR_SIZE && Math.abs(t.y-point.y) < DEFAULT_CHAR_SIZE ) return pos; } return -1; }
[ "public", "int", "getAligSeq", "(", "Point", "point", ")", "{", "for", "(", "int", "pos", "=", "0", ";", "pos", "<", "alignmentSize", ";", "pos", "++", ")", "{", "int", "i", "=", "getSeqPos", "(", "pos", ",", "point", ")", ";", "Point", "t", "=",...
Returns the index of the structure, for a given point in the Panel. Returns -1 if not over a position in the sequence alignment. @param point x and y coordinates in the panel @return which structure a point on the panel corresponds to
[ "Returns", "the", "index", "of", "the", "structure", "for", "a", "given", "point", "in", "the", "Panel", ".", "Returns", "-", "1", "if", "not", "over", "a", "position", "in", "the", "sequence", "alignment", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/aligpanel/MultipleAlignmentCoordManager.java#L167-L177
31,880
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/DBRef.java
DBRef.toPDB
@Override public String toPDB(){ StringBuffer buf = new StringBuffer(); toPDB(buf); return buf.toString(); }
java
@Override public String toPDB(){ StringBuffer buf = new StringBuffer(); toPDB(buf); return buf.toString(); }
[ "@", "Override", "public", "String", "toPDB", "(", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "toPDB", "(", "buf", ")", ";", "return", "buf", ".", "toString", "(", ")", ";", "}" ]
Convert the DBRef object to a DBREF record as it is used in PDB files @return a PDB - DBREF formatted line
[ "Convert", "the", "DBRef", "object", "to", "a", "DBREF", "record", "as", "it", "is", "used", "in", "PDB", "files" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/DBRef.java#L113-L120
31,881
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/DBRef.java
DBRef.toPDB
@Override public void toPDB(StringBuffer buf){ Formatter formatter = new Formatter(new StringBuilder(),Locale.UK); // DBREF 3ETA A 990 1295 UNP P06213 INSR_HUMAN 1017 1322 // DBREF 3EH2 A 2 767 UNP P53992 SC24C_HUMAN 329 1094 // DBREF 3EH2 A 2 767 UNP P...
java
@Override public void toPDB(StringBuffer buf){ Formatter formatter = new Formatter(new StringBuilder(),Locale.UK); // DBREF 3ETA A 990 1295 UNP P06213 INSR_HUMAN 1017 1322 // DBREF 3EH2 A 2 767 UNP P53992 SC24C_HUMAN 329 1094 // DBREF 3EH2 A 2 767 UNP P...
[ "@", "Override", "public", "void", "toPDB", "(", "StringBuffer", "buf", ")", "{", "Formatter", "formatter", "=", "new", "Formatter", "(", "new", "StringBuilder", "(", ")", ",", "Locale", ".", "UK", ")", ";", "// DBREF 3ETA A 990 1295 UNP P06213 INS...
Append the PDB representation of this DBRef to the provided StringBuffer @param buf the StringBuffer to write to.
[ "Append", "the", "PDB", "representation", "of", "this", "DBRef", "to", "the", "provided", "StringBuffer" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/DBRef.java#L126-L142
31,882
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java
DisplayAFP.getPDBresnum
public static final List<String> getPDBresnum(int aligPos, AFPChain afpChain, Atom[] ca){ List<String> lst = new ArrayList<String>(); if ( aligPos > 1) { System.err.println("multiple alignments not supported yet!"); return lst; } int blockNum = afpChain.getBlockNum(); int[] optLen = afpChain.getOptLen(...
java
public static final List<String> getPDBresnum(int aligPos, AFPChain afpChain, Atom[] ca){ List<String> lst = new ArrayList<String>(); if ( aligPos > 1) { System.err.println("multiple alignments not supported yet!"); return lst; } int blockNum = afpChain.getBlockNum(); int[] optLen = afpChain.getOptLen(...
[ "public", "static", "final", "List", "<", "String", ">", "getPDBresnum", "(", "int", "aligPos", ",", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca", ")", "{", "List", "<", "String", ">", "lst", "=", "new", "ArrayList", "<", "String", ">", "(", "...
Return a list of pdb Strings corresponding to the aligned positions of the molecule. Only supports a pairwise alignment with the AFPChain DS. @param aligPos @param afpChain @param ca
[ "Return", "a", "list", "of", "pdb", "Strings", "corresponding", "to", "the", "aligned", "positions", "of", "the", "molecule", ".", "Only", "supports", "a", "pairwise", "alignment", "with", "the", "AFPChain", "DS", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java#L109-L137
31,883
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java
DisplayAFP.getAtomForAligPos
public static final Atom getAtomForAligPos(AFPChain afpChain,int chainNr, int aligPos, Atom[] ca , boolean getPrevious ) throws StructureException{ int[] optLen = afpChain.getOptLen(); // int[][][] optAln = afpChain.getOptAln(); if ( optLen == null) return null; if (chainNr < 0 || chainNr > 1){ throw ne...
java
public static final Atom getAtomForAligPos(AFPChain afpChain,int chainNr, int aligPos, Atom[] ca , boolean getPrevious ) throws StructureException{ int[] optLen = afpChain.getOptLen(); // int[][][] optAln = afpChain.getOptAln(); if ( optLen == null) return null; if (chainNr < 0 || chainNr > 1){ throw ne...
[ "public", "static", "final", "Atom", "getAtomForAligPos", "(", "AFPChain", "afpChain", ",", "int", "chainNr", ",", "int", "aligPos", ",", "Atom", "[", "]", "ca", ",", "boolean", "getPrevious", ")", "throws", "StructureException", "{", "int", "[", "]", "optLe...
Return the atom at alignment position aligPos. at the present only works with block 0 @param chainNr the number of the aligned pair. 0... first chain, 1... second chain. @param afpChain an afpChain object @param aligPos position on the alignment @param getPrevious gives the previous position if false, gives the next po...
[ "Return", "the", "atom", "at", "alignment", "position", "aligPos", ".", "at", "the", "present", "only", "works", "with", "block", "0" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java#L148-L195
31,884
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java
DisplayAFP.getAtomArray
public static final Atom[] getAtomArray(Atom[] ca,List<Group> hetatms ) throws StructureException{ List<Atom> atoms = new ArrayList<Atom>(); Collections.addAll(atoms, ca); logger.debug("got {} hetatoms", hetatms.size()); // we only add atom nr 1, since the getAlignedStructure method actually adds the parent g...
java
public static final Atom[] getAtomArray(Atom[] ca,List<Group> hetatms ) throws StructureException{ List<Atom> atoms = new ArrayList<Atom>(); Collections.addAll(atoms, ca); logger.debug("got {} hetatoms", hetatms.size()); // we only add atom nr 1, since the getAlignedStructure method actually adds the parent g...
[ "public", "static", "final", "Atom", "[", "]", "getAtomArray", "(", "Atom", "[", "]", "ca", ",", "List", "<", "Group", ">", "hetatms", ")", "throws", "StructureException", "{", "List", "<", "Atom", ">", "atoms", "=", "new", "ArrayList", "<", "Atom", ">...
Returns the first atom for each group @param ca @param hetatms @return @throws StructureException
[ "Returns", "the", "first", "atom", "for", "each", "group" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java#L409-L431
31,885
biojava/biojava
biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java
DisplayAFP.createArtificalStructure
public static Structure createArtificalStructure(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException{ if ( afpChain.getNrEQR() < 1){ return AlignmentTools.getAlignedStructure(ca1, ca2); } Group[] twistedGroups = AlignmentTools.prepareGroupsForDisplay(afpChain,ca1, ca2); List<Atom> twi...
java
public static Structure createArtificalStructure(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException{ if ( afpChain.getNrEQR() < 1){ return AlignmentTools.getAlignedStructure(ca1, ca2); } Group[] twistedGroups = AlignmentTools.prepareGroupsForDisplay(afpChain,ca1, ca2); List<Atom> twi...
[ "public", "static", "Structure", "createArtificalStructure", "(", "AFPChain", "afpChain", ",", "Atom", "[", "]", "ca1", ",", "Atom", "[", "]", "ca2", ")", "throws", "StructureException", "{", "if", "(", "afpChain", ".", "getNrEQR", "(", ")", "<", "1", ")",...
Create a "fake" Structure objects that contains the two sets of atoms aligned on top of each other. @param afpChain the container of the alignment @param ca1 atoms for protein 1 @param ca2 atoms for protein 2 @return a protein structure with 2 models. @throws StructureException
[ "Create", "a", "fake", "Structure", "objects", "that", "contains", "the", "two", "sets", "of", "atoms", "aligned", "on", "top", "of", "each", "other", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/DisplayAFP.java#L553-L583
31,886
biojava/biojava
biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/HmmerResult.java
HmmerResult.getOverlapLength
public int getOverlapLength(HmmerResult other){ int overlap = 0; for ( HmmerDomain d1 : getDomains()){ for (HmmerDomain d2 : other.getDomains()){ overlap += getOverlap(d1, d2); } } return overlap; }
java
public int getOverlapLength(HmmerResult other){ int overlap = 0; for ( HmmerDomain d1 : getDomains()){ for (HmmerDomain d2 : other.getDomains()){ overlap += getOverlap(d1, d2); } } return overlap; }
[ "public", "int", "getOverlapLength", "(", "HmmerResult", "other", ")", "{", "int", "overlap", "=", "0", ";", "for", "(", "HmmerDomain", "d1", ":", "getDomains", "(", ")", ")", "{", "for", "(", "HmmerDomain", "d2", ":", "other", ".", "getDomains", "(", ...
Get the overlap between two HmmerResult objects @param other @return 0 if no overlap, otherwise the length of the overlap
[ "Get", "the", "overlap", "between", "two", "HmmerResult", "objects" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/HmmerResult.java#L154-L164
31,887
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java
DownloadChemCompProvider.getPath
public static File getPath(){ if (path==null) { UserConfiguration config = new UserConfiguration(); path = new File(config.getCacheFilePath()); } return path; }
java
public static File getPath(){ if (path==null) { UserConfiguration config = new UserConfiguration(); path = new File(config.getCacheFilePath()); } return path; }
[ "public", "static", "File", "getPath", "(", ")", "{", "if", "(", "path", "==", "null", ")", "{", "UserConfiguration", "config", "=", "new", "UserConfiguration", "(", ")", ";", "path", "=", "new", "File", "(", "config", ".", "getCacheFilePath", "(", ")", ...
Get this provider's cache path @return
[ "Get", "this", "provider", "s", "cache", "path" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java#L122-L128
31,888
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java
DownloadChemCompProvider.checkDoFirstInstall
public void checkDoFirstInstall(){ if ( ! downloadAll ) { return; } // this makes sure there is a file separator between every component, // if path has a trailing file separator or not, it will work for both cases File dir = new File(getPath(), CHEM_COMP_CACHE_DIRECTORY); File f = new File(dir, "comp...
java
public void checkDoFirstInstall(){ if ( ! downloadAll ) { return; } // this makes sure there is a file separator between every component, // if path has a trailing file separator or not, it will work for both cases File dir = new File(getPath(), CHEM_COMP_CACHE_DIRECTORY); File f = new File(dir, "comp...
[ "public", "void", "checkDoFirstInstall", "(", ")", "{", "if", "(", "!", "downloadAll", ")", "{", "return", ";", "}", "// this makes sure there is a file separator between every component,", "// if path has a trailing file separator or not, it will work for both cases", "File", "d...
Checks if the chemical components already have been installed into the PDB directory. If not, will download the chemical components definitions file and split it up into small subfiles.
[ "Checks", "if", "the", "chemical", "components", "already", "have", "been", "installed", "into", "the", "PDB", "directory", ".", "If", "not", "will", "download", "the", "chemical", "components", "definitions", "file", "and", "split", "it", "up", "into", "small...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java#L135-L172
31,889
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java
DownloadChemCompProvider.writeID
private void writeID(String contents, String currentID) throws IOException{ String localName = getLocalFileName(currentID); try ( PrintWriter pw = new PrintWriter(new GZIPOutputStream(new FileOutputStream(localName))) ) { pw.print(contents); pw.flush(); } }
java
private void writeID(String contents, String currentID) throws IOException{ String localName = getLocalFileName(currentID); try ( PrintWriter pw = new PrintWriter(new GZIPOutputStream(new FileOutputStream(localName))) ) { pw.print(contents); pw.flush(); } }
[ "private", "void", "writeID", "(", "String", "contents", ",", "String", "currentID", ")", "throws", "IOException", "{", "String", "localName", "=", "getLocalFileName", "(", "currentID", ")", ";", "try", "(", "PrintWriter", "pw", "=", "new", "PrintWriter", "(",...
Output chemical contents to a file @param contents File contents @param currentID Chemical ID, used to determine the filename @throws IOException
[ "Output", "chemical", "contents", "to", "a", "file" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java#L227-L236
31,890
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java
CrystalTransform.isEquivalent
public boolean isEquivalent(CrystalTransform other) { Matrix4d mul = new Matrix4d(); mul.mul(this.matTransform,other.matTransform); if (mul.epsilonEquals(IDENTITY, 0.0001)) { return true; } return false; }
java
public boolean isEquivalent(CrystalTransform other) { Matrix4d mul = new Matrix4d(); mul.mul(this.matTransform,other.matTransform); if (mul.epsilonEquals(IDENTITY, 0.0001)) { return true; } return false; }
[ "public", "boolean", "isEquivalent", "(", "CrystalTransform", "other", ")", "{", "Matrix4d", "mul", "=", "new", "Matrix4d", "(", ")", ";", "mul", ".", "mul", "(", "this", ".", "matTransform", ",", "other", ".", "matTransform", ")", ";", "if", "(", "mul",...
Returns true if the given CrystalTransform is equivalent to this one. Two crystal transforms are equivalent if one is the inverse of the other, i.e. their transformation matrices multiplication is equal to the identity. @param other @return
[ "Returns", "true", "if", "the", "given", "CrystalTransform", "is", "equivalent", "to", "this", "one", ".", "Two", "crystal", "transforms", "are", "equivalent", "if", "one", "is", "the", "inverse", "of", "the", "other", "i", ".", "e", ".", "their", "transfo...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java#L146-L154
31,891
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java
CrystalTransform.toXYZString
public String toXYZString() { StringBuilder str = new StringBuilder(); for(int i=0;i<3;i++) { //for each row boolean emptyRow = true; double coef; // TODO work with rational numbers // X coef = matTransform.getElement(i, 0); // Three cases for coef: zero, one, non-one if(abs(coef) > 1e-6 ) { ...
java
public String toXYZString() { StringBuilder str = new StringBuilder(); for(int i=0;i<3;i++) { //for each row boolean emptyRow = true; double coef; // TODO work with rational numbers // X coef = matTransform.getElement(i, 0); // Three cases for coef: zero, one, non-one if(abs(coef) > 1e-6 ) { ...
[ "public", "String", "toXYZString", "(", ")", "{", "StringBuilder", "str", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "3", ";", "i", "++", ")", "{", "//for each row", "boolean", "emptyRow", "=", "true"...
Expresses this transformation in terms of x,y,z fractional coordinates. Examples: @return
[ "Expresses", "this", "transformation", "in", "terms", "of", "x", "y", "z", "fractional", "coordinates", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java#L340-L425
31,892
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java
CrystalTransform.formatCoef
private String formatCoef(double coef) { double tol = 1e-6; // rounding tolerance // zero case if( Math.abs(coef) < tol) { return "0"; } // integer case long num = Math.round(coef); if( Math.abs(num - coef) < tol) { return Long.toString(num); } // Other small cases for(int denom = 2; denom ...
java
private String formatCoef(double coef) { double tol = 1e-6; // rounding tolerance // zero case if( Math.abs(coef) < tol) { return "0"; } // integer case long num = Math.round(coef); if( Math.abs(num - coef) < tol) { return Long.toString(num); } // Other small cases for(int denom = 2; denom ...
[ "private", "String", "formatCoef", "(", "double", "coef", ")", "{", "double", "tol", "=", "1e-6", ";", "// rounding tolerance", "// zero case", "if", "(", "Math", ".", "abs", "(", "coef", ")", "<", "tol", ")", "{", "return", "\"0\"", ";", "}", "// intege...
helper function to format simple fractions into rationals @param coef @return
[ "helper", "function", "to", "format", "simple", "fractions", "into", "rationals" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalTransform.java#L431-L455
31,893
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java
RotationAxisAligner.getGeometicCenterTransformation
@Override public Matrix4d getGeometicCenterTransformation() { run(); Matrix4d geometricCentered = new Matrix4d(reverseTransformationMatrix); geometricCentered.setTranslation(new Vector3d(getGeometricCenter())); return geometricCentered; }
java
@Override public Matrix4d getGeometicCenterTransformation() { run(); Matrix4d geometricCentered = new Matrix4d(reverseTransformationMatrix); geometricCentered.setTranslation(new Vector3d(getGeometricCenter())); return geometricCentered; }
[ "@", "Override", "public", "Matrix4d", "getGeometicCenterTransformation", "(", ")", "{", "run", "(", ")", ";", "Matrix4d", "geometricCentered", "=", "new", "Matrix4d", "(", "reverseTransformationMatrix", ")", ";", "geometricCentered", ".", "setTranslation", "(", "ne...
Returns a transformation matrix transform polyhedra for Cn structures. The center in this matrix is the geometric center, rather then the centroid. In Cn structures those are usually not the same. @return
[ "Returns", "a", "transformation", "matrix", "transform", "polyhedra", "for", "Cn", "structures", ".", "The", "center", "in", "this", "matrix", "is", "the", "geometric", "center", "rather", "then", "the", "centroid", ".", "In", "Cn", "structures", "those", "are...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java#L148-L156
31,894
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java
RotationAxisAligner.getGeometricCenter
@Override public Point3d getGeometricCenter() { run(); Point3d geometricCenter = new Point3d(); Vector3d translation = new Vector3d(); reverseTransformationMatrix.get(translation); // calculate adjustment around z-axis and transform adjustment to // original coordinate frame with the reverse transformat...
java
@Override public Point3d getGeometricCenter() { run(); Point3d geometricCenter = new Point3d(); Vector3d translation = new Vector3d(); reverseTransformationMatrix.get(translation); // calculate adjustment around z-axis and transform adjustment to // original coordinate frame with the reverse transformat...
[ "@", "Override", "public", "Point3d", "getGeometricCenter", "(", ")", "{", "run", "(", ")", ";", "Point3d", "geometricCenter", "=", "new", "Point3d", "(", ")", ";", "Vector3d", "translation", "=", "new", "Vector3d", "(", ")", ";", "reverseTransformationMatrix"...
Returns the geometric center of polyhedron. In the case of the Cn point group, the centroid and geometric center are usually not identical. @return
[ "Returns", "the", "geometric", "center", "of", "polyhedron", ".", "In", "the", "case", "of", "the", "Cn", "point", "group", "the", "centroid", "and", "geometric", "center", "are", "usually", "not", "identical", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java#L164-L182
31,895
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java
RotationAxisAligner.alignAxes
private Matrix4d alignAxes(Vector3d[] axisVectors, Vector3d[] referenceVectors) { Matrix4d m1 = new Matrix4d(); AxisAngle4d a = new AxisAngle4d(); Vector3d axis = new Vector3d(); // calculate rotation matrix to rotate refPoints[0] into coordPoints[0] Vector3d v1 = new Vector3d(axisVectors[0]); Vector3d v2 ...
java
private Matrix4d alignAxes(Vector3d[] axisVectors, Vector3d[] referenceVectors) { Matrix4d m1 = new Matrix4d(); AxisAngle4d a = new AxisAngle4d(); Vector3d axis = new Vector3d(); // calculate rotation matrix to rotate refPoints[0] into coordPoints[0] Vector3d v1 = new Vector3d(axisVectors[0]); Vector3d v2 ...
[ "private", "Matrix4d", "alignAxes", "(", "Vector3d", "[", "]", "axisVectors", ",", "Vector3d", "[", "]", "referenceVectors", ")", "{", "Matrix4d", "m1", "=", "new", "Matrix4d", "(", ")", ";", "AxisAngle4d", "a", "=", "new", "AxisAngle4d", "(", ")", ";", ...
Returns a transformation matrix that rotates refPoints to match coordPoints @param refPoints the points to be aligned @param referenceVectors @return
[ "Returns", "a", "transformation", "matrix", "that", "rotates", "refPoints", "to", "match", "coordPoints" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java#L410-L478
31,896
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java
RotationAxisAligner.refineReferenceVector
private void refineReferenceVector() { referenceVector = new Vector3d(Y_AXIS); if (rotationGroup.getPointGroup().startsWith("C")) { referenceVector = getReferenceAxisCylicWithSubunitAlignment(); } else if (rotationGroup.getPointGroup().startsWith("D")) { referenceVector = getReferenceAxisDihedralWithSubunit...
java
private void refineReferenceVector() { referenceVector = new Vector3d(Y_AXIS); if (rotationGroup.getPointGroup().startsWith("C")) { referenceVector = getReferenceAxisCylicWithSubunitAlignment(); } else if (rotationGroup.getPointGroup().startsWith("D")) { referenceVector = getReferenceAxisDihedralWithSubunit...
[ "private", "void", "refineReferenceVector", "(", ")", "{", "referenceVector", "=", "new", "Vector3d", "(", "Y_AXIS", ")", ";", "if", "(", "rotationGroup", ".", "getPointGroup", "(", ")", ".", "startsWith", "(", "\"C\"", ")", ")", "{", "referenceVector", "=",...
Returns a normalized vector that represents a minor rotation axis, except for Cn, this represents an axis orthogonal to the principal axis. @return minor rotation axis
[ "Returns", "a", "normalized", "vector", "that", "represents", "a", "minor", "rotation", "axis", "except", "for", "Cn", "this", "represents", "an", "axis", "orthogonal", "to", "the", "principal", "axis", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java#L702-L711
31,897
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java
RotationAxisAligner.getReferenceAxisCylicWithSubunitAlignment
private Vector3d getReferenceAxisCylicWithSubunitAlignment() { if (rotationGroup.getPointGroup().equals("C2")) { return referenceVector; } // find subunit that extends the most in the xy-plane List<List<Integer>> orbits = getOrbitsByXYWidth(); // get the last orbit which is the widest List<Integer> wide...
java
private Vector3d getReferenceAxisCylicWithSubunitAlignment() { if (rotationGroup.getPointGroup().equals("C2")) { return referenceVector; } // find subunit that extends the most in the xy-plane List<List<Integer>> orbits = getOrbitsByXYWidth(); // get the last orbit which is the widest List<Integer> wide...
[ "private", "Vector3d", "getReferenceAxisCylicWithSubunitAlignment", "(", ")", "{", "if", "(", "rotationGroup", ".", "getPointGroup", "(", ")", ".", "equals", "(", "\"C2\"", ")", ")", "{", "return", "referenceVector", ";", "}", "// find subunit that extends the most in...
Returns a reference vector for the alignment of Cn structures. @return reference vector
[ "Returns", "a", "reference", "vector", "for", "the", "alignment", "of", "Cn", "structures", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java#L767-L784
31,898
biojava/biojava
biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java
NCBIQBlastService.init
private void init(String svcUrl) { try { serviceUrl = new URL(svcUrl); } catch (MalformedURLException e) { throw new RuntimeException("It looks like the URL for remote NCBI BLAST service (" + svcUrl + ") is wrong. Cause: " + e.getMessage(), e); } }
java
private void init(String svcUrl) { try { serviceUrl = new URL(svcUrl); } catch (MalformedURLException e) { throw new RuntimeException("It looks like the URL for remote NCBI BLAST service (" + svcUrl + ") is wrong. Cause: " + e.getMessage(), e); } }
[ "private", "void", "init", "(", "String", "svcUrl", ")", "{", "try", "{", "serviceUrl", "=", "new", "URL", "(", "svcUrl", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "\"It looks like the URL f...
Initialize the serviceUrl data member @throws MalformedURLException on invalid URL
[ "Initialize", "the", "serviceUrl", "data", "member" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java#L99-L106
31,899
biojava/biojava
biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java
NCBIQBlastService.setQBlastServiceProperties
private URLConnection setQBlastServiceProperties(URLConnection conn) { conn.setDoOutput(true); conn.setUseCaches(false); conn.setRequestProperty("User-Agent", "Biojava/NCBIQBlastService"); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Content-type", "application/x-www-form-urle...
java
private URLConnection setQBlastServiceProperties(URLConnection conn) { conn.setDoOutput(true); conn.setUseCaches(false); conn.setRequestProperty("User-Agent", "Biojava/NCBIQBlastService"); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Content-type", "application/x-www-form-urle...
[ "private", "URLConnection", "setQBlastServiceProperties", "(", "URLConnection", "conn", ")", "{", "conn", ".", "setDoOutput", "(", "true", ")", ";", "conn", ".", "setUseCaches", "(", "false", ")", ";", "conn", ".", "setRequestProperty", "(", "\"User-Agent\"", ",...
Sets properties for given URLConnection @param conn URLConnection to set properties for @return given object after setting properties
[ "Sets", "properties", "for", "given", "URLConnection" ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java#L377-L385