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,700 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java | SequenceUtil.isAmbiguosProtein | public static boolean isAmbiguosProtein(String sequence) {
sequence = SequenceUtil.cleanSequence(sequence);
if (SequenceUtil.isNonAmbNucleotideSequence(sequence)) {
return false;
}
if (SequenceUtil.DIGIT.matcher(sequence).find()) {
return false;
}
if (SequenceUtil.NON_AA.matcher(sequence).find()) {
return f... | java | public static boolean isAmbiguosProtein(String sequence) {
sequence = SequenceUtil.cleanSequence(sequence);
if (SequenceUtil.isNonAmbNucleotideSequence(sequence)) {
return false;
}
if (SequenceUtil.DIGIT.matcher(sequence).find()) {
return false;
}
if (SequenceUtil.NON_AA.matcher(sequence).find()) {
return f... | [
"public",
"static",
"boolean",
"isAmbiguosProtein",
"(",
"String",
"sequence",
")",
"{",
"sequence",
"=",
"SequenceUtil",
".",
"cleanSequence",
"(",
"sequence",
")",
";",
"if",
"(",
"SequenceUtil",
".",
"isNonAmbNucleotideSequence",
"(",
"sequence",
")",
")",
"{... | Check whether the sequence confirms to amboguous protein sequence
@param sequence
@return return true only if the sequence if ambiguous protein sequence
Return false otherwise. e.g. if the sequence is non-ambiguous
protein or DNA | [
"Check",
"whether",
"the",
"sequence",
"confirms",
"to",
"amboguous",
"protein",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java#L201-L217 |
31,701 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java | SequenceUtil.writeFasta | public static void writeFasta(final OutputStream outstream,
final List<FastaSequence> sequences, final int width)
throws IOException {
final OutputStreamWriter writer = new OutputStreamWriter(outstream);
final BufferedWriter fastawriter = new BufferedWriter(writer);
for (final FastaSequence fs : sequences) {
f... | java | public static void writeFasta(final OutputStream outstream,
final List<FastaSequence> sequences, final int width)
throws IOException {
final OutputStreamWriter writer = new OutputStreamWriter(outstream);
final BufferedWriter fastawriter = new BufferedWriter(writer);
for (final FastaSequence fs : sequences) {
f... | [
"public",
"static",
"void",
"writeFasta",
"(",
"final",
"OutputStream",
"outstream",
",",
"final",
"List",
"<",
"FastaSequence",
">",
"sequences",
",",
"final",
"int",
"width",
")",
"throws",
"IOException",
"{",
"final",
"OutputStreamWriter",
"writer",
"=",
"new... | Writes list of FastaSequeces into the outstream formatting the sequence
so that it contains width chars on each line
@param outstream
@param sequences
@param width
- the maximum number of characters to write in one line
@throws IOException | [
"Writes",
"list",
"of",
"FastaSequeces",
"into",
"the",
"outstream",
"formatting",
"the",
"sequence",
"so",
"that",
"it",
"contains",
"width",
"chars",
"on",
"each",
"line"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java#L229-L240 |
31,702 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java | SequenceUtil.readFasta | public static List<FastaSequence> readFasta(final InputStream inStream)
throws IOException {
final List<FastaSequence> seqs = new ArrayList<FastaSequence>();
final BufferedReader infasta = new BufferedReader(
new InputStreamReader(inStream, "UTF8"), 16000);
final Pattern pattern = Pattern.compile("//s+");
Str... | java | public static List<FastaSequence> readFasta(final InputStream inStream)
throws IOException {
final List<FastaSequence> seqs = new ArrayList<FastaSequence>();
final BufferedReader infasta = new BufferedReader(
new InputStreamReader(inStream, "UTF8"), 16000);
final Pattern pattern = Pattern.compile("//s+");
Str... | [
"public",
"static",
"List",
"<",
"FastaSequence",
">",
"readFasta",
"(",
"final",
"InputStream",
"inStream",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"FastaSequence",
">",
"seqs",
"=",
"new",
"ArrayList",
"<",
"FastaSequence",
">",
"(",
")",
... | Reads fasta sequences from inStream into the list of FastaSequence
objects
@param inStream
from
@return list of FastaSequence objects
@throws IOException | [
"Reads",
"fasta",
"sequences",
"from",
"inStream",
"into",
"the",
"list",
"of",
"FastaSequence",
"objects"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java#L251-L277 |
31,703 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java | SequenceUtil.writeFasta | public static void writeFasta(final OutputStream os,
final List<FastaSequence> sequences) throws IOException {
final OutputStreamWriter outWriter = new OutputStreamWriter(os);
final BufferedWriter fasta_out = new BufferedWriter(outWriter);
for (final FastaSequence fs : sequences) {
fasta_out.write(fs.getOnelineF... | java | public static void writeFasta(final OutputStream os,
final List<FastaSequence> sequences) throws IOException {
final OutputStreamWriter outWriter = new OutputStreamWriter(os);
final BufferedWriter fasta_out = new BufferedWriter(outWriter);
for (final FastaSequence fs : sequences) {
fasta_out.write(fs.getOnelineF... | [
"public",
"static",
"void",
"writeFasta",
"(",
"final",
"OutputStream",
"os",
",",
"final",
"List",
"<",
"FastaSequence",
">",
"sequences",
")",
"throws",
"IOException",
"{",
"final",
"OutputStreamWriter",
"outWriter",
"=",
"new",
"OutputStreamWriter",
"(",
"os",
... | Writes FastaSequence in the file, each sequence will take one line only
@param os
@param sequences
@throws IOException | [
"Writes",
"FastaSequence",
"in",
"the",
"file",
"each",
"sequence",
"will",
"take",
"one",
"line",
"only"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java#L286-L295 |
31,704 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderParser.java | GenericGenbankHeaderParser.reset | @SuppressWarnings("unused")
private void reset() {
this.version = 0;
this.versionSeen = false;
this.accession = null;
this.description = null;
this.identifier = null;
this.name = null;
this.comments.clear();
} | java | @SuppressWarnings("unused")
private void reset() {
this.version = 0;
this.versionSeen = false;
this.accession = null;
this.description = null;
this.identifier = null;
this.name = null;
this.comments.clear();
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"void",
"reset",
"(",
")",
"{",
"this",
".",
"version",
"=",
"0",
";",
"this",
".",
"versionSeen",
"=",
"false",
";",
"this",
".",
"accession",
"=",
"null",
";",
"this",
".",
"description",
"=... | Sets the sequence info back to default values, ie. in order to start
constructing a new sequence from scratch. | [
"Sets",
"the",
"sequence",
"info",
"back",
"to",
"default",
"values",
"ie",
".",
"in",
"order",
"to",
"start",
"constructing",
"a",
"new",
"sequence",
"from",
"scratch",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderParser.java#L67-L76 |
31,705 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/Prism.java | Prism.setInscribedRadius | public void setInscribedRadius(double radius) {
double side = getSideLengthFromInscribedRadius(radius, n);
this.circumscribedRadius = getCircumscribedRadiusFromSideLength(side, n);
} | java | public void setInscribedRadius(double radius) {
double side = getSideLengthFromInscribedRadius(radius, n);
this.circumscribedRadius = getCircumscribedRadiusFromSideLength(side, n);
} | [
"public",
"void",
"setInscribedRadius",
"(",
"double",
"radius",
")",
"{",
"double",
"side",
"=",
"getSideLengthFromInscribedRadius",
"(",
"radius",
",",
"n",
")",
";",
"this",
".",
"circumscribedRadius",
"=",
"getCircumscribedRadiusFromSideLength",
"(",
"side",
","... | Sets the radius of an inscribed sphere, that is tangent to each
of the icosahedron's faces
@param inscribedRadius the inscribedRadius to set | [
"Sets",
"the",
"radius",
"of",
"an",
"inscribed",
"sphere",
"that",
"is",
"tangent",
"to",
"each",
"of",
"the",
"icosahedron",
"s",
"faces"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/Prism.java#L92-L95 |
31,706 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/GeneIDGFF2Reader.java | GeneIDGFF2Reader.read | public static FeatureList read(String filename) throws IOException {
logger.info("Reading: {}", filename);
FeatureList features = new FeatureList();
BufferedReader br = new BufferedReader(new FileReader(filename));
String s;
for (s = br.readLine(); null != s; s = br.readLine()) {
s = s.trim();
if (s.... | java | public static FeatureList read(String filename) throws IOException {
logger.info("Reading: {}", filename);
FeatureList features = new FeatureList();
BufferedReader br = new BufferedReader(new FileReader(filename));
String s;
for (s = br.readLine(); null != s; s = br.readLine()) {
s = s.trim();
if (s.... | [
"public",
"static",
"FeatureList",
"read",
"(",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"logger",
".",
"info",
"(",
"\"Reading: {}\"",
",",
"filename",
")",
";",
"FeatureList",
"features",
"=",
"new",
"FeatureList",
"(",
")",
";",
"BufferedRea... | Read a file into a FeatureList. Each line of the file becomes one Feature object.
@param filename The path to the GFF file.
@return A FeatureList.
@throws IOException Something went wrong -- check exception detail message. | [
"Read",
"a",
"file",
"into",
"a",
"FeatureList",
".",
"Each",
"line",
"of",
"the",
"file",
"becomes",
"one",
"Feature",
"object",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/GeneIDGFF2Reader.java#L61-L87 |
31,707 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java | CeCPMain.invertAlignment | public AFPChain invertAlignment(AFPChain a) {
String name1 = a.getName1();
String name2 = a.getName2();
a.setName1(name2);
a.setName2(name1);
int len1 = a.getCa1Length();
a.setCa1Length( a.getCa2Length() );
a.setCa2Length( len1 );
int beg1 = a.getAlnbeg1();
a.setAlnbeg1(a.getAlnbeg2());
a.setAlnbe... | java | public AFPChain invertAlignment(AFPChain a) {
String name1 = a.getName1();
String name2 = a.getName2();
a.setName1(name2);
a.setName2(name1);
int len1 = a.getCa1Length();
a.setCa1Length( a.getCa2Length() );
a.setCa2Length( len1 );
int beg1 = a.getAlnbeg1();
a.setAlnbeg1(a.getAlnbeg2());
a.setAlnbe... | [
"public",
"AFPChain",
"invertAlignment",
"(",
"AFPChain",
"a",
")",
"{",
"String",
"name1",
"=",
"a",
".",
"getName1",
"(",
")",
";",
"String",
"name2",
"=",
"a",
".",
"getName2",
"(",
")",
";",
"a",
".",
"setName1",
"(",
"name2",
")",
";",
"a",
".... | Swaps the order of structures in an AFPChain
@param a
@return | [
"Swaps",
"the",
"order",
"of",
"structures",
"in",
"an",
"AFPChain"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java#L233-L303 |
31,708 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java | CeCPMain.filterDuplicateAFPs | public static AFPChain filterDuplicateAFPs(AFPChain afpChain, CECalculator ceCalc, Atom[] ca1, Atom[] ca2duplicated) throws StructureException {
return filterDuplicateAFPs(afpChain, ceCalc, ca1, ca2duplicated, null);
} | java | public static AFPChain filterDuplicateAFPs(AFPChain afpChain, CECalculator ceCalc, Atom[] ca1, Atom[] ca2duplicated) throws StructureException {
return filterDuplicateAFPs(afpChain, ceCalc, ca1, ca2duplicated, null);
} | [
"public",
"static",
"AFPChain",
"filterDuplicateAFPs",
"(",
"AFPChain",
"afpChain",
",",
"CECalculator",
"ceCalc",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2duplicated",
")",
"throws",
"StructureException",
"{",
"return",
"filterDuplicateAFPs",
"(",... | Takes as input an AFPChain where ca2 has been artificially duplicated.
This raises the possibility that some residues of ca2 will appear in
multiple AFPs. This method filters out duplicates and makes sure that
all AFPs are numbered relative to the original ca2.
<p>The current version chooses a CP site such that the le... | [
"Takes",
"as",
"input",
"an",
"AFPChain",
"where",
"ca2",
"has",
"been",
"artificially",
"duplicated",
".",
"This",
"raises",
"the",
"possibility",
"that",
"some",
"residues",
"of",
"ca2",
"will",
"appear",
"in",
"multiple",
"AFPs",
".",
"This",
"method",
"f... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java#L323-L325 |
31,709 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java | CeCPMain.calculateMinCP | protected static CPRange calculateMinCP(int[] block, int blockLen, int ca2len, int minCPlength) {
CPRange range = new CPRange();
// Find the cut point within the alignment.
// Either returns the index i of the alignment such that block[i] == ca2len,
// or else returns -i-1 where block[i] is the first element >... | java | protected static CPRange calculateMinCP(int[] block, int blockLen, int ca2len, int minCPlength) {
CPRange range = new CPRange();
// Find the cut point within the alignment.
// Either returns the index i of the alignment such that block[i] == ca2len,
// or else returns -i-1 where block[i] is the first element >... | [
"protected",
"static",
"CPRange",
"calculateMinCP",
"(",
"int",
"[",
"]",
"block",
",",
"int",
"blockLen",
",",
"int",
"ca2len",
",",
"int",
"minCPlength",
")",
"{",
"CPRange",
"range",
"=",
"new",
"CPRange",
"(",
")",
";",
"// Find the cut point within the al... | Finds the alignment index of the residues minCPlength before and after
the duplication.
@param block The permuted block being considered, generally optAln[0][1]
@param blockLen The length of the block (in case extra memory was allocated in block)
@param ca2len The length, in residues, of the protein specified by block... | [
"Finds",
"the",
"alignment",
"index",
"of",
"the",
"residues",
"minCPlength",
"before",
"and",
"after",
"the",
"duplication",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java#L635-L668 |
31,710 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/SandboxStyleStructureProvider.java | SandboxStyleStructureProvider.setPath | public void setPath(String p){
path = p ;
if ( ! (path.endsWith(fileSeparator) ) )
path = path + fileSeparator;
} | java | public void setPath(String p){
path = p ;
if ( ! (path.endsWith(fileSeparator) ) )
path = path + fileSeparator;
} | [
"public",
"void",
"setPath",
"(",
"String",
"p",
")",
"{",
"path",
"=",
"p",
";",
"if",
"(",
"!",
"(",
"path",
".",
"endsWith",
"(",
"fileSeparator",
")",
")",
")",
"path",
"=",
"path",
"+",
"fileSeparator",
";",
"}"
] | directory where to find PDB files | [
"directory",
"where",
"to",
"find",
"PDB",
"files"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SandboxStyleStructureProvider.java#L127-L134 |
31,711 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/SandboxStyleStructureProvider.java | SandboxStyleStructureProvider.getAllPDBIDs | public List<String> getAllPDBIDs() throws IOException{
File f = new File(path);
if ( ! f.isDirectory())
throw new IOException("Path " + path + " is not a directory!");
String[] dirName = f.list();
List<String>pdbIds = new ArrayList<String>();
for (String dir : dirName) {
File d2= new File(f,dir);
... | java | public List<String> getAllPDBIDs() throws IOException{
File f = new File(path);
if ( ! f.isDirectory())
throw new IOException("Path " + path + " is not a directory!");
String[] dirName = f.list();
List<String>pdbIds = new ArrayList<String>();
for (String dir : dirName) {
File d2= new File(f,dir);
... | [
"public",
"List",
"<",
"String",
">",
"getAllPDBIDs",
"(",
")",
"throws",
"IOException",
"{",
"File",
"f",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"!",
"f",
".",
"isDirectory",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"Path ... | Returns a list of all PDB IDs that are available in this installation
@return a list of PDB IDs | [
"Returns",
"a",
"list",
"of",
"all",
"PDB",
"IDs",
"that",
"are",
"available",
"in",
"this",
"installation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SandboxStyleStructureProvider.java#L182-L205 |
31,712 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java | BioAssemblyTools.getMaximumExtend | public static double getMaximumExtend( final Structure structure ) {
double[][] bounds = getAtomCoordinateBounds(structure);
double xMax = Math.abs(bounds[0][0] - bounds[1][0]);
double yMax = Math.abs(bounds[0][1] - bounds[1][1]);
double zMax = Math.abs(bounds[0][2] - bounds[1][2]);
return Math.max(xMax, Math... | java | public static double getMaximumExtend( final Structure structure ) {
double[][] bounds = getAtomCoordinateBounds(structure);
double xMax = Math.abs(bounds[0][0] - bounds[1][0]);
double yMax = Math.abs(bounds[0][1] - bounds[1][1]);
double zMax = Math.abs(bounds[0][2] - bounds[1][2]);
return Math.max(xMax, Math... | [
"public",
"static",
"double",
"getMaximumExtend",
"(",
"final",
"Structure",
"structure",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"bounds",
"=",
"getAtomCoordinateBounds",
"(",
"structure",
")",
";",
"double",
"xMax",
"=",
"Math",
".",
"abs",
"(",
"bounds",
... | Returns the maximum extend of the structure in the x, y, or z direction.
@param structure
@return maximum extend | [
"Returns",
"the",
"maximum",
"extend",
"of",
"the",
"structure",
"in",
"the",
"x",
"y",
"or",
"z",
"direction",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java#L242-L248 |
31,713 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java | BioAssemblyTools.getBiologicalMoleculeMaximumExtend | public static double getBiologicalMoleculeMaximumExtend( final Structure structure,List<BiologicalAssemblyTransformation> transformations ) {
double[][] bounds = getBiologicalMoleculeBounds(structure, transformations);
double xMax = Math.abs(bounds[0][0] - bounds[1][0]);
double yMax = Math.abs(bounds[0][1] - boun... | java | public static double getBiologicalMoleculeMaximumExtend( final Structure structure,List<BiologicalAssemblyTransformation> transformations ) {
double[][] bounds = getBiologicalMoleculeBounds(structure, transformations);
double xMax = Math.abs(bounds[0][0] - bounds[1][0]);
double yMax = Math.abs(bounds[0][1] - boun... | [
"public",
"static",
"double",
"getBiologicalMoleculeMaximumExtend",
"(",
"final",
"Structure",
"structure",
",",
"List",
"<",
"BiologicalAssemblyTransformation",
">",
"transformations",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"bounds",
"=",
"getBiologicalMoleculeBounds"... | Returns the maximum extend of the biological molecule in the x, y, or z direction.
@param structure
@return maximum extend | [
"Returns",
"the",
"maximum",
"extend",
"of",
"the",
"biological",
"molecule",
"in",
"the",
"x",
"y",
"or",
"z",
"direction",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java#L255-L261 |
31,714 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java | BioAssemblyTools.getBiologicalMoleculeCentroid | public static double[] getBiologicalMoleculeCentroid( final Structure asymUnit,List<BiologicalAssemblyTransformation> transformations ) throws IllegalArgumentException {
if ( asymUnit == null ) {
throw new IllegalArgumentException( "null structure" );
}
Atom[] atoms = StructureTools.getAllAtomArray(asymUnit);... | java | public static double[] getBiologicalMoleculeCentroid( final Structure asymUnit,List<BiologicalAssemblyTransformation> transformations ) throws IllegalArgumentException {
if ( asymUnit == null ) {
throw new IllegalArgumentException( "null structure" );
}
Atom[] atoms = StructureTools.getAllAtomArray(asymUnit);... | [
"public",
"static",
"double",
"[",
"]",
"getBiologicalMoleculeCentroid",
"(",
"final",
"Structure",
"asymUnit",
",",
"List",
"<",
"BiologicalAssemblyTransformation",
">",
"transformations",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"asymUnit",
"==",
"... | Returns the centroid of the biological molecule.
@param structure
@return centroid
@throws IllegalArgumentException if structure is null | [
"Returns",
"the",
"centroid",
"of",
"the",
"biological",
"molecule",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java#L270-L323 |
31,715 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java | Location.fromBioExt | public static Location fromBioExt( int start, int length, char strand, int totalLength )
{
int s= start;
int e= s + length;
if( !( strand == '-' || strand == '+' || strand == '.' ))
{
throw new IllegalArgumentException( "Strand must be '+', '-', or '.'" );
}
if( strand == '-' )
{
s= s - totalLen... | java | public static Location fromBioExt( int start, int length, char strand, int totalLength )
{
int s= start;
int e= s + length;
if( !( strand == '-' || strand == '+' || strand == '.' ))
{
throw new IllegalArgumentException( "Strand must be '+', '-', or '.'" );
}
if( strand == '-' )
{
s= s - totalLen... | [
"public",
"static",
"Location",
"fromBioExt",
"(",
"int",
"start",
",",
"int",
"length",
",",
"char",
"strand",
",",
"int",
"totalLength",
")",
"{",
"int",
"s",
"=",
"start",
";",
"int",
"e",
"=",
"s",
"+",
"length",
";",
"if",
"(",
"!",
"(",
"stra... | Create a location from MAF file coordinates, which represent negative
strand locations as the distance from the end of the sequence.
@param start Origin 1 index of first symbol.
@param length Number of symbols in range.
@param strand '+' or '-' or '.' ('.' is interpreted as '+').
@param totalLength Total number of sym... | [
"Create",
"a",
"location",
"from",
"MAF",
"file",
"coordinates",
"which",
"represent",
"negative",
"strand",
"locations",
"as",
"the",
"distance",
"from",
"the",
"end",
"of",
"the",
"sequence",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L164-L181 |
31,716 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java | Location.intersection | public Location intersection(Location other) {
if (isSameStrand(other)) {
return intersect(mStart, mEnd, other.mStart, other.mEnd);
} else {
throw new IllegalArgumentException("Locations are on opposite strands.");
}
} | java | public Location intersection(Location other) {
if (isSameStrand(other)) {
return intersect(mStart, mEnd, other.mStart, other.mEnd);
} else {
throw new IllegalArgumentException("Locations are on opposite strands.");
}
} | [
"public",
"Location",
"intersection",
"(",
"Location",
"other",
")",
"{",
"if",
"(",
"isSameStrand",
"(",
"other",
")",
")",
"{",
"return",
"intersect",
"(",
"mStart",
",",
"mEnd",
",",
"other",
".",
"mStart",
",",
"other",
".",
"mEnd",
")",
";",
"}",
... | Return the intersection, or null if no overlap.
@param other
The location to intersect.
@return The maximal location that is contained by both. Returns null if
no overlap!
@throws IllegalArgumentException
Locations are on opposite strands. | [
"Return",
"the",
"intersection",
"or",
"null",
"if",
"no",
"overlap",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L288-L294 |
31,717 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java | Location.upstream | public Location upstream( int length )
{
if( length < 0 )
{
throw new IllegalArgumentException( "Parameter must be >= 0; is=" + length );
}
if( Math.signum( mStart - length) == Math.signum( mStart ) || 0 == Math.signum( mStart - length ) )
{
return new Location(mStart - length, mStart );
}
else
... | java | public Location upstream( int length )
{
if( length < 0 )
{
throw new IllegalArgumentException( "Parameter must be >= 0; is=" + length );
}
if( Math.signum( mStart - length) == Math.signum( mStart ) || 0 == Math.signum( mStart - length ) )
{
return new Location(mStart - length, mStart );
}
else
... | [
"public",
"Location",
"upstream",
"(",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter must be >= 0; is=\"",
"+",
"length",
")",
";",
"}",
"if",
"(",
"Math",
".",
"signum",
"... | Return the adjacent location of specified length directly upstream of this location.
@return Upstream location.
@param length The length of the upstream location.
@throws IndexOutOfBoundsException Specified length causes crossing of origin. | [
"Return",
"the",
"adjacent",
"location",
"of",
"specified",
"length",
"directly",
"upstream",
"of",
"this",
"location",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L556-L571 |
31,718 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java | Location.downstream | public Location downstream( int length )
{
if( length < 0 )
{
throw new IllegalArgumentException( "Parameter must be >= 0; is=" + length );
}
if( Math.signum( mEnd + length) == Math.signum( mEnd ) || 0 == Math.signum( mEnd + length ) )
{
return new Location( mEnd, mEnd + length );
}
else
{
th... | java | public Location downstream( int length )
{
if( length < 0 )
{
throw new IllegalArgumentException( "Parameter must be >= 0; is=" + length );
}
if( Math.signum( mEnd + length) == Math.signum( mEnd ) || 0 == Math.signum( mEnd + length ) )
{
return new Location( mEnd, mEnd + length );
}
else
{
th... | [
"public",
"Location",
"downstream",
"(",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter must be >= 0; is=\"",
"+",
"length",
")",
";",
"}",
"if",
"(",
"Math",
".",
"signum",
... | Return the adjacent location of specified length directly downstream of this location.
@return The downstream location.
@param length The length of the downstream location.
@throws IndexOutOfBoundsException Specified length causes crossing of origin. | [
"Return",
"the",
"adjacent",
"location",
"of",
"specified",
"length",
"directly",
"downstream",
"of",
"this",
"location",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L580-L596 |
31,719 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java | Location.distance | public int distance( Location other )
{
if( isSameStrand( other ))
{
if( overlaps( other ))
{
return -1;
}
else
{
return ( mEnd <= other.mStart )? (other.mStart - mEnd) : (mStart - other.mEnd);
}
}
else
{
throw new IllegalArgumentException( "Locations are on opposite strands." );... | java | public int distance( Location other )
{
if( isSameStrand( other ))
{
if( overlaps( other ))
{
return -1;
}
else
{
return ( mEnd <= other.mStart )? (other.mStart - mEnd) : (mStart - other.mEnd);
}
}
else
{
throw new IllegalArgumentException( "Locations are on opposite strands." );... | [
"public",
"int",
"distance",
"(",
"Location",
"other",
")",
"{",
"if",
"(",
"isSameStrand",
"(",
"other",
")",
")",
"{",
"if",
"(",
"overlaps",
"(",
"other",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"else",
"{",
"return",
"(",
"mEnd",
"<=",
"... | Return distance between this location and the other location.
Distance is defined only if both locations are on same strand.
@param other The location to compare.
@return The integer distance. Returns -1 if they overlap; 0 if directly adjacent.
@throws IllegalArgumentException Locations are on opposite strands. | [
"Return",
"distance",
"between",
"this",
"location",
"and",
"the",
"other",
"location",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L609-L626 |
31,720 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java | Location.percentOverlap | public double percentOverlap( Location other )
{
if( length() > 0 && overlaps( other ))
{
return 100.0 * (((double) intersection( other ).length()) / (double) length());
}
else
{
return 0;
}
} | java | public double percentOverlap( Location other )
{
if( length() > 0 && overlaps( other ))
{
return 100.0 * (((double) intersection( other ).length()) / (double) length());
}
else
{
return 0;
}
} | [
"public",
"double",
"percentOverlap",
"(",
"Location",
"other",
")",
"{",
"if",
"(",
"length",
"(",
")",
">",
"0",
"&&",
"overlaps",
"(",
"other",
")",
")",
"{",
"return",
"100.0",
"*",
"(",
"(",
"(",
"double",
")",
"intersection",
"(",
"other",
")",... | Return percent overlap of two locations.
@param other The location to compare.
@return 100.0 * intersection(other).length() / this.length()
@throws IllegalArgumentException Locations are on opposite strands. | [
"Return",
"percent",
"overlap",
"of",
"two",
"locations",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L635-L645 |
31,721 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java | Location.contains | public boolean contains( Location other )
{
if( isSameStrand( other ))
{
return ( mStart <= other.mStart && mEnd >= other.mEnd );
}
else
{
throw new IllegalArgumentException( "Locations are on opposite strands." );
}
} | java | public boolean contains( Location other )
{
if( isSameStrand( other ))
{
return ( mStart <= other.mStart && mEnd >= other.mEnd );
}
else
{
throw new IllegalArgumentException( "Locations are on opposite strands." );
}
} | [
"public",
"boolean",
"contains",
"(",
"Location",
"other",
")",
"{",
"if",
"(",
"isSameStrand",
"(",
"other",
")",
")",
"{",
"return",
"(",
"mStart",
"<=",
"other",
".",
"mStart",
"&&",
"mEnd",
">=",
"other",
".",
"mEnd",
")",
";",
"}",
"else",
"{",
... | Check if this location contains the other.
@param other The location to compare.
@return True if other is entirely contained by this location.
@throws IllegalArgumentException Locations are on opposite strands. | [
"Check",
"if",
"this",
"location",
"contains",
"the",
"other",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L673-L683 |
31,722 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyTransformation.java | BiologicalAssemblyTransformation.transformPoint | public void transformPoint(final double[] point) {
Point3d p = new Point3d(point[0],point[1],point[2]);
transformation.transform(p);
point[0] = p.x;
point[1] = p.y;
point[2] = p.z;
} | java | public void transformPoint(final double[] point) {
Point3d p = new Point3d(point[0],point[1],point[2]);
transformation.transform(p);
point[0] = p.x;
point[1] = p.y;
point[2] = p.z;
} | [
"public",
"void",
"transformPoint",
"(",
"final",
"double",
"[",
"]",
"point",
")",
"{",
"Point3d",
"p",
"=",
"new",
"Point3d",
"(",
"point",
"[",
"0",
"]",
",",
"point",
"[",
"1",
"]",
",",
"point",
"[",
"2",
"]",
")",
";",
"transformation",
".",
... | Applies the transformation to given point. | [
"Applies",
"the",
"transformation",
"to",
"given",
"point",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyTransformation.java#L153-L159 |
31,723 | biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/cox/StrataInfo.java | StrataInfo.getNearestTime | public Double getNearestTime(double timePercentage) {
//the arrays should be sorted by time so this step is probably not needed
Double minTime = null;
Double maxTime = null;
for (Double t : time) {
if (minTime == null || t < minTime) {
minTime = t;
}
if (maxTime == null || t > maxTime) {
maxTim... | java | public Double getNearestTime(double timePercentage) {
//the arrays should be sorted by time so this step is probably not needed
Double minTime = null;
Double maxTime = null;
for (Double t : time) {
if (minTime == null || t < minTime) {
minTime = t;
}
if (maxTime == null || t > maxTime) {
maxTim... | [
"public",
"Double",
"getNearestTime",
"(",
"double",
"timePercentage",
")",
"{",
"//the arrays should be sorted by time so this step is probably not needed",
"Double",
"minTime",
"=",
"null",
";",
"Double",
"maxTime",
"=",
"null",
";",
"for",
"(",
"Double",
"t",
":",
... | Need to find the actual time for the nearest time represented as a
percentage Would be used to then look up the number at risk at that
particular time
@param timePercentage
@return | [
"Need",
"to",
"find",
"the",
"actual",
"time",
"for",
"the",
"nearest",
"time",
"represented",
"as",
"a",
"percentage",
"Would",
"be",
"used",
"to",
"then",
"look",
"up",
"the",
"number",
"at",
"risk",
"at",
"that",
"particular",
"time"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/StrataInfo.java#L58-L81 |
31,724 | biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/cox/StrataInfo.java | StrataInfo.getNearestAtRisk | public Double getNearestAtRisk(double t) {
Integer index = 0;
/* String timeValue = t + "";
String format = "#";
int numDecimals = 0;
int decimalIndex = timeValue.indexOf(".");
if (decimalIndex > 0) {
for (int i = timeValue.length() - 1; i > decimalIndex; i--) {
if (timeValue.charAt(i) == '0' && ... | java | public Double getNearestAtRisk(double t) {
Integer index = 0;
/* String timeValue = t + "";
String format = "#";
int numDecimals = 0;
int decimalIndex = timeValue.indexOf(".");
if (decimalIndex > 0) {
for (int i = timeValue.length() - 1; i > decimalIndex; i--) {
if (timeValue.charAt(i) == '0' && ... | [
"public",
"Double",
"getNearestAtRisk",
"(",
"double",
"t",
")",
"{",
"Integer",
"index",
"=",
"0",
";",
"/* String timeValue = t + \"\";\n\t\tString format = \"#\";\n\t\tint numDecimals = 0;\n\t\tint decimalIndex = timeValue.indexOf(\".\");\n\t\tif (decimalIndex > 0) {\n\t\t\tfor (i... | Selection of number of risk will depend on the precision and rounding of
time in the survival table. If you are asking for 12 and entry exists for
11.9999999 then 12 is greater than 11.99999 unless you round.
@param t
@return | [
"Selection",
"of",
"number",
"of",
"risk",
"will",
"depend",
"on",
"the",
"precision",
"and",
"rounding",
"of",
"time",
"in",
"the",
"survival",
"table",
".",
"If",
"you",
"are",
"asking",
"for",
"12",
"and",
"entry",
"exists",
"for",
"11",
".",
"9999999... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/StrataInfo.java#L91-L144 |
31,725 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java | JmolSymmetryScriptGeneratorH.getDefaultOrientation | @Override
public String getDefaultOrientation() {
StringBuilder s = new StringBuilder();
s.append(setCentroid());
Quat4d q = new Quat4d();
q.set(helixAxisAligner.getRotationMatrix());
// set orientation
s.append("moveto 0 quaternion{");
s.append(jMolFloat(q.x));
s.append(",");
s.append(jMolFloat(q.... | java | @Override
public String getDefaultOrientation() {
StringBuilder s = new StringBuilder();
s.append(setCentroid());
Quat4d q = new Quat4d();
q.set(helixAxisAligner.getRotationMatrix());
// set orientation
s.append("moveto 0 quaternion{");
s.append(jMolFloat(q.x));
s.append(",");
s.append(jMolFloat(q.... | [
"@",
"Override",
"public",
"String",
"getDefaultOrientation",
"(",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"s",
".",
"append",
"(",
"setCentroid",
"(",
")",
")",
";",
"Quat4d",
"q",
"=",
"new",
"Quat4d",
"(",
")",
";... | Returns a Jmol script to set the default orientation for a structure
@return Jmol script | [
"Returns",
"a",
"Jmol",
"script",
"to",
"set",
"the",
"default",
"orientation",
"for",
"a",
"structure"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java#L69-L88 |
31,726 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java | JmolSymmetryScriptGeneratorH.playOrientations | @Override
public String playOrientations() {
StringBuilder s = new StringBuilder();
// draw footer
s.append(drawFooter("Symmetry Helical", "white"));
// draw polygon
s.append(drawPolyhedron()); // draw invisibly
s.append(showPolyhedron());
// draw axes
s.append(drawAxes());
s.append(showAxes());
... | java | @Override
public String playOrientations() {
StringBuilder s = new StringBuilder();
// draw footer
s.append(drawFooter("Symmetry Helical", "white"));
// draw polygon
s.append(drawPolyhedron()); // draw invisibly
s.append(showPolyhedron());
// draw axes
s.append(drawAxes());
s.append(showAxes());
... | [
"@",
"Override",
"public",
"String",
"playOrientations",
"(",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// draw footer",
"s",
".",
"append",
"(",
"drawFooter",
"(",
"\"Symmetry Helical\"",
",",
"\"white\"",
")",
")",
";",
"... | Returns a Jmol script that displays a symmetry polyhedron and symmetry axes
and then loop through different orientations
@return Jmol script | [
"Returns",
"a",
"Jmol",
"script",
"that",
"displays",
"a",
"symmetry",
"polyhedron",
"and",
"symmetry",
"axes",
"and",
"then",
"loop",
"through",
"different",
"orientations"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java#L366-L395 |
31,727 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java | JmolSymmetryScriptGeneratorH.colorBySymmetry | @Override
public String colorBySymmetry() {
List<List<Integer>> units = helixAxisAligner.getHelixLayers().getByLargestContacts().getLayerLines();
units = orientLayerLines(units);
QuatSymmetrySubunits subunits = helixAxisAligner.getSubunits();
List<Integer> modelNumbers = subunits.getModelNumbers();
List<Stri... | java | @Override
public String colorBySymmetry() {
List<List<Integer>> units = helixAxisAligner.getHelixLayers().getByLargestContacts().getLayerLines();
units = orientLayerLines(units);
QuatSymmetrySubunits subunits = helixAxisAligner.getSubunits();
List<Integer> modelNumbers = subunits.getModelNumbers();
List<Stri... | [
"@",
"Override",
"public",
"String",
"colorBySymmetry",
"(",
")",
"{",
"List",
"<",
"List",
"<",
"Integer",
">>",
"units",
"=",
"helixAxisAligner",
".",
"getHelixLayers",
"(",
")",
".",
"getByLargestContacts",
"(",
")",
".",
"getLayerLines",
"(",
")",
";",
... | Returns a Jmol script that colors subunits to highlight the symmetry within a structure
Different subunits should have a consistent color scheme or different shade of the same colors
@return Jmol script | [
"Returns",
"a",
"Jmol",
"script",
"that",
"colors",
"subunits",
"to",
"highlight",
"the",
"symmetry",
"within",
"a",
"structure",
"Different",
"subunits",
"should",
"have",
"a",
"consistent",
"color",
"scheme",
"or",
"different",
"shade",
"of",
"the",
"same",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java#L474-L518 |
31,728 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java | JmolSymmetryScriptGeneratorH.orientLayerLines | private List<List<Integer>> orientLayerLines(List<List<Integer>> layerLines) {
Matrix4d transformation = helixAxisAligner.getTransformation();
List<Point3d> centers = helixAxisAligner.getSubunits().getOriginalCenters();
for (int i = 0; i < layerLines.size(); i++) {
List<Integer> layerLine = layerLines.get(i);... | java | private List<List<Integer>> orientLayerLines(List<List<Integer>> layerLines) {
Matrix4d transformation = helixAxisAligner.getTransformation();
List<Point3d> centers = helixAxisAligner.getSubunits().getOriginalCenters();
for (int i = 0; i < layerLines.size(); i++) {
List<Integer> layerLine = layerLines.get(i);... | [
"private",
"List",
"<",
"List",
"<",
"Integer",
">",
">",
"orientLayerLines",
"(",
"List",
"<",
"List",
"<",
"Integer",
">",
">",
"layerLines",
")",
"{",
"Matrix4d",
"transformation",
"=",
"helixAxisAligner",
".",
"getTransformation",
"(",
")",
";",
"List",
... | Orients layer lines from lowest y-axis value to largest y-axis value | [
"Orients",
"layer",
"lines",
"from",
"lowest",
"y",
"-",
"axis",
"value",
"to",
"largest",
"y",
"-",
"axis",
"value"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorH.java#L536-L560 |
31,729 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java | MultipleAlignmentWriter.toTransformMatrices | public static String toTransformMatrices(MultipleAlignment alignment) {
StringBuffer txt = new StringBuffer();
for (int bs = 0; bs < alignment.getBlockSets().size(); bs++) {
List<Matrix4d> btransforms = alignment.getBlockSet(bs)
.getTransformations();
if (btransforms == null || btransforms.size() < 1)... | java | public static String toTransformMatrices(MultipleAlignment alignment) {
StringBuffer txt = new StringBuffer();
for (int bs = 0; bs < alignment.getBlockSets().size(); bs++) {
List<Matrix4d> btransforms = alignment.getBlockSet(bs)
.getTransformations();
if (btransforms == null || btransforms.size() < 1)... | [
"public",
"static",
"String",
"toTransformMatrices",
"(",
"MultipleAlignment",
"alignment",
")",
"{",
"StringBuffer",
"txt",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"bs",
"=",
"0",
";",
"bs",
"<",
"alignment",
".",
"getBlockSets",
"(",
... | Converts the transformation Matrices of the alignment into a String
output.
@param afpChain
@return String transformation Matrices | [
"Converts",
"the",
"transformation",
"Matrices",
"of",
"the",
"alignment",
"into",
"a",
"String",
"output",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java#L198-L248 |
31,730 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java | MultipleAlignmentWriter.toXML | public static String toXML(MultipleAlignmentEnsemble ensemble)
throws IOException {
StringWriter result = new StringWriter();
PrintWriter writer = new PrintWriter(result);
PrettyXMLWriter xml = new PrettyXMLWriter(writer);
MultipleAlignmentXMLConverter.printXMLensemble(xml, ensemble);
writer.close();
... | java | public static String toXML(MultipleAlignmentEnsemble ensemble)
throws IOException {
StringWriter result = new StringWriter();
PrintWriter writer = new PrintWriter(result);
PrettyXMLWriter xml = new PrettyXMLWriter(writer);
MultipleAlignmentXMLConverter.printXMLensemble(xml, ensemble);
writer.close();
... | [
"public",
"static",
"String",
"toXML",
"(",
"MultipleAlignmentEnsemble",
"ensemble",
")",
"throws",
"IOException",
"{",
"StringWriter",
"result",
"=",
"new",
"StringWriter",
"(",
")",
";",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter",
"(",
"result",
")",
"... | Converts all the information of a multiple alignment ensemble into an XML
String format. Cached variables, like transformation matrices and scores,
are also converted.
@param ensemble
the MultipleAlignmentEnsemble to convert.
@return String XML representation of the ensemble
@throws IOException
@see MultipleAlignmentX... | [
"Converts",
"all",
"the",
"information",
"of",
"a",
"multiple",
"alignment",
"ensemble",
"into",
"an",
"XML",
"String",
"format",
".",
"Cached",
"variables",
"like",
"transformation",
"matrices",
"and",
"scores",
"are",
"also",
"converted",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java#L261-L273 |
31,731 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java | FastqTools.qualityScores | public static Iterable<Number> qualityScores(final Fastq fastq)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
int size = fastq.getQuality().length();
List<Number> qualityScores = Lists.newArrayListWithExpectedSize(size);
FastqVariant variant = fastq.getVariant();... | java | public static Iterable<Number> qualityScores(final Fastq fastq)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
int size = fastq.getQuality().length();
List<Number> qualityScores = Lists.newArrayListWithExpectedSize(size);
FastqVariant variant = fastq.getVariant();... | [
"public",
"static",
"Iterable",
"<",
"Number",
">",
"qualityScores",
"(",
"final",
"Fastq",
"fastq",
")",
"{",
"if",
"(",
"fastq",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fastq must not be null\"",
")",
";",
"}",
"int",
"s... | Return the quality scores from the specified FASTQ formatted sequence.
@param fastq FASTQ formatted sequence, must not be null
@return the quality scores from the specified FASTQ formatted sequence | [
"Return",
"the",
"quality",
"scores",
"from",
"the",
"specified",
"FASTQ",
"formatted",
"sequence",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java#L167-L182 |
31,732 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java | FastqTools.qualityScores | public static int[] qualityScores(final Fastq fastq, final int[] qualityScores)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (qualityScores == null)
{
throw new IllegalArgumentException("qualityScores must not be null");
}
int size = fastq.getQuality().l... | java | public static int[] qualityScores(final Fastq fastq, final int[] qualityScores)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (qualityScores == null)
{
throw new IllegalArgumentException("qualityScores must not be null");
}
int size = fastq.getQuality().l... | [
"public",
"static",
"int",
"[",
"]",
"qualityScores",
"(",
"final",
"Fastq",
"fastq",
",",
"final",
"int",
"[",
"]",
"qualityScores",
")",
"{",
"if",
"(",
"fastq",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fastq must not be ... | Copy the quality scores from the specified FASTQ formatted sequence into the specified int array.
@param fastq FASTQ formatted sequence, must not be null
@param qualityScores int array of quality scores, must not be null and must be the same
length as the FASTQ formatted sequence quality
@return the specified int arra... | [
"Copy",
"the",
"quality",
"scores",
"from",
"the",
"specified",
"FASTQ",
"formatted",
"sequence",
"into",
"the",
"specified",
"int",
"array",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java#L192-L214 |
31,733 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java | FastqTools.errorProbabilities | public static double[] errorProbabilities(final Fastq fastq, final double[] errorProbabilities)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (errorProbabilities == null)
{
throw new IllegalArgumentException("errorProbabilities must not be null");
}
int s... | java | public static double[] errorProbabilities(final Fastq fastq, final double[] errorProbabilities)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (errorProbabilities == null)
{
throw new IllegalArgumentException("errorProbabilities must not be null");
}
int s... | [
"public",
"static",
"double",
"[",
"]",
"errorProbabilities",
"(",
"final",
"Fastq",
"fastq",
",",
"final",
"double",
"[",
"]",
"errorProbabilities",
")",
"{",
"if",
"(",
"fastq",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fa... | Copy the error probabilities from the specified FASTQ formatted sequence into the specified double array.
@param fastq FASTQ formatted sequence, must not be null
@param errorProbabilities double array of error probabilities, must not be null and must be the same
length as the FASTQ formatted sequence quality
@return t... | [
"Copy",
"the",
"error",
"probabilities",
"from",
"the",
"specified",
"FASTQ",
"formatted",
"sequence",
"into",
"the",
"specified",
"double",
"array",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java#L247-L269 |
31,734 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java | FastqTools.convert | public static Fastq convert(final Fastq fastq, final FastqVariant variant)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (variant == null)
{
throw new IllegalArgumentException("variant must not be null");
}
if (fastq.getVariant().equals(variant))
{
r... | java | public static Fastq convert(final Fastq fastq, final FastqVariant variant)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (variant == null)
{
throw new IllegalArgumentException("variant must not be null");
}
if (fastq.getVariant().equals(variant))
{
r... | [
"public",
"static",
"Fastq",
"convert",
"(",
"final",
"Fastq",
"fastq",
",",
"final",
"FastqVariant",
"variant",
")",
"{",
"if",
"(",
"fastq",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fastq must not be null\"",
")",
";",
"}",... | Convert the specified FASTQ formatted sequence to the
specified FASTQ sequence format variant.
@since 4.2
@param fastq FASTQ formatted sequence, must not be null
@param variant FASTQ sequence format variant, must not be null
@return the specified FASTQ formatted sequence converted to the
specified FASTQ sequence forma... | [
"Convert",
"the",
"specified",
"FASTQ",
"formatted",
"sequence",
"to",
"the",
"specified",
"FASTQ",
"sequence",
"format",
"variant",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java#L281-L296 |
31,735 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java | FastqTools.convertQualities | static String convertQualities(final Fastq fastq, final FastqVariant variant)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (variant == null)
{
throw new IllegalArgumentException("variant must not be null");
}
if (fastq.getVariant().equals(variant))
{
... | java | static String convertQualities(final Fastq fastq, final FastqVariant variant)
{
if (fastq == null)
{
throw new IllegalArgumentException("fastq must not be null");
}
if (variant == null)
{
throw new IllegalArgumentException("variant must not be null");
}
if (fastq.getVariant().equals(variant))
{
... | [
"static",
"String",
"convertQualities",
"(",
"final",
"Fastq",
"fastq",
",",
"final",
"FastqVariant",
"variant",
")",
"{",
"if",
"(",
"fastq",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fastq must not be null\"",
")",
";",
"}",
... | Convert the qualities in the specified FASTQ formatted sequence to the
specified FASTQ sequence format variant.
@since 4.2
@param fastq FASTQ formatted sequence, must not be null
@param variant FASTQ sequence format variant, must not be null
@return the qualities in the specified FASTQ formatted sequence converted to ... | [
"Convert",
"the",
"qualities",
"in",
"the",
"specified",
"FASTQ",
"formatted",
"sequence",
"to",
"the",
"specified",
"FASTQ",
"sequence",
"format",
"variant",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java#L308-L330 |
31,736 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java | FastqTools.toList | @SuppressWarnings("unchecked")
static <T> List<T> toList(final Iterable<? extends T> iterable)
{
if (iterable instanceof List)
{
return (List<T>) iterable;
}
return ImmutableList.copyOf(iterable);
} | java | @SuppressWarnings("unchecked")
static <T> List<T> toList(final Iterable<? extends T> iterable)
{
if (iterable instanceof List)
{
return (List<T>) iterable;
}
return ImmutableList.copyOf(iterable);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"final",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable",
")",
"{",
"if",
"(",
"iterable",
"instanceof",
"List",
")",
"{",
"return"... | Return the specified iterable as a list.
@paam <T> element type
@param iterable iterable
@return the specified iterable as a list | [
"Return",
"the",
"specified",
"iterable",
"as",
"a",
"list",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqTools.java#L339-L347 |
31,737 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/CDSComparator.java | CDSComparator.compare | @Override
public int compare(CDSSequence o1, CDSSequence o2) {
if(o1.getStrand() != o2.getStrand()){
return o1.getBioBegin() - o2.getBioBegin();
}
if(o1.getStrand() == Strand.NEGATIVE){
return -1 * (o1.getBioBegin() - o2.getBioBegin());
}
return o1.getBioBegin() - o2.getBioBegin();
} | java | @Override
public int compare(CDSSequence o1, CDSSequence o2) {
if(o1.getStrand() != o2.getStrand()){
return o1.getBioBegin() - o2.getBioBegin();
}
if(o1.getStrand() == Strand.NEGATIVE){
return -1 * (o1.getBioBegin() - o2.getBioBegin());
}
return o1.getBioBegin() - o2.getBioBegin();
} | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"CDSSequence",
"o1",
",",
"CDSSequence",
"o2",
")",
"{",
"if",
"(",
"o1",
".",
"getStrand",
"(",
")",
"!=",
"o2",
".",
"getStrand",
"(",
")",
")",
"{",
"return",
"o1",
".",
"getBioBegin",
"(",
")",
... | Used to sort two CDSSequences where Negative Strand makes it tough
@param o1
@param o2
@return val | [
"Used",
"to",
"sort",
"two",
"CDSSequences",
"where",
"Negative",
"Strand",
"makes",
"it",
"tough"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/CDSComparator.java#L40-L50 |
31,738 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/contact/AtomContactSet.java | AtomContactSet.getContact | public AtomContact getContact(Atom atom1, Atom atom2) {
return contacts.get(new Pair<AtomIdentifier>(
new AtomIdentifier(atom1.getPDBserial(),atom1.getGroup().getChainId()),
new AtomIdentifier(atom2.getPDBserial(),atom2.getGroup().getChainId()) ));
} | java | public AtomContact getContact(Atom atom1, Atom atom2) {
return contacts.get(new Pair<AtomIdentifier>(
new AtomIdentifier(atom1.getPDBserial(),atom1.getGroup().getChainId()),
new AtomIdentifier(atom2.getPDBserial(),atom2.getGroup().getChainId()) ));
} | [
"public",
"AtomContact",
"getContact",
"(",
"Atom",
"atom1",
",",
"Atom",
"atom2",
")",
"{",
"return",
"contacts",
".",
"get",
"(",
"new",
"Pair",
"<",
"AtomIdentifier",
">",
"(",
"new",
"AtomIdentifier",
"(",
"atom1",
".",
"getPDBserial",
"(",
")",
",",
... | Returns the corresponding AtomContact or null if no contact exists between the 2 given atoms
@param atom1
@param atom2
@return | [
"Returns",
"the",
"corresponding",
"AtomContact",
"or",
"null",
"if",
"no",
"contact",
"exists",
"between",
"the",
"2",
"given",
"atoms"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/AtomContactSet.java#L74-L78 |
31,739 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/contact/AtomContactSet.java | AtomContactSet.hasContactsWithinDistance | public boolean hasContactsWithinDistance(double distance) {
if (distance>=cutoff)
throw new IllegalArgumentException("Given distance "+
String.format("%.2f", distance)+" is larger than contacts' distance cutoff "+
String.format("%.2f", cutoff));
for (AtomContact contact:this.contacts.values()) {
i... | java | public boolean hasContactsWithinDistance(double distance) {
if (distance>=cutoff)
throw new IllegalArgumentException("Given distance "+
String.format("%.2f", distance)+" is larger than contacts' distance cutoff "+
String.format("%.2f", cutoff));
for (AtomContact contact:this.contacts.values()) {
i... | [
"public",
"boolean",
"hasContactsWithinDistance",
"(",
"double",
"distance",
")",
"{",
"if",
"(",
"distance",
">=",
"cutoff",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Given distance \"",
"+",
"String",
".",
"format",
"(",
"\"%.2f\"",
",",
"distance... | Returns true if at least 1 contact from this set is within the given distance.
Note that if the distance given is larger than the distance cutoff used to
calculate the contacts then nothing will be found.
@param distance
@return
@throws IllegalArgumentException if given distance is larger than distance cutoff
used for ... | [
"Returns",
"true",
"if",
"at",
"least",
"1",
"contact",
"from",
"this",
"set",
"is",
"within",
"the",
"given",
"distance",
".",
"Note",
"that",
"if",
"the",
"distance",
"given",
"is",
"larger",
"than",
"the",
"distance",
"cutoff",
"used",
"to",
"calculate"... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/AtomContactSet.java#L106-L119 |
31,740 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/contact/AtomContactSet.java | AtomContactSet.getContactsWithinDistance | public List<AtomContact> getContactsWithinDistance(double distance) {
if (distance>=cutoff)
throw new IllegalArgumentException("Given distance "+
String.format("%.2f", distance)+" is larger than contacts' distance cutoff "+
String.format("%.2f", cutoff));
List<AtomContact> list = new ArrayList<AtomCo... | java | public List<AtomContact> getContactsWithinDistance(double distance) {
if (distance>=cutoff)
throw new IllegalArgumentException("Given distance "+
String.format("%.2f", distance)+" is larger than contacts' distance cutoff "+
String.format("%.2f", cutoff));
List<AtomContact> list = new ArrayList<AtomCo... | [
"public",
"List",
"<",
"AtomContact",
">",
"getContactsWithinDistance",
"(",
"double",
"distance",
")",
"{",
"if",
"(",
"distance",
">=",
"cutoff",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Given distance \"",
"+",
"String",
".",
"format",
"(",
"\... | Returns the list of contacts from this set that are within the given distance.
@param distance
@return
@throws IllegalArgumentException if given distance is larger than distance cutoff
used for calculation of contacts | [
"Returns",
"the",
"list",
"of",
"contacts",
"from",
"this",
"set",
"that",
"are",
"within",
"the",
"given",
"distance",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/AtomContactSet.java#L128-L142 |
31,741 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java | StructureSequenceMatcher.getProteinSequenceForStructure | public static ProteinSequence getProteinSequenceForStructure(Structure struct, Map<Integer,Group> groupIndexPosition ) {
if( groupIndexPosition != null) {
groupIndexPosition.clear();
}
StringBuilder seqStr = new StringBuilder();
for(Chain chain : struct.getChains()) {
List<Group> groups = chain.getAtom... | java | public static ProteinSequence getProteinSequenceForStructure(Structure struct, Map<Integer,Group> groupIndexPosition ) {
if( groupIndexPosition != null) {
groupIndexPosition.clear();
}
StringBuilder seqStr = new StringBuilder();
for(Chain chain : struct.getChains()) {
List<Group> groups = chain.getAtom... | [
"public",
"static",
"ProteinSequence",
"getProteinSequenceForStructure",
"(",
"Structure",
"struct",
",",
"Map",
"<",
"Integer",
",",
"Group",
">",
"groupIndexPosition",
")",
"{",
"if",
"(",
"groupIndexPosition",
"!=",
"null",
")",
"{",
"groupIndexPosition",
".",
... | Generates a ProteinSequence corresponding to the sequence of struct,
and maintains a mapping from the sequence back to the original groups.
Chains are appended to one another. 'X' is used for heteroatoms.
@param struct Input structure
@param groupIndexPosition An empty map, which will be populated with
(residue index... | [
"Generates",
"a",
"ProteinSequence",
"corresponding",
"to",
"the",
"sequence",
"of",
"struct",
"and",
"maintains",
"a",
"mapping",
"from",
"the",
"sequence",
"back",
"to",
"the",
"original",
"groups",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java#L112-L147 |
31,742 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java | StructureSequenceMatcher.matchSequenceToStructure | public static ResidueNumber[] matchSequenceToStructure(ProteinSequence seq, Structure struct) {
//1. Create ProteinSequence for struct while remembering to which group each residue corresponds
Map<Integer,Group> atomIndexPosition = new HashMap<Integer, Group>();
ProteinSequence structSeq = getProteinSequenceF... | java | public static ResidueNumber[] matchSequenceToStructure(ProteinSequence seq, Structure struct) {
//1. Create ProteinSequence for struct while remembering to which group each residue corresponds
Map<Integer,Group> atomIndexPosition = new HashMap<Integer, Group>();
ProteinSequence structSeq = getProteinSequenceF... | [
"public",
"static",
"ResidueNumber",
"[",
"]",
"matchSequenceToStructure",
"(",
"ProteinSequence",
"seq",
",",
"Structure",
"struct",
")",
"{",
"//1. Create ProteinSequence for struct while remembering to which group each residue corresponds",
"Map",
"<",
"Integer",
",",
"Group... | Given a sequence and the corresponding Structure, get the ResidueNumber
for each residue in the sequence.
<p>Smith-Waterman alignment is used to match the sequences. Residues
in the sequence but not the structure or mismatched between sequence
and structure will have a null atom, while
residues in the structure but no... | [
"Given",
"a",
"sequence",
"and",
"the",
"corresponding",
"Structure",
"get",
"the",
"ResidueNumber",
"for",
"each",
"residue",
"in",
"the",
"sequence",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java#L163-L229 |
31,743 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java | StructureSequenceMatcher.removeGaps | public static <T> T[][] removeGaps(final T[][] gapped) {
if(gapped == null ) return null;
if(gapped.length < 1) return Arrays.copyOf(gapped, gapped.length);
final int nProts = gapped.length;
final int protLen = gapped[0].length; // length of gapped proteins
// Verify that input is rectangular
for(int i=0;... | java | public static <T> T[][] removeGaps(final T[][] gapped) {
if(gapped == null ) return null;
if(gapped.length < 1) return Arrays.copyOf(gapped, gapped.length);
final int nProts = gapped.length;
final int protLen = gapped[0].length; // length of gapped proteins
// Verify that input is rectangular
for(int i=0;... | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"[",
"]",
"removeGaps",
"(",
"final",
"T",
"[",
"]",
"[",
"]",
"gapped",
")",
"{",
"if",
"(",
"gapped",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"gapped",
".",
"length",
"<",
"1",
... | Creates a new list consisting of all columns of gapped where no row
contained a null value.
Here, "row" refers to the first index and "column" to the second, eg
gapped.get(row).get(column)
@param gapped A rectangular matrix containing null to mark gaps
@return A new List without columns containing nulls | [
"Creates",
"a",
"new",
"list",
"consisting",
"of",
"all",
"columns",
"of",
"gapped",
"where",
"no",
"row",
"contained",
"a",
"null",
"value",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java#L283-L330 |
31,744 | biojava/biojava | biojava-structure/src/main/java/demo/DemoSCOP.java | DemoSCOP.traverseHierarchy | public void traverseHierarchy()
{
String pdbId = "4HHB";
// download SCOP if required and load into memory
ScopDatabase scop = ScopFactory.getSCOP();
List<ScopDomain> domains = scop.getDomainsForPDB(pdbId);
// show the hierachy for the first domain:
ScopNode node = scop.getScopNode(domains.get(0).getSun... | java | public void traverseHierarchy()
{
String pdbId = "4HHB";
// download SCOP if required and load into memory
ScopDatabase scop = ScopFactory.getSCOP();
List<ScopDomain> domains = scop.getDomainsForPDB(pdbId);
// show the hierachy for the first domain:
ScopNode node = scop.getScopNode(domains.get(0).getSun... | [
"public",
"void",
"traverseHierarchy",
"(",
")",
"{",
"String",
"pdbId",
"=",
"\"4HHB\"",
";",
"// download SCOP if required and load into memory",
"ScopDatabase",
"scop",
"=",
"ScopFactory",
".",
"getSCOP",
"(",
")",
";",
"List",
"<",
"ScopDomain",
">",
"domains",
... | Traverse throught the SCOP hierarchy | [
"Traverse",
"throught",
"the",
"SCOP",
"hierarchy"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/demo/DemoSCOP.java#L72-L91 |
31,745 | biojava/biojava | biojava-structure/src/main/java/demo/DemoSCOP.java | DemoSCOP.getCategories | public void getCategories(){
// download SCOP if required and load into memory
ScopDatabase scop = ScopFactory.getSCOP();
List<ScopDescription> superfams = scop.getByCategory(ScopCategory.Superfamily);
System.out.println("Total nr. of superfamilies:" + superfams.size());
List<ScopDescription> folds = scop.g... | java | public void getCategories(){
// download SCOP if required and load into memory
ScopDatabase scop = ScopFactory.getSCOP();
List<ScopDescription> superfams = scop.getByCategory(ScopCategory.Superfamily);
System.out.println("Total nr. of superfamilies:" + superfams.size());
List<ScopDescription> folds = scop.g... | [
"public",
"void",
"getCategories",
"(",
")",
"{",
"// download SCOP if required and load into memory",
"ScopDatabase",
"scop",
"=",
"ScopFactory",
".",
"getSCOP",
"(",
")",
";",
"List",
"<",
"ScopDescription",
">",
"superfams",
"=",
"scop",
".",
"getByCategory",
"("... | Get various categories | [
"Get",
"various",
"categories"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/demo/DemoSCOP.java#L96-L106 |
31,746 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderFormat.java | GenericGenbankHeaderFormat._write_the_first_line | private String _write_the_first_line(S sequence) {
/*
* locus = record.name if not locus or locus == "<unknown name>": locus
* = record.id if not locus or locus == "<unknown id>": locus =
* self._get_annotation_str(record, "accession", just_first=True)\
*/
String locus;
try {
locus = sequence.getAc... | java | private String _write_the_first_line(S sequence) {
/*
* locus = record.name if not locus or locus == "<unknown name>": locus
* = record.id if not locus or locus == "<unknown id>": locus =
* self._get_annotation_str(record, "accession", just_first=True)\
*/
String locus;
try {
locus = sequence.getAc... | [
"private",
"String",
"_write_the_first_line",
"(",
"S",
"sequence",
")",
"{",
"/*\n\t\t * locus = record.name if not locus or locus == \"<unknown name>\": locus\n\t\t * = record.id if not locus or locus == \"<unknown id>\": locus =\n\t\t * self._get_annotation_str(record, \"accession\", just_first=T... | Write the LOCUS line.
@param sequence
@param seqType | [
"Write",
"the",
"LOCUS",
"line",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderFormat.java#L155-L237 |
31,747 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/ChemComp.java | ChemComp.getEmptyChemComp | public static ChemComp getEmptyChemComp(){
ChemComp comp = new ChemComp();
comp.setOne_letter_code("?");
comp.setThree_letter_code("???"); // Main signal for isEmpty()
comp.setPolymerType(PolymerType.unknown);
comp.setResidueType(ResidueType.atomn);
return comp;
} | java | public static ChemComp getEmptyChemComp(){
ChemComp comp = new ChemComp();
comp.setOne_letter_code("?");
comp.setThree_letter_code("???"); // Main signal for isEmpty()
comp.setPolymerType(PolymerType.unknown);
comp.setResidueType(ResidueType.atomn);
return comp;
} | [
"public",
"static",
"ChemComp",
"getEmptyChemComp",
"(",
")",
"{",
"ChemComp",
"comp",
"=",
"new",
"ChemComp",
"(",
")",
";",
"comp",
".",
"setOne_letter_code",
"(",
"\"?\"",
")",
";",
"comp",
".",
"setThree_letter_code",
"(",
"\"???\"",
")",
";",
"// Main s... | Creates a new instance of the dummy empty ChemComp.
@return | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"dummy",
"empty",
"ChemComp",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/ChemComp.java#L599-L607 |
31,748 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ZipChemCompProvider.java | ZipChemCompProvider.initializeZip | private void initializeZip() throws IOException {
s_logger.info("Using chemical component dictionary: " + m_zipFile.toString());
final File f = m_zipFile.toFile();
if (!f.exists()) {
s_logger.info("Creating missing zip archive: " + m_zipFile.toString());
FileOutputStream fo = new FileOutputStream(f);
Zip... | java | private void initializeZip() throws IOException {
s_logger.info("Using chemical component dictionary: " + m_zipFile.toString());
final File f = m_zipFile.toFile();
if (!f.exists()) {
s_logger.info("Creating missing zip archive: " + m_zipFile.toString());
FileOutputStream fo = new FileOutputStream(f);
Zip... | [
"private",
"void",
"initializeZip",
"(",
")",
"throws",
"IOException",
"{",
"s_logger",
".",
"info",
"(",
"\"Using chemical component dictionary: \"",
"+",
"m_zipFile",
".",
"toString",
"(",
")",
")",
";",
"final",
"File",
"f",
"=",
"m_zipFile",
".",
"toFile",
... | ZipFileSystems - due to URI issues in Java7. | [
"ZipFileSystems",
"-",
"due",
"to",
"URI",
"issues",
"in",
"Java7",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ZipChemCompProvider.java#L101-L115 |
31,749 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ZipChemCompProvider.java | ZipChemCompProvider.downloadAndAdd | private ChemComp downloadAndAdd(String recordName){
final ChemComp cc = m_dlProvider.getChemComp(recordName);
// final File [] files = finder(m_tempDir.resolve("chemcomp").toString(), "cif.gz");
final File [] files = new File[1];
Path cif = m_tempDir.resolve("chemcomp").resolve(recordName + ".cif.gz");
files... | java | private ChemComp downloadAndAdd(String recordName){
final ChemComp cc = m_dlProvider.getChemComp(recordName);
// final File [] files = finder(m_tempDir.resolve("chemcomp").toString(), "cif.gz");
final File [] files = new File[1];
Path cif = m_tempDir.resolve("chemcomp").resolve(recordName + ".cif.gz");
files... | [
"private",
"ChemComp",
"downloadAndAdd",
"(",
"String",
"recordName",
")",
"{",
"final",
"ChemComp",
"cc",
"=",
"m_dlProvider",
".",
"getChemComp",
"(",
"recordName",
")",
";",
"// final File [] files = finder(m_tempDir.resolve(\"chemcomp\").toString(), \"cif.gz\");",
"final"... | Use DownloadChemCompProvider to grab a gzipped cif record from the PDB.
Zip all downloaded cif.gz files into the dictionary.
@param recordName is the three-letter chemical component code (i.e. residue name).
@return ChemComp matching recordName | [
"Use",
"DownloadChemCompProvider",
"to",
"grab",
"a",
"gzipped",
"cif",
"record",
"from",
"the",
"PDB",
".",
"Zip",
"all",
"downloaded",
"cif",
".",
"gz",
"files",
"into",
"the",
"dictionary",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ZipChemCompProvider.java#L163-L175 |
31,750 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ZipChemCompProvider.java | ZipChemCompProvider.getEmptyChemComp | private ChemComp getEmptyChemComp(String resName){
String pdbName = ""; // Empty string is default
if (null != resName && resName.length() >= 3) {
pdbName = resName.substring(0,3);
}
final ChemComp comp = new ChemComp();
comp.setOne_letter_code("?");
comp.setThree_letter_code(pdbName);
comp.setPolymerT... | java | private ChemComp getEmptyChemComp(String resName){
String pdbName = ""; // Empty string is default
if (null != resName && resName.length() >= 3) {
pdbName = resName.substring(0,3);
}
final ChemComp comp = new ChemComp();
comp.setOne_letter_code("?");
comp.setThree_letter_code(pdbName);
comp.setPolymerT... | [
"private",
"ChemComp",
"getEmptyChemComp",
"(",
"String",
"resName",
")",
"{",
"String",
"pdbName",
"=",
"\"\"",
";",
"// Empty string is default",
"if",
"(",
"null",
"!=",
"resName",
"&&",
"resName",
".",
"length",
"(",
")",
">=",
"3",
")",
"{",
"pdbName",
... | Return an empty ChemComp group for a three-letter resName.
@param resName
@return | [
"Return",
"an",
"empty",
"ChemComp",
"group",
"for",
"a",
"three",
"-",
"letter",
"resName",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ZipChemCompProvider.java#L196-L207 |
31,751 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java | SimpleAlignedSequence.countCompounds | @Override
public int countCompounds(C... compounds) {
int count = 0;
List<C> search = Arrays.asList(compounds);
for (C compound : getAsList()) {
if (search.contains(compound)) {
count++;
}
}
return count;
} | java | @Override
public int countCompounds(C... compounds) {
int count = 0;
List<C> search = Arrays.asList(compounds);
for (C compound : getAsList()) {
if (search.contains(compound)) {
count++;
}
}
return count;
} | [
"@",
"Override",
"public",
"int",
"countCompounds",
"(",
"C",
"...",
"compounds",
")",
"{",
"int",
"count",
"=",
"0",
";",
"List",
"<",
"C",
">",
"search",
"=",
"Arrays",
".",
"asList",
"(",
"compounds",
")",
";",
"for",
"(",
"C",
"compound",
":",
... | methods for Sequence | [
"methods",
"for",
"Sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java#L269-L279 |
31,752 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java | SimpleAlignedSequence.setLocation | private void setLocation(List<Step> steps) {
List<Location> sublocations = new ArrayList<Location>();
int start = 0, step = 0, oStep = numBefore+numAfter, oMax = this.original.getLength(), pStep = 0, pMax =
(prev == null) ? 0 : prev.getLength();
boolean inGap = true;
// build sublocations: pieces of sequen... | java | private void setLocation(List<Step> steps) {
List<Location> sublocations = new ArrayList<Location>();
int start = 0, step = 0, oStep = numBefore+numAfter, oMax = this.original.getLength(), pStep = 0, pMax =
(prev == null) ? 0 : prev.getLength();
boolean inGap = true;
// build sublocations: pieces of sequen... | [
"private",
"void",
"setLocation",
"(",
"List",
"<",
"Step",
">",
"steps",
")",
"{",
"List",
"<",
"Location",
">",
"sublocations",
"=",
"new",
"ArrayList",
"<",
"Location",
">",
"(",
")",
";",
"int",
"start",
"=",
"0",
",",
"step",
"=",
"0",
",",
"o... | helper method to initialize the location | [
"helper",
"method",
"to",
"initialize",
"the",
"location"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java#L384-L428 |
31,753 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/StructureAlignmentDisplay.java | StructureAlignmentDisplay.display | public static StructureAlignmentJmol display(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException {
if ( ca1.length < 1 || ca2.length < 1){
throw new StructureException("length of atoms arrays is too short! " + ca1.length + "," + ca2.length);
}
Group[] twistedGroups = AlignmentTools.prepareGr... | java | public static StructureAlignmentJmol display(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException {
if ( ca1.length < 1 || ca2.length < 1){
throw new StructureException("length of atoms arrays is too short! " + ca1.length + "," + ca2.length);
}
Group[] twistedGroups = AlignmentTools.prepareGr... | [
"public",
"static",
"StructureAlignmentJmol",
"display",
"(",
"AFPChain",
"afpChain",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"ca1",
".",
"length",
"<",
"1",
"||",
"ca2",
".",
"leng... | Display an AFPChain alignment
@param afpChain
@param ca1
@param ca2
@return a StructureAlignmentJmol instance
@throws StructureException | [
"Display",
"an",
"AFPChain",
"alignment"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/StructureAlignmentDisplay.java#L43-L56 |
31,754 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsChainToUniprotMapping.java | SiftsChainToUniprotMapping.load | public static SiftsChainToUniprotMapping load(boolean useOnlyLocal) throws IOException {
UserConfiguration config = new UserConfiguration();
File cacheDir = new File(config.getCacheFilePath());
DEFAULT_FILE = new File(cacheDir, DEFAULT_FILENAME);
if (!DEFAULT_FILE.exists() || DEFAULT_FILE.length() == 0) {
... | java | public static SiftsChainToUniprotMapping load(boolean useOnlyLocal) throws IOException {
UserConfiguration config = new UserConfiguration();
File cacheDir = new File(config.getCacheFilePath());
DEFAULT_FILE = new File(cacheDir, DEFAULT_FILENAME);
if (!DEFAULT_FILE.exists() || DEFAULT_FILE.length() == 0) {
... | [
"public",
"static",
"SiftsChainToUniprotMapping",
"load",
"(",
"boolean",
"useOnlyLocal",
")",
"throws",
"IOException",
"{",
"UserConfiguration",
"config",
"=",
"new",
"UserConfiguration",
"(",
")",
";",
"File",
"cacheDir",
"=",
"new",
"File",
"(",
"config",
".",
... | Loads the SIFTS mapping.
Attempts to load the mapping file in the PDB cache directory.
If the file does not exist or could not be parsed, downloads and stores a GZ-compressed file.
@param useOnlyLocal If true, will throw an IOException if the file needs to be downloaded
@return
@throws IOException If the local file cou... | [
"Loads",
"the",
"SIFTS",
"mapping",
".",
"Attempts",
"to",
"load",
"the",
"mapping",
"file",
"in",
"the",
"PDB",
"cache",
"directory",
".",
"If",
"the",
"file",
"does",
"not",
"exist",
"or",
"could",
"not",
"be",
"parsed",
"downloads",
"and",
"stores",
"... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsChainToUniprotMapping.java#L94-L114 |
31,755 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java | SparseVector.get | public double get(int i) {
if (i < 0 || i >= N) throw new IllegalArgumentException("Illegal index " + i + " should be > 0 and < " + N);
if (symbolTable.contains(i)) return symbolTable.get(i);
else return 0.0;
} | java | public double get(int i) {
if (i < 0 || i >= N) throw new IllegalArgumentException("Illegal index " + i + " should be > 0 and < " + N);
if (symbolTable.contains(i)) return symbolTable.get(i);
else return 0.0;
} | [
"public",
"double",
"get",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"i",
"<",
"0",
"||",
"i",
">=",
"N",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Illegal index \"",
"+",
"i",
"+",
"\" should be > 0 and < \"",
"+",
"N",
")",
";",
"if",
"(",... | get a value
@param i
@return return symbolTable[i] | [
"get",
"a",
"value"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java#L76-L80 |
31,756 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java | SparseVector.dot | public double dot(SparseVector b) {
SparseVector a = this;
if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree. " + a.N + " != " + b.N);
double sum = 0.0;
// iterate over the vector with the fewest nonzeros
if (a.symbolTable.size() <= b.symbolTable.size()) {
for (int i : a.symbolTa... | java | public double dot(SparseVector b) {
SparseVector a = this;
if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree. " + a.N + " != " + b.N);
double sum = 0.0;
// iterate over the vector with the fewest nonzeros
if (a.symbolTable.size() <= b.symbolTable.size()) {
for (int i : a.symbolTa... | [
"public",
"double",
"dot",
"(",
"SparseVector",
"b",
")",
"{",
"SparseVector",
"a",
"=",
"this",
";",
"if",
"(",
"a",
".",
"N",
"!=",
"b",
".",
"N",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Vector lengths disagree. \"",
"+",
"a",
".",
"N"... | Calculates the dot product of this vector a with b
@param b
@return | [
"Calculates",
"the",
"dot",
"product",
"of",
"this",
"vector",
"a",
"with",
"b"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java#L97-L112 |
31,757 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java | SparseVector.plus | public SparseVector plus(SparseVector b) {
SparseVector a = this;
if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree : " + a.N + " != " + b.N);
SparseVector c = new SparseVector(N);
for (int i : a.symbolTable) c.put(i, a.get(i)); // c = a
for (int i : b.symbolTable) c.p... | java | public SparseVector plus(SparseVector b) {
SparseVector a = this;
if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree : " + a.N + " != " + b.N);
SparseVector c = new SparseVector(N);
for (int i : a.symbolTable) c.put(i, a.get(i)); // c = a
for (int i : b.symbolTable) c.p... | [
"public",
"SparseVector",
"plus",
"(",
"SparseVector",
"b",
")",
"{",
"SparseVector",
"a",
"=",
"this",
";",
"if",
"(",
"a",
".",
"N",
"!=",
"b",
".",
"N",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Vector lengths disagree : \"",
"+",
"a",
".... | Calcualtes return a + b
@param b
@return | [
"Calcualtes",
"return",
"a",
"+",
"b"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java#L140-L147 |
31,758 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.location | public static Location location(List<Location> subLocations, String type) {
if (subLocations.size() == 1) {
return subLocations.get(0);
}
boolean circular = detectCicular(subLocations);
Strand strand = detectStrand(subLocations);
Point start = detectStart(subLocations);
Point end = detectEnd(subLocation... | java | public static Location location(List<Location> subLocations, String type) {
if (subLocations.size() == 1) {
return subLocations.get(0);
}
boolean circular = detectCicular(subLocations);
Strand strand = detectStrand(subLocations);
Point start = detectStart(subLocations);
Point end = detectEnd(subLocation... | [
"public",
"static",
"Location",
"location",
"(",
"List",
"<",
"Location",
">",
"subLocations",
",",
"String",
"type",
")",
"{",
"if",
"(",
"subLocations",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"return",
"subLocations",
".",
"get",
"(",
"0",
")",
... | Builds a location from a List of locations; this can be circular or
linear joins. The code expects that these locations are in
a sensible format.
@param subLocations The list of locations to use to build the location.
If given a list of size 1 we will return that location.
@param type The type of join for this locatio... | [
"Builds",
"a",
"location",
"from",
"a",
"List",
"of",
"locations",
";",
"this",
"can",
"be",
"circular",
"or",
"linear",
"joins",
".",
"The",
"code",
"expects",
"that",
"these",
"locations",
"are",
"in",
"a",
"sensible",
"format",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L60-L90 |
31,759 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.location | public static Location location(int start, int end, Strand strand, int length) {
int min = Math.min(start, end);
//if this is true then we have a coord on the +ve strand even though Strand could be negative
boolean isReverse = (min != start);
if (isReverse) {
return new SimpleLocation(
new SimplePoint(s... | java | public static Location location(int start, int end, Strand strand, int length) {
int min = Math.min(start, end);
//if this is true then we have a coord on the +ve strand even though Strand could be negative
boolean isReverse = (min != start);
if (isReverse) {
return new SimpleLocation(
new SimplePoint(s... | [
"public",
"static",
"Location",
"location",
"(",
"int",
"start",
",",
"int",
"end",
",",
"Strand",
"strand",
",",
"int",
"length",
")",
"{",
"int",
"min",
"=",
"Math",
".",
"min",
"(",
"start",
",",
"end",
")",
";",
"//if this is true then we have a coord ... | Returns a location object which unlike the location constructors
allows you to input reverse coordinates and will convert
these into the right location on the positive strand. | [
"Returns",
"a",
"location",
"object",
"which",
"unlike",
"the",
"location",
"constructors",
"allows",
"you",
"to",
"input",
"reverse",
"coordinates",
"and",
"will",
"convert",
"these",
"into",
"the",
"right",
"location",
"on",
"the",
"positive",
"strand",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L97-L108 |
31,760 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.circularLocation | public static Location circularLocation(int start, int end, Strand strand, int length) {
int min = Math.min(start, end);
int max = Math.max(start, end);
//Tells us we're dealing with something that's not _right_
boolean isReverse = (min != start);
if (min > length) {
throw new IllegalArgumentException("C... | java | public static Location circularLocation(int start, int end, Strand strand, int length) {
int min = Math.min(start, end);
int max = Math.max(start, end);
//Tells us we're dealing with something that's not _right_
boolean isReverse = (min != start);
if (min > length) {
throw new IllegalArgumentException("C... | [
"public",
"static",
"Location",
"circularLocation",
"(",
"int",
"start",
",",
"int",
"end",
",",
"Strand",
"strand",
",",
"int",
"length",
")",
"{",
"int",
"min",
"=",
"Math",
".",
"min",
"(",
"start",
",",
"end",
")",
";",
"int",
"max",
"=",
"Math",... | Converts a location which defines the outer bounds of a circular
location and splits it into the required portions. Unlike any
other location builder this allows you to express your input
location on the reverse strand
@param location The location which currently expresses the outer
bounds of a circular location.
@par... | [
"Converts",
"a",
"location",
"which",
"defines",
"the",
"outer",
"bounds",
"of",
"a",
"circular",
"location",
"and",
"splits",
"it",
"into",
"the",
"required",
"portions",
".",
"Unlike",
"any",
"other",
"location",
"builder",
"this",
"allows",
"you",
"to",
"... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L123-L164 |
31,761 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.getMin | public static Location getMin(List<Location> locations) {
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getStart().compareTo(previous.getStart());
return res < 0;
}
});
} | java | public static Location getMin(List<Location> locations) {
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getStart().compareTo(previous.getStart());
return res < 0;
}
});
} | [
"public",
"static",
"Location",
"getMin",
"(",
"List",
"<",
"Location",
">",
"locations",
")",
"{",
"return",
"scanLocations",
"(",
"locations",
",",
"new",
"LocationPredicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"Location",
... | Scans through a list of locations to find the Location with the
lowest start | [
"Scans",
"through",
"a",
"list",
"of",
"locations",
"to",
"find",
"the",
"Location",
"with",
"the",
"lowest",
"start"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L174-L182 |
31,762 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.getMax | public static Location getMax(List<Location> locations) {
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getEnd().compareTo(previous.getEnd());
return res > 0;
}
});
} | java | public static Location getMax(List<Location> locations) {
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getEnd().compareTo(previous.getEnd());
return res > 0;
}
});
} | [
"public",
"static",
"Location",
"getMax",
"(",
"List",
"<",
"Location",
">",
"locations",
")",
"{",
"return",
"scanLocations",
"(",
"locations",
",",
"new",
"LocationPredicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"Location",
... | Scans through a list of locations to find the Location with the
highest end | [
"Scans",
"through",
"a",
"list",
"of",
"locations",
"to",
"find",
"the",
"Location",
"with",
"the",
"highest",
"end"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L188-L196 |
31,763 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.scanLocations | private static Location scanLocations(List<Location> locations, LocationPredicate predicate) {
Location location = null;
for (Location l : locations) {
if (location == null) {
location = l;
}
else {
if (predicate.accept(location, l)) {
location = l;
}
}
}
return location;
} | java | private static Location scanLocations(List<Location> locations, LocationPredicate predicate) {
Location location = null;
for (Location l : locations) {
if (location == null) {
location = l;
}
else {
if (predicate.accept(location, l)) {
location = l;
}
}
}
return location;
} | [
"private",
"static",
"Location",
"scanLocations",
"(",
"List",
"<",
"Location",
">",
"locations",
",",
"LocationPredicate",
"predicate",
")",
"{",
"Location",
"location",
"=",
"null",
";",
"for",
"(",
"Location",
"l",
":",
"locations",
")",
"{",
"if",
"(",
... | Used for scanning through a list of locations; assumes the
locations given will have at least one value otherwise
we will get a null pointer | [
"Used",
"for",
"scanning",
"through",
"a",
"list",
"of",
"locations",
";",
"assumes",
"the",
"locations",
"given",
"will",
"have",
"at",
"least",
"one",
"value",
"otherwise",
"we",
"will",
"get",
"a",
"null",
"pointer"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L203-L216 |
31,764 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.modulateCircularIndex | public static int modulateCircularIndex(int index, int seqLength) {
// Dummy case
if (seqLength == 0) {
return index;
}
// Modulate
while (index > seqLength) {
index -= seqLength;
}
return index;
} | java | public static int modulateCircularIndex(int index, int seqLength) {
// Dummy case
if (seqLength == 0) {
return index;
}
// Modulate
while (index > seqLength) {
index -= seqLength;
}
return index;
} | [
"public",
"static",
"int",
"modulateCircularIndex",
"(",
"int",
"index",
",",
"int",
"seqLength",
")",
"{",
"// Dummy case",
"if",
"(",
"seqLength",
"==",
"0",
")",
"{",
"return",
"index",
";",
"}",
"// Modulate",
"while",
"(",
"index",
">",
"seqLength",
"... | Takes a point on a circular location and moves it left until it falls
at the earliest possible point that represents the same base.
@param index Index of the position to work with
@param seqLength Length of the Sequence
@return The shifted point | [
"Takes",
"a",
"point",
"on",
"a",
"circular",
"location",
"and",
"moves",
"it",
"left",
"until",
"it",
"falls",
"at",
"the",
"earliest",
"possible",
"point",
"that",
"represents",
"the",
"same",
"base",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L226-L236 |
31,765 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.completeCircularPasses | public static int completeCircularPasses(int index, int seqLength) {
int count = 0;
while (index > seqLength) {
count++;
index -= seqLength;
}
return count - 1;
} | java | public static int completeCircularPasses(int index, int seqLength) {
int count = 0;
while (index > seqLength) {
count++;
index -= seqLength;
}
return count - 1;
} | [
"public",
"static",
"int",
"completeCircularPasses",
"(",
"int",
"index",
",",
"int",
"seqLength",
")",
"{",
"int",
"count",
"=",
"0",
";",
"while",
"(",
"index",
">",
"seqLength",
")",
"{",
"count",
"++",
";",
"index",
"-=",
"seqLength",
";",
"}",
"re... | Works in a similar way to modulateCircularLocation but returns
the number of complete passes over a Sequence length a circular
location makes i.e. if we have a sequence of length 10 and the
location 3..52 we make 4 complete passes through the genome to
go from position 3 to position 52. | [
"Works",
"in",
"a",
"similar",
"way",
"to",
"modulateCircularLocation",
"but",
"returns",
"the",
"number",
"of",
"complete",
"passes",
"over",
"a",
"Sequence",
"length",
"a",
"circular",
"location",
"makes",
"i",
".",
"e",
".",
"if",
"we",
"have",
"a",
"se... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L245-L252 |
31,766 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.detectCicular | public static boolean detectCicular(List<Location> subLocations) {
boolean isCircular = false;
if(! consistentAccessions(subLocations))
return isCircular;
int lastMax = 0;
for (Location sub : subLocations) {
if (sub.getEnd().getPosition() > lastMax) {
lastMax = sub.getEnd().getPosition();
}
els... | java | public static boolean detectCicular(List<Location> subLocations) {
boolean isCircular = false;
if(! consistentAccessions(subLocations))
return isCircular;
int lastMax = 0;
for (Location sub : subLocations) {
if (sub.getEnd().getPosition() > lastMax) {
lastMax = sub.getEnd().getPosition();
}
els... | [
"public",
"static",
"boolean",
"detectCicular",
"(",
"List",
"<",
"Location",
">",
"subLocations",
")",
"{",
"boolean",
"isCircular",
"=",
"false",
";",
"if",
"(",
"!",
"consistentAccessions",
"(",
"subLocations",
")",
")",
"return",
"isCircular",
";",
"int",
... | Loops through the given list of locations and returns true if it looks
like they represent a circular location. Detection cannot happen if
we do not have consistent accessions | [
"Loops",
"through",
"the",
"given",
"list",
"of",
"locations",
"and",
"returns",
"true",
"if",
"it",
"looks",
"like",
"they",
"represent",
"a",
"circular",
"location",
".",
"Detection",
"cannot",
"happen",
"if",
"we",
"do",
"not",
"have",
"consistent",
"acce... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L259-L275 |
31,767 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.consistentAccessions | public static boolean consistentAccessions(List<Location> subLocations) {
Set<AccessionID> set = new HashSet<AccessionID>();
for(Location sub: subLocations) {
set.add(sub.getAccession());
}
return set.size() == 1;
} | java | public static boolean consistentAccessions(List<Location> subLocations) {
Set<AccessionID> set = new HashSet<AccessionID>();
for(Location sub: subLocations) {
set.add(sub.getAccession());
}
return set.size() == 1;
} | [
"public",
"static",
"boolean",
"consistentAccessions",
"(",
"List",
"<",
"Location",
">",
"subLocations",
")",
"{",
"Set",
"<",
"AccessionID",
">",
"set",
"=",
"new",
"HashSet",
"<",
"AccessionID",
">",
"(",
")",
";",
"for",
"(",
"Location",
"sub",
":",
... | Scans a list of locations and returns true if all the given locations
are linked to the same sequence. A list of null accessioned locations
is the same as a list where the accession is the same
@param subLocations The locations to scan
@return Returns a boolean indicating if this is consistently accessioned | [
"Scans",
"a",
"list",
"of",
"locations",
"and",
"returns",
"true",
"if",
"all",
"the",
"given",
"locations",
"are",
"linked",
"to",
"the",
"same",
"sequence",
".",
"A",
"list",
"of",
"null",
"accessioned",
"locations",
"is",
"the",
"same",
"as",
"a",
"li... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L285-L291 |
31,768 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.detectStrand | public static Strand detectStrand(List<Location> subLocations) {
Strand strand = subLocations.get(0).getStrand();
for (Location sub : subLocations) {
if (strand != sub.getStrand()) {
strand = Strand.UNDEFINED;
break;
}
}
return strand;
} | java | public static Strand detectStrand(List<Location> subLocations) {
Strand strand = subLocations.get(0).getStrand();
for (Location sub : subLocations) {
if (strand != sub.getStrand()) {
strand = Strand.UNDEFINED;
break;
}
}
return strand;
} | [
"public",
"static",
"Strand",
"detectStrand",
"(",
"List",
"<",
"Location",
">",
"subLocations",
")",
"{",
"Strand",
"strand",
"=",
"subLocations",
".",
"get",
"(",
"0",
")",
".",
"getStrand",
"(",
")",
";",
"for",
"(",
"Location",
"sub",
":",
"subLocati... | Loops through the given list of locations and returns the consensus
Strand class. If the class switches then we will return an undefined
strand | [
"Loops",
"through",
"the",
"given",
"list",
"of",
"locations",
"and",
"returns",
"the",
"consensus",
"Strand",
"class",
".",
"If",
"the",
"class",
"switches",
"then",
"we",
"will",
"return",
"an",
"undefined",
"strand"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L298-L307 |
31,769 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.detectEnd | public static Point detectEnd(List<Location> subLocations, boolean isCircular) {
int end = 0;
Point lastPoint = null;
if(isCircular) {
for (Location sub : subLocations) {
lastPoint = sub.getEnd();
end += lastPoint.getPosition();
}
}
else {
lastPoint = subLocations.get(subLocations.size()-1).g... | java | public static Point detectEnd(List<Location> subLocations, boolean isCircular) {
int end = 0;
Point lastPoint = null;
if(isCircular) {
for (Location sub : subLocations) {
lastPoint = sub.getEnd();
end += lastPoint.getPosition();
}
}
else {
lastPoint = subLocations.get(subLocations.size()-1).g... | [
"public",
"static",
"Point",
"detectEnd",
"(",
"List",
"<",
"Location",
">",
"subLocations",
",",
"boolean",
"isCircular",
")",
"{",
"int",
"end",
"=",
"0",
";",
"Point",
"lastPoint",
"=",
"null",
";",
"if",
"(",
"isCircular",
")",
"{",
"for",
"(",
"Lo... | This will attempt to find what the last point is and returns that
position. If the location is circular this will return the total length
of the location and does not mean the maximum point on the Sequence
we may find the locations on | [
"This",
"will",
"attempt",
"to",
"find",
"what",
"the",
"last",
"point",
"is",
"and",
"returns",
"that",
"position",
".",
"If",
"the",
"location",
"is",
"circular",
"this",
"will",
"return",
"the",
"total",
"length",
"of",
"the",
"location",
"and",
"does",... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L322-L336 |
31,770 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleSequencePair.java | SimpleSequencePair.getPercentageOfIdentity | @Override
public double getPercentageOfIdentity(boolean countGaps) {
double seqid = getNumIdenticals();
double length = getLength();
if (!countGaps) {
length = length - getAlignedSequence(1).getNumGapPositions()
- getAlignedSequence(2).getNumGapPositions();
}
return seqid / length;
} | java | @Override
public double getPercentageOfIdentity(boolean countGaps) {
double seqid = getNumIdenticals();
double length = getLength();
if (!countGaps) {
length = length - getAlignedSequence(1).getNumGapPositions()
- getAlignedSequence(2).getNumGapPositions();
}
return seqid / length;
} | [
"@",
"Override",
"public",
"double",
"getPercentageOfIdentity",
"(",
"boolean",
"countGaps",
")",
"{",
"double",
"seqid",
"=",
"getNumIdenticals",
"(",
")",
";",
"double",
"length",
"=",
"getLength",
"(",
")",
";",
"if",
"(",
"!",
"countGaps",
")",
"{",
"l... | Returns the percentage of identity between the two sequences in the alignment as a fraction between 0 and 1.
@param countGaps
If true, gap positions are counted as mismatches, i.e., the percentage is normalized by the alignment length.
If false, gap positions are not counted, i.e. the percentage is normalized by the n... | [
"Returns",
"the",
"percentage",
"of",
"identity",
"between",
"the",
"two",
"sequences",
"in",
"the",
"alignment",
"as",
"a",
"fraction",
"between",
"0",
"and",
"1",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleSequencePair.java#L219-L228 |
31,771 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setCuts | public static void setCuts(int x, Subproblem subproblem, Last[][] pointers, Cut[]cuts) {
for (Cut c : cuts) {
c.update(x, subproblem, pointers);
}
} | java | public static void setCuts(int x, Subproblem subproblem, Last[][] pointers, Cut[]cuts) {
for (Cut c : cuts) {
c.update(x, subproblem, pointers);
}
} | [
"public",
"static",
"void",
"setCuts",
"(",
"int",
"x",
",",
"Subproblem",
"subproblem",
",",
"Last",
"[",
"]",
"[",
"]",
"pointers",
",",
"Cut",
"[",
"]",
"cuts",
")",
"{",
"for",
"(",
"Cut",
"c",
":",
"cuts",
")",
"{",
"c",
".",
"update",
"(",
... | updates cut rows given the latest row of traceback pointers | [
"updates",
"cut",
"rows",
"given",
"the",
"latest",
"row",
"of",
"traceback",
"pointers"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L298-L302 |
31,772 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setScorePoint | public static Last[] setScorePoint(int x, int y, int gop, int gep, int sub, int[][][] scores) {
Last[] pointers = new Last[3];
// substitution
if (scores[x - 1][y - 1][1] >= scores[x - 1][y - 1][0] && scores[x - 1][y - 1][1] >= scores[x - 1][y - 1][2]) {
scores[x][y][0] = scores[x - 1][y - 1][1] + sub;
poi... | java | public static Last[] setScorePoint(int x, int y, int gop, int gep, int sub, int[][][] scores) {
Last[] pointers = new Last[3];
// substitution
if (scores[x - 1][y - 1][1] >= scores[x - 1][y - 1][0] && scores[x - 1][y - 1][1] >= scores[x - 1][y - 1][2]) {
scores[x][y][0] = scores[x - 1][y - 1][1] + sub;
poi... | [
"public",
"static",
"Last",
"[",
"]",
"setScorePoint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"gop",
",",
"int",
"gep",
",",
"int",
"sub",
",",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"scores",
")",
"{",
"Last",
"[",
"]",
"pointers",
"=",
... | Calculate the optimal alignment score for the given sequence positions with an affine or constant gap penalty
@param x position in query
@param y position in target
@param gop gap opening penalty
@param gep gap extension penalty
@param sub compound match score
@param scores dynamic programming score matrix to fill at t... | [
"Calculate",
"the",
"optimal",
"alignment",
"score",
"for",
"the",
"given",
"sequence",
"positions",
"with",
"an",
"affine",
"or",
"constant",
"gap",
"penalty"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L313-L347 |
31,773 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setScorePoint | public static Last setScorePoint(int x, int y, int gep, int sub, int[][][] scores) {
int d = scores[x - 1][y][0] + gep;
int i = scores[x][y - 1][0] + gep;
int s = scores[x - 1][y - 1][0] + sub;
if (d >= s && d >= i) {
scores[x][y][0] = d;
return Last.DELETION;
} else if (s >= i) {
scores[x][y][0] = s... | java | public static Last setScorePoint(int x, int y, int gep, int sub, int[][][] scores) {
int d = scores[x - 1][y][0] + gep;
int i = scores[x][y - 1][0] + gep;
int s = scores[x - 1][y - 1][0] + sub;
if (d >= s && d >= i) {
scores[x][y][0] = d;
return Last.DELETION;
} else if (s >= i) {
scores[x][y][0] = s... | [
"public",
"static",
"Last",
"setScorePoint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"gep",
",",
"int",
"sub",
",",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"scores",
")",
"{",
"int",
"d",
"=",
"scores",
"[",
"x",
"-",
"1",
"]",
"[",
"y",
... | Calculates the optimal alignment score for the given sequence positions and a linear gap penalty
@param x position in query
@param y position in target
@param gep gap extension penalty
@param sub compound match score
@param scores dynamic programming score matrix to fill at the given position
@return traceback directio... | [
"Calculates",
"the",
"optimal",
"alignment",
"score",
"for",
"the",
"given",
"sequence",
"positions",
"and",
"a",
"linear",
"gap",
"penalty"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L357-L371 |
31,774 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setScoreVector | public static Last[][] setScoreVector(int x, int xb, int yb, int ye, int gep, int[] subs, boolean storing,
int[][][] scores, boolean startAnchored) {
Last[][] pointers = new Last[ye + 1][1];
ensureScoringMatrixColumn(x, storing, scores);
if (x == xb) {
if (startAnchored) {
assert (xb > 0 && yb > 0);
... | java | public static Last[][] setScoreVector(int x, int xb, int yb, int ye, int gep, int[] subs, boolean storing,
int[][][] scores, boolean startAnchored) {
Last[][] pointers = new Last[ye + 1][1];
ensureScoringMatrixColumn(x, storing, scores);
if (x == xb) {
if (startAnchored) {
assert (xb > 0 && yb > 0);
... | [
"public",
"static",
"Last",
"[",
"]",
"[",
"]",
"setScoreVector",
"(",
"int",
"x",
",",
"int",
"xb",
",",
"int",
"yb",
",",
"int",
"ye",
",",
"int",
"gep",
",",
"int",
"[",
"]",
"subs",
",",
"boolean",
"storing",
",",
"int",
"[",
"]",
"[",
"]",... | Score global alignment for a given position in the query sequence for a linear gap penalty
@param x
@param xb
@param yb
@param ye
@param gep
@param subs
@param storing
@param scores
@param startAnchored
@return | [
"Score",
"global",
"alignment",
"for",
"a",
"given",
"position",
"in",
"the",
"query",
"sequence",
"for",
"a",
"linear",
"gap",
"penalty"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L464-L486 |
31,775 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setScoreVector | public static Last[][] setScoreVector(int x, int xb, int yb, int ye, int gop, int gep, int[] subs,
boolean storing, int[][][] scores, int[] xyMax, int score) {
Last[][] pointers;
ensureScoringMatrixColumn(x, storing, scores);
if (x == xb) {
pointers = new Last[ye + 1][scores[0][0].length];
} else {
poi... | java | public static Last[][] setScoreVector(int x, int xb, int yb, int ye, int gop, int gep, int[] subs,
boolean storing, int[][][] scores, int[] xyMax, int score) {
Last[][] pointers;
ensureScoringMatrixColumn(x, storing, scores);
if (x == xb) {
pointers = new Last[ye + 1][scores[0][0].length];
} else {
poi... | [
"public",
"static",
"Last",
"[",
"]",
"[",
"]",
"setScoreVector",
"(",
"int",
"x",
",",
"int",
"xb",
",",
"int",
"yb",
",",
"int",
"ye",
",",
"int",
"gop",
",",
"int",
"gep",
",",
"int",
"[",
"]",
"subs",
",",
"boolean",
"storing",
",",
"int",
... | Score local alignment for a given position in the query sequence
@param x
@param xb
@param yb
@param ye
@param gop
@param gep
@param subs
@param storing
@param scores
@param xyMax
@param score
@return | [
"Score",
"local",
"alignment",
"for",
"a",
"given",
"position",
"in",
"the",
"query",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L520-L545 |
31,776 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setScoreVector | public static Last[][] setScoreVector(int x, int gep, int[] subs, boolean storing, int[][][] scores,
int[] xyMax, int score) {
return setScoreVector(x, 0, 0, scores[0].length - 1, gep, subs, storing, scores, xyMax, score);
} | java | public static Last[][] setScoreVector(int x, int gep, int[] subs, boolean storing, int[][][] scores,
int[] xyMax, int score) {
return setScoreVector(x, 0, 0, scores[0].length - 1, gep, subs, storing, scores, xyMax, score);
} | [
"public",
"static",
"Last",
"[",
"]",
"[",
"]",
"setScoreVector",
"(",
"int",
"x",
",",
"int",
"gep",
",",
"int",
"[",
"]",
"subs",
",",
"boolean",
"storing",
",",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"scores",
",",
"int",
"[",
"]",
"xyMax",
",... | Score local alignment for a given position in the query sequence for a linear gap penalty
@param x
@param gep
@param subs
@param storing
@param scores
@param xyMax
@param score
@return | [
"Score",
"local",
"alignment",
"for",
"a",
"given",
"position",
"in",
"the",
"query",
"sequence",
"for",
"a",
"linear",
"gap",
"penalty"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L558-L561 |
31,777 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setSteps | public static int[] setSteps(Last[][][] traceback, boolean local, int[] xyMax, Last last, List<Step> sx,
List<Step> sy) {
int x = xyMax[0], y = xyMax[1];
boolean linear = (traceback[x][y].length == 1);
while (local ? (linear ? last : traceback[x][y][last.ordinal()]) != null : x > 0 || y > 0) {
switch (last)... | java | public static int[] setSteps(Last[][][] traceback, boolean local, int[] xyMax, Last last, List<Step> sx,
List<Step> sy) {
int x = xyMax[0], y = xyMax[1];
boolean linear = (traceback[x][y].length == 1);
while (local ? (linear ? last : traceback[x][y][last.ordinal()]) != null : x > 0 || y > 0) {
switch (last)... | [
"public",
"static",
"int",
"[",
"]",
"setSteps",
"(",
"Last",
"[",
"]",
"[",
"]",
"[",
"]",
"traceback",
",",
"boolean",
"local",
",",
"int",
"[",
"]",
"xyMax",
",",
"Last",
"last",
",",
"List",
"<",
"Step",
">",
"sx",
",",
"List",
"<",
"Step",
... | Find alignment path through traceback matrix
@param traceback
@param local
@param xyMax
@param last
@param sx
@param sy
@return | [
"Find",
"alignment",
"path",
"through",
"traceback",
"matrix"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L617-L642 |
31,778 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setSteps | public static int[] setSteps(Last[][][] traceback, int[][][] scores, List<Step> sx, List<Step> sy) {
int xMax = scores.length - 1, yMax = scores[xMax].length - 1;
boolean linear = (traceback[xMax][yMax].length == 1);
Last last =
linear ?
traceback[xMax][yMax][0] :
(scores[xMax][yMax][1] > scores[xMa... | java | public static int[] setSteps(Last[][][] traceback, int[][][] scores, List<Step> sx, List<Step> sy) {
int xMax = scores.length - 1, yMax = scores[xMax].length - 1;
boolean linear = (traceback[xMax][yMax].length == 1);
Last last =
linear ?
traceback[xMax][yMax][0] :
(scores[xMax][yMax][1] > scores[xMa... | [
"public",
"static",
"int",
"[",
"]",
"setSteps",
"(",
"Last",
"[",
"]",
"[",
"]",
"[",
"]",
"traceback",
",",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"scores",
",",
"List",
"<",
"Step",
">",
"sx",
",",
"List",
"<",
"Step",
">",
"sy",
")",
"{",
... | Find global alignment path through traceback matrix
@param traceback
@param scores
@param sx
@param sy
@return | [
"Find",
"global",
"alignment",
"path",
"through",
"traceback",
"matrix"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L652-L671 |
31,779 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setSteps | public static int[] setSteps(Last[][][] traceback, int[] xyMax, List<Step> sx, List<Step> sy) {
return setSteps(traceback, true, xyMax, Last.SUBSTITUTION, sx, sy);
} | java | public static int[] setSteps(Last[][][] traceback, int[] xyMax, List<Step> sx, List<Step> sy) {
return setSteps(traceback, true, xyMax, Last.SUBSTITUTION, sx, sy);
} | [
"public",
"static",
"int",
"[",
"]",
"setSteps",
"(",
"Last",
"[",
"]",
"[",
"]",
"[",
"]",
"traceback",
",",
"int",
"[",
"]",
"xyMax",
",",
"List",
"<",
"Step",
">",
"sx",
",",
"List",
"<",
"Step",
">",
"sy",
")",
"{",
"return",
"setSteps",
"(... | Find local alignment path through traceback matrix
@param traceback
@param xyMax
@param sx
@param sy
@return | [
"Find",
"local",
"alignment",
"path",
"through",
"traceback",
"matrix"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L681-L683 |
31,780 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java | Matrices.getRotationJAMA | public static Matrix getRotationJAMA(Matrix4d transform) {
Matrix rot = new Matrix(3, 3);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
rot.set(j, i, transform.getElement(i, j)); // transposed
}
}
return rot;
} | java | public static Matrix getRotationJAMA(Matrix4d transform) {
Matrix rot = new Matrix(3, 3);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
rot.set(j, i, transform.getElement(i, j)); // transposed
}
}
return rot;
} | [
"public",
"static",
"Matrix",
"getRotationJAMA",
"(",
"Matrix4d",
"transform",
")",
"{",
"Matrix",
"rot",
"=",
"new",
"Matrix",
"(",
"3",
",",
"3",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
... | Convert a transformation matrix into a JAMA rotation matrix. Because the
JAMA matrix is a pre-multiplication matrix and the Vecmath matrix is a
post-multiplication one, the rotation matrix is transposed to ensure that
the transformation they produce is the same.
@param transform
Matrix4d with transposed rotation matri... | [
"Convert",
"a",
"transformation",
"matrix",
"into",
"a",
"JAMA",
"rotation",
"matrix",
".",
"Because",
"the",
"JAMA",
"matrix",
"is",
"a",
"pre",
"-",
"multiplication",
"matrix",
"and",
"the",
"Vecmath",
"matrix",
"is",
"a",
"post",
"-",
"multiplication",
"o... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java#L54-L63 |
31,781 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java | Matrices.getRotationMatrix | public static Matrix3d getRotationMatrix(Matrix4d transform) {
Matrix3d rot = new Matrix3d();
transform.setRotationScale(rot);
return rot;
} | java | public static Matrix3d getRotationMatrix(Matrix4d transform) {
Matrix3d rot = new Matrix3d();
transform.setRotationScale(rot);
return rot;
} | [
"public",
"static",
"Matrix3d",
"getRotationMatrix",
"(",
"Matrix4d",
"transform",
")",
"{",
"Matrix3d",
"rot",
"=",
"new",
"Matrix3d",
"(",
")",
";",
"transform",
".",
"setRotationScale",
"(",
"rot",
")",
";",
"return",
"rot",
";",
"}"
] | Convert a transformation matrix into a rotation matrix.
@param transform
Matrix4d
@return rotation matrix | [
"Convert",
"a",
"transformation",
"matrix",
"into",
"a",
"rotation",
"matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java#L72-L77 |
31,782 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java | Matrices.getTranslationVector | public static Vector3d getTranslationVector(Matrix4d transform) {
Vector3d transl = new Vector3d();
transform.get(transl);
return transl;
} | java | public static Vector3d getTranslationVector(Matrix4d transform) {
Vector3d transl = new Vector3d();
transform.get(transl);
return transl;
} | [
"public",
"static",
"Vector3d",
"getTranslationVector",
"(",
"Matrix4d",
"transform",
")",
"{",
"Vector3d",
"transl",
"=",
"new",
"Vector3d",
"(",
")",
";",
"transform",
".",
"get",
"(",
"transl",
")",
";",
"return",
"transl",
";",
"}"
] | Extract the translational vector of a transformation matrix.
@param transform
Matrix4d
@return Vector3d translation vector | [
"Extract",
"the",
"translational",
"vector",
"of",
"a",
"transformation",
"matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/Matrices.java#L86-L90 |
31,783 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/ProteinSequence.java | ProteinSequence.setParentDNASequence | public void setParentDNASequence(AbstractSequence<NucleotideCompound> parentDNASequence, Integer begin, Integer end) {
this.setParentSequence(parentDNASequence);
setBioBegin(begin);
setBioEnd(end);
} | java | public void setParentDNASequence(AbstractSequence<NucleotideCompound> parentDNASequence, Integer begin, Integer end) {
this.setParentSequence(parentDNASequence);
setBioBegin(begin);
setBioEnd(end);
} | [
"public",
"void",
"setParentDNASequence",
"(",
"AbstractSequence",
"<",
"NucleotideCompound",
">",
"parentDNASequence",
",",
"Integer",
"begin",
",",
"Integer",
"end",
")",
"{",
"this",
".",
"setParentSequence",
"(",
"parentDNASequence",
")",
";",
"setBioBegin",
"("... | However, due to the derivation of this class, this is the only possible type argument for this parameter... | [
"However",
"due",
"to",
"the",
"derivation",
"of",
"this",
"class",
"this",
"is",
"the",
"only",
"possible",
"type",
"argument",
"for",
"this",
"parameter",
"..."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/ProteinSequence.java#L149-L153 |
31,784 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/AAIndexFileParser.java | AAIndexFileParser.parse | public void parse(InputStream inputStream) throws IOException {
currentMatrix = null;
currentRows = "";
currentCols = "";
max = Short.MIN_VALUE;
min = Short.MAX_VALUE;
inMatrix = false;
BufferedReader buf = new BufferedReader (new InputStreamReader (inputStream));
String line = null;
line = buf.read... | java | public void parse(InputStream inputStream) throws IOException {
currentMatrix = null;
currentRows = "";
currentCols = "";
max = Short.MIN_VALUE;
min = Short.MAX_VALUE;
inMatrix = false;
BufferedReader buf = new BufferedReader (new InputStreamReader (inputStream));
String line = null;
line = buf.read... | [
"public",
"void",
"parse",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"currentMatrix",
"=",
"null",
";",
"currentRows",
"=",
"\"\"",
";",
"currentCols",
"=",
"\"\"",
";",
"max",
"=",
"Short",
".",
"MIN_VALUE",
";",
"min",
"=",
"S... | parse an inputStream that points to an AAINDEX database file
@param inputStream
@throws IOException | [
"parse",
"an",
"inputStream",
"that",
"points",
"to",
"an",
"AAINDEX",
"database",
"file"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/alignment/matrices/AAIndexFileParser.java#L64-L99 |
31,785 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/ORonnModel.java | ORonnModel.align | private final float[] align(final int sResidue, final int dIndex) {
int dResidue, r;
float maxScore = -1000000;
float rho1 = 0;
int maxIdx = 0;
float rho0 = 0;
short[] dbAARow = model.dbAA[dIndex];
int numOfIterations = model.Length[dIndex] - ORonnModel.AA_ALPHABET;
for (dResidue = 0; dResidue <= numOfIteration... | java | private final float[] align(final int sResidue, final int dIndex) {
int dResidue, r;
float maxScore = -1000000;
float rho1 = 0;
int maxIdx = 0;
float rho0 = 0;
short[] dbAARow = model.dbAA[dIndex];
int numOfIterations = model.Length[dIndex] - ORonnModel.AA_ALPHABET;
for (dResidue = 0; dResidue <= numOfIteration... | [
"private",
"final",
"float",
"[",
"]",
"align",
"(",
"final",
"int",
"sResidue",
",",
"final",
"int",
"dIndex",
")",
"{",
"int",
"dResidue",
",",
"r",
";",
"float",
"maxScore",
"=",
"-",
"1000000",
";",
"float",
"rho1",
"=",
"0",
";",
"int",
"maxIdx"... | sResidue query sequence index and dIndex database sequence index | [
"sResidue",
"query",
"sequence",
"index",
"and",
"dIndex",
"database",
"sequence",
"index"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/ORonnModel.java#L142-L168 |
31,786 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructureAlignmentFactory.java | StructureAlignmentFactory.addAlgorithm | public static void addAlgorithm(StructureAlignment alg) {
//ensure uniqueness
try {
getAlgorithm(alg.getAlgorithmName());
// algorithm was found. Do nothing.
} catch(StructureException e) {
// no algorithm found, so it's new
algorithms.add(alg);
}
} | java | public static void addAlgorithm(StructureAlignment alg) {
//ensure uniqueness
try {
getAlgorithm(alg.getAlgorithmName());
// algorithm was found. Do nothing.
} catch(StructureException e) {
// no algorithm found, so it's new
algorithms.add(alg);
}
} | [
"public",
"static",
"void",
"addAlgorithm",
"(",
"StructureAlignment",
"alg",
")",
"{",
"//ensure uniqueness",
"try",
"{",
"getAlgorithm",
"(",
"alg",
".",
"getAlgorithmName",
"(",
")",
")",
";",
"// algorithm was found. Do nothing.",
"}",
"catch",
"(",
"StructureEx... | Adds a new StructureAlignment algorithm to the list.
Only one instance is stored for each algorithmName, so it is possible
that a different instance may be returned by getAlgorithm(alg.getAlgorithmName())
@param alg the alignment algorithm | [
"Adds",
"a",
"new",
"StructureAlignment",
"algorithm",
"to",
"the",
"list",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructureAlignmentFactory.java#L68-L77 |
31,787 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructureAlignmentFactory.java | StructureAlignmentFactory.removeAlgorithm | public static boolean removeAlgorithm(String name) {
ListIterator<StructureAlignment> algIt = algorithms.listIterator();
while(algIt.hasNext()) {
StructureAlignment alg = algIt.next();
if(alg.getAlgorithmName().equalsIgnoreCase(name)) {
algIt.remove();
return true;
}
}
return false;
} | java | public static boolean removeAlgorithm(String name) {
ListIterator<StructureAlignment> algIt = algorithms.listIterator();
while(algIt.hasNext()) {
StructureAlignment alg = algIt.next();
if(alg.getAlgorithmName().equalsIgnoreCase(name)) {
algIt.remove();
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"removeAlgorithm",
"(",
"String",
"name",
")",
"{",
"ListIterator",
"<",
"StructureAlignment",
">",
"algIt",
"=",
"algorithms",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
"algIt",
".",
"hasNext",
"(",
")",
")",
"{",
"S... | Removes the specified algorithm from the list of options
@param name the name of the algorithm to remove
@return true if the specified algorithm was found and removed | [
"Removes",
"the",
"specified",
"algorithm",
"from",
"the",
"list",
"of",
"options"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructureAlignmentFactory.java#L84-L94 |
31,788 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java | QsAlignResult.getAlignedSubunits1 | public List<Subunit> getAlignedSubunits1() {
List<Subunit> aligned = new ArrayList<Subunit>(subunitMap.size());
for (Integer key : subunitMap.keySet())
aligned.add(subunits1.get(key));
return aligned;
} | java | public List<Subunit> getAlignedSubunits1() {
List<Subunit> aligned = new ArrayList<Subunit>(subunitMap.size());
for (Integer key : subunitMap.keySet())
aligned.add(subunits1.get(key));
return aligned;
} | [
"public",
"List",
"<",
"Subunit",
">",
"getAlignedSubunits1",
"(",
")",
"{",
"List",
"<",
"Subunit",
">",
"aligned",
"=",
"new",
"ArrayList",
"<",
"Subunit",
">",
"(",
"subunitMap",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Integer",
"key",
":",
... | Return the aligned subunits of the first Subunit group, in the alignment
order.
@return a List of Subunits in the alignment order | [
"Return",
"the",
"aligned",
"subunits",
"of",
"the",
"first",
"Subunit",
"group",
"in",
"the",
"alignment",
"order",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java#L235-L243 |
31,789 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java | QsAlignResult.getAlignedSubunits2 | public List<Subunit> getAlignedSubunits2() {
List<Subunit> aligned = new ArrayList<Subunit>(subunitMap.size());
for (Integer key : subunitMap.keySet())
aligned.add(subunits2.get(subunitMap.get(key)));
return aligned;
} | java | public List<Subunit> getAlignedSubunits2() {
List<Subunit> aligned = new ArrayList<Subunit>(subunitMap.size());
for (Integer key : subunitMap.keySet())
aligned.add(subunits2.get(subunitMap.get(key)));
return aligned;
} | [
"public",
"List",
"<",
"Subunit",
">",
"getAlignedSubunits2",
"(",
")",
"{",
"List",
"<",
"Subunit",
">",
"aligned",
"=",
"new",
"ArrayList",
"<",
"Subunit",
">",
"(",
"subunitMap",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Integer",
"key",
":",
... | Return the aligned subunits of the second Subunit group, in the alignment
order.
@return a List of Subunits in the alignment order | [
"Return",
"the",
"aligned",
"subunits",
"of",
"the",
"second",
"Subunit",
"group",
"in",
"the",
"alignment",
"order",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java#L251-L259 |
31,790 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java | HetatomImpl.setPDBName | @Override
public void setPDBName(String s) {
// hetatoms can have pdb_name length < 3. e.g. CU (see 1a4a position 1200 )
//if (s.length() != 3) {
//throw new PDBParseException("amino acid name is not of length 3!");
//}
if (s != null && s.equals("?")) logger.info("invalid pdbname: ?");
pdb_name =s ;
} | java | @Override
public void setPDBName(String s) {
// hetatoms can have pdb_name length < 3. e.g. CU (see 1a4a position 1200 )
//if (s.length() != 3) {
//throw new PDBParseException("amino acid name is not of length 3!");
//}
if (s != null && s.equals("?")) logger.info("invalid pdbname: ?");
pdb_name =s ;
} | [
"@",
"Override",
"public",
"void",
"setPDBName",
"(",
"String",
"s",
")",
"{",
"// hetatoms can have pdb_name length < 3. e.g. CU (see 1a4a position 1200 )",
"//if (s.length() != 3) {",
"//throw new PDBParseException(\"amino acid name is not of length 3!\");",
"//}",
"if",
"(",
"s",
... | Set three character name of Group .
@param s a String specifying the PDBName value
@see #getPDBName | [
"Set",
"three",
"character",
"name",
"of",
"Group",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java#L144-L153 |
31,791 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java | HetatomImpl.clearAtoms | @Override
public void clearAtoms() {
atoms.clear();
setPDBFlag(false);
if ( atomNameLookup != null)
atomNameLookup.clear();
} | java | @Override
public void clearAtoms() {
atoms.clear();
setPDBFlag(false);
if ( atomNameLookup != null)
atomNameLookup.clear();
} | [
"@",
"Override",
"public",
"void",
"clearAtoms",
"(",
")",
"{",
"atoms",
".",
"clear",
"(",
")",
";",
"setPDBFlag",
"(",
"false",
")",
";",
"if",
"(",
"atomNameLookup",
"!=",
"null",
")",
"atomNameLookup",
".",
"clear",
"(",
")",
";",
"}"
] | remove all atoms | [
"remove",
"all",
"atoms"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java#L196-L202 |
31,792 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java | HetatomImpl.trimToSize | @Override
public void trimToSize(){
if ( atoms instanceof ArrayList<?>) {
ArrayList<Atom> myatoms = (ArrayList<Atom>) atoms;
myatoms.trimToSize();
}
if ( altLocs instanceof ArrayList<?>){
ArrayList<Group> myAltLocs = (ArrayList<Group>) altLocs;
myAltLocs.trimToSize();
}
if ( hasAltLoc()) {
f... | java | @Override
public void trimToSize(){
if ( atoms instanceof ArrayList<?>) {
ArrayList<Atom> myatoms = (ArrayList<Atom>) atoms;
myatoms.trimToSize();
}
if ( altLocs instanceof ArrayList<?>){
ArrayList<Group> myAltLocs = (ArrayList<Group>) altLocs;
myAltLocs.trimToSize();
}
if ( hasAltLoc()) {
f... | [
"@",
"Override",
"public",
"void",
"trimToSize",
"(",
")",
"{",
"if",
"(",
"atoms",
"instanceof",
"ArrayList",
"<",
"?",
">",
")",
"{",
"ArrayList",
"<",
"Atom",
">",
"myatoms",
"=",
"(",
"ArrayList",
"<",
"Atom",
">",
")",
"atoms",
";",
"myatoms",
"... | attempts to reduce the memory imprint of this group by trimming
all internal Collection objects to the required size. | [
"attempts",
"to",
"reduce",
"the",
"memory",
"imprint",
"of",
"this",
"group",
"by",
"trimming",
"all",
"internal",
"Collection",
"objects",
"to",
"the",
"required",
"size",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java#L647-L671 |
31,793 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/LinearColorInterpolator.java | LinearColorInterpolator.interpolate | @Override
public Color interpolate(Color a, Color b, float mixing) {
float[] compA, compB;
// Get components
// Don't convert colorSpaces unless necessary
if(a.getColorSpace().equals(colorSpace) ) {
compA = a.getComponents(null);
} else {
compA = a.getComponents(colorSpace, null);
}
if(b.getColorSp... | java | @Override
public Color interpolate(Color a, Color b, float mixing) {
float[] compA, compB;
// Get components
// Don't convert colorSpaces unless necessary
if(a.getColorSpace().equals(colorSpace) ) {
compA = a.getComponents(null);
} else {
compA = a.getComponents(colorSpace, null);
}
if(b.getColorSp... | [
"@",
"Override",
"public",
"Color",
"interpolate",
"(",
"Color",
"a",
",",
"Color",
"b",
",",
"float",
"mixing",
")",
"{",
"float",
"[",
"]",
"compA",
",",
"compB",
";",
"// Get components",
"// Don't convert colorSpaces unless necessary",
"if",
"(",
"a",
".",... | Interpolates to a color between a and b
@param a First color
@param b Second color
@param mixing Mixing coefficient; the fraction of a in the result.
@return The color between a and b
@throws IllegalArgumentException if mixing is not between 0 and 1
@see org.biojava.nbio.structure.gui.util.color.ColorInterpolator#inter... | [
"Interpolates",
"to",
"a",
"color",
"between",
"a",
"and",
"b"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/LinearColorInterpolator.java#L60-L130 |
31,794 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/LinearColorInterpolator.java | LinearColorInterpolator.setColorSpace | public void setColorSpace(ColorSpace colorSpace, InterpolationDirection[] dir) {
if(dir.length < colorSpace.getNumComponents()) {
throw new IllegalArgumentException( "Must specify an interpolation " +
"direction for each colorspace component ("+colorSpace.getNumComponents()+")");
}
this.colorSpace = color... | java | public void setColorSpace(ColorSpace colorSpace, InterpolationDirection[] dir) {
if(dir.length < colorSpace.getNumComponents()) {
throw new IllegalArgumentException( "Must specify an interpolation " +
"direction for each colorspace component ("+colorSpace.getNumComponents()+")");
}
this.colorSpace = color... | [
"public",
"void",
"setColorSpace",
"(",
"ColorSpace",
"colorSpace",
",",
"InterpolationDirection",
"[",
"]",
"dir",
")",
"{",
"if",
"(",
"dir",
".",
"length",
"<",
"colorSpace",
".",
"getNumComponents",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcep... | Sets the ColorSpace to use for interpolation.
The most common scheme for color spaces is to use linear components
between 0 and 1 (for instance red,green,blue). For such a component, a
linear interpolation between two colors is used.
Sometimes a component may be in cylindrical coordinates. In this case,
the component... | [
"Sets",
"the",
"ColorSpace",
"to",
"use",
"for",
"interpolation",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/LinearColorInterpolator.java#L148-L155 |
31,795 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureHelper.java | FeatureHelper.buildFeatureAtrributeIndex | static public LinkedHashMap<String,FeatureList> buildFeatureAtrributeIndex(String attribute,FeatureList list){
LinkedHashMap<String,FeatureList> featureHashMap = new LinkedHashMap<String,FeatureList>();
FeatureList featureList = list.selectByAttribute(attribute);
for(FeatureI feature : featureList){
String va... | java | static public LinkedHashMap<String,FeatureList> buildFeatureAtrributeIndex(String attribute,FeatureList list){
LinkedHashMap<String,FeatureList> featureHashMap = new LinkedHashMap<String,FeatureList>();
FeatureList featureList = list.selectByAttribute(attribute);
for(FeatureI feature : featureList){
String va... | [
"static",
"public",
"LinkedHashMap",
"<",
"String",
",",
"FeatureList",
">",
"buildFeatureAtrributeIndex",
"(",
"String",
"attribute",
",",
"FeatureList",
"list",
")",
"{",
"LinkedHashMap",
"<",
"String",
",",
"FeatureList",
">",
"featureHashMap",
"=",
"new",
"Lin... | Build a list of individual features to allow easy indexing and to avoid iterating through large genome gff3 files
The index for the returned HashMap is the value of the attribute used to build the index
@param attribute
@param list
@return | [
"Build",
"a",
"list",
"of",
"individual",
"features",
"to",
"allow",
"easy",
"indexing",
"and",
"to",
"avoid",
"iterating",
"through",
"large",
"genome",
"gff3",
"files",
"The",
"index",
"for",
"the",
"returned",
"HashMap",
"is",
"the",
"value",
"of",
"the",... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureHelper.java#L39-L54 |
31,796 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java | EcodInstallation.filterByHierarchy | @Override
public List<EcodDomain> filterByHierarchy(String hierarchy) throws IOException {
String[] xhtGroup = hierarchy.split("\\.");
Integer xGroup = xhtGroup.length>0 ? Integer.parseInt(xhtGroup[0]) : null;
Integer hGroup = xhtGroup.length>1 ? Integer.parseInt(xhtGroup[1]) : null;
Integer tGroup = xhtGroup.... | java | @Override
public List<EcodDomain> filterByHierarchy(String hierarchy) throws IOException {
String[] xhtGroup = hierarchy.split("\\.");
Integer xGroup = xhtGroup.length>0 ? Integer.parseInt(xhtGroup[0]) : null;
Integer hGroup = xhtGroup.length>1 ? Integer.parseInt(xhtGroup[1]) : null;
Integer tGroup = xhtGroup.... | [
"@",
"Override",
"public",
"List",
"<",
"EcodDomain",
">",
"filterByHierarchy",
"(",
"String",
"hierarchy",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"xhtGroup",
"=",
"hierarchy",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"Integer",
"xGroup",
"=... | Get a list of domains within a particular level of the hierarchy
@param hierarchy A dot-separated list giving the X-group, H-group, and/or
T-group (e.g. "1.1" for all members of the RIFT-related H-group)
@return
@throws IOException | [
"Get",
"a",
"list",
"of",
"domains",
"within",
"a",
"particular",
"level",
"of",
"the",
"hierarchy"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L169-L196 |
31,797 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java | EcodInstallation.getAllDomains | @Override
public List<EcodDomain> getAllDomains() throws IOException {
domainsFileLock.readLock().lock();
logger.trace("LOCK readlock");
try {
while( allDomains == null) {
// unlock to allow ensureDomainsFileInstalled to get the write lock
logger.trace("UNLOCK readlock");
domainsFileLock.readLock(... | java | @Override
public List<EcodDomain> getAllDomains() throws IOException {
domainsFileLock.readLock().lock();
logger.trace("LOCK readlock");
try {
while( allDomains == null) {
// unlock to allow ensureDomainsFileInstalled to get the write lock
logger.trace("UNLOCK readlock");
domainsFileLock.readLock(... | [
"@",
"Override",
"public",
"List",
"<",
"EcodDomain",
">",
"getAllDomains",
"(",
")",
"throws",
"IOException",
"{",
"domainsFileLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"logger",
".",
"trace",
"(",
"\"LOCK readlock\"",
")",
";",
"try",... | Get all ECOD domains
@return
@throws IOException | [
"Get",
"all",
"ECOD",
"domains"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L233-L252 |
31,798 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java | EcodInstallation.clear | public void clear() {
domainsFileLock.writeLock().lock();
logger.trace("LOCK writelock");
allDomains = null;
domainMap = null;
logger.trace("UNLOCK writelock");
domainsFileLock.writeLock().unlock();
} | java | public void clear() {
domainsFileLock.writeLock().lock();
logger.trace("LOCK writelock");
allDomains = null;
domainMap = null;
logger.trace("UNLOCK writelock");
domainsFileLock.writeLock().unlock();
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"domainsFileLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"logger",
".",
"trace",
"(",
"\"LOCK writelock\"",
")",
";",
"allDomains",
"=",
"null",
";",
"domainMap",
"=",
"null",
";",
"logger",
"... | Clears all domains, requiring the file to be reparsed for subsequent accesses | [
"Clears",
"all",
"domains",
"requiring",
"the",
"file",
"to",
"be",
"reparsed",
"for",
"subsequent",
"accesses"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L257-L264 |
31,799 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java | EcodInstallation.setCacheLocation | public void setCacheLocation(String cacheLocation) {
if(cacheLocation.equals(this.cacheLocation)) {
return; //no change
}
// update location
domainsFileLock.writeLock().lock();
logger.trace("LOCK writelock");
this.cacheLocation = cacheLocation;
logger.trace("UNLOCK writelock");
domainsFileLock.writeL... | java | public void setCacheLocation(String cacheLocation) {
if(cacheLocation.equals(this.cacheLocation)) {
return; //no change
}
// update location
domainsFileLock.writeLock().lock();
logger.trace("LOCK writelock");
this.cacheLocation = cacheLocation;
logger.trace("UNLOCK writelock");
domainsFileLock.writeL... | [
"public",
"void",
"setCacheLocation",
"(",
"String",
"cacheLocation",
")",
"{",
"if",
"(",
"cacheLocation",
".",
"equals",
"(",
"this",
".",
"cacheLocation",
")",
")",
"{",
"return",
";",
"//no change",
"}",
"// update location",
"domainsFileLock",
".",
"writeLo... | Set an alternate download location for files
@param cacheLocation | [
"Set",
"an",
"alternate",
"download",
"location",
"for",
"files"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ecod/EcodInstallation.java#L311-L321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.