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,500 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/GUIFarmJobRunnable.java | GUIFarmJobRunnable.createAndShowGUI | private static void createAndShowGUI(GUIAlignmentProgressListener progressListener) {
//Create and set up the window.
JFrame frame = new JFrame("Monitor alignment process");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
JComponent newContentPane = progressListene... | java | private static void createAndShowGUI(GUIAlignmentProgressListener progressListener) {
//Create and set up the window.
JFrame frame = new JFrame("Monitor alignment process");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
JComponent newContentPane = progressListene... | [
"private",
"static",
"void",
"createAndShowGUI",
"(",
"GUIAlignmentProgressListener",
"progressListener",
")",
"{",
"//Create and set up the window.",
"JFrame",
"frame",
"=",
"new",
"JFrame",
"(",
"\"Monitor alignment process\"",
")",
";",
"frame",
".",
"setDefaultCloseOper... | Create the GUI and show it. As with all GUI code, this must run
on the event-dispatching thread. | [
"Create",
"the",
"GUI",
"and",
"show",
"it",
".",
"As",
"with",
"all",
"GUI",
"code",
"this",
"must",
"run",
"on",
"the",
"event",
"-",
"dispatching",
"thread",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/GUIFarmJobRunnable.java#L42-L56 |
31,501 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java | HelixSolver.getPermutation | private List<Integer> getPermutation(Matrix4d transformation) {
double rmsdThresholdSq = Math
.pow(this.parameters.getRmsdThreshold(), 2);
List<Point3d> centers = subunits.getOriginalCenters();
List<Integer> seqClusterId = subunits.getClusterIds();
List<Integer> permutations = new ArrayList<Integer>(cente... | java | private List<Integer> getPermutation(Matrix4d transformation) {
double rmsdThresholdSq = Math
.pow(this.parameters.getRmsdThreshold(), 2);
List<Point3d> centers = subunits.getOriginalCenters();
List<Integer> seqClusterId = subunits.getClusterIds();
List<Integer> permutations = new ArrayList<Integer>(cente... | [
"private",
"List",
"<",
"Integer",
">",
"getPermutation",
"(",
"Matrix4d",
"transformation",
")",
"{",
"double",
"rmsdThresholdSq",
"=",
"Math",
".",
"pow",
"(",
"this",
".",
"parameters",
".",
"getRmsdThreshold",
"(",
")",
",",
"2",
")",
";",
"List",
"<",... | Returns a permutation of subunit indices for the given helix
transformation. An index of -1 is used to indicate subunits that do not
superpose onto any other subunit.
@param transformation
@return | [
"Returns",
"a",
"permutation",
"of",
"subunit",
"indices",
"for",
"the",
"given",
"helix",
"transformation",
".",
"An",
"index",
"of",
"-",
"1",
"is",
"used",
"to",
"indicate",
"subunits",
"that",
"do",
"not",
"superpose",
"onto",
"any",
"other",
"subunit",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java#L351-L393 |
31,502 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java | HelixSolver.getRise | private static double getRise(Matrix4d transformation, Point3d p1,
Point3d p2) {
AxisAngle4d axis = getAxisAngle(transformation);
Vector3d h = new Vector3d(axis.x, axis.y, axis.z);
Vector3d p = new Vector3d();
p.sub(p1, p2);
return p.dot(h);
} | java | private static double getRise(Matrix4d transformation, Point3d p1,
Point3d p2) {
AxisAngle4d axis = getAxisAngle(transformation);
Vector3d h = new Vector3d(axis.x, axis.y, axis.z);
Vector3d p = new Vector3d();
p.sub(p1, p2);
return p.dot(h);
} | [
"private",
"static",
"double",
"getRise",
"(",
"Matrix4d",
"transformation",
",",
"Point3d",
"p1",
",",
"Point3d",
"p2",
")",
"{",
"AxisAngle4d",
"axis",
"=",
"getAxisAngle",
"(",
"transformation",
")",
";",
"Vector3d",
"h",
"=",
"new",
"Vector3d",
"(",
"axi... | Returns the rise of a helix given the subunit centers of two adjacent
subunits and the helix transformation
@param transformation
helix transformation
@param p1
center of one subunit
@param p2
center of an adjacent subunit
@return | [
"Returns",
"the",
"rise",
"of",
"a",
"helix",
"given",
"the",
"subunit",
"centers",
"of",
"two",
"adjacent",
"subunits",
"and",
"the",
"helix",
"transformation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java#L407-L414 |
31,503 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java | HelixSolver.getAxisAngle | private static AxisAngle4d getAxisAngle(Matrix4d transformation) {
AxisAngle4d axis = new AxisAngle4d();
axis.set(transformation);
return axis;
} | java | private static AxisAngle4d getAxisAngle(Matrix4d transformation) {
AxisAngle4d axis = new AxisAngle4d();
axis.set(transformation);
return axis;
} | [
"private",
"static",
"AxisAngle4d",
"getAxisAngle",
"(",
"Matrix4d",
"transformation",
")",
"{",
"AxisAngle4d",
"axis",
"=",
"new",
"AxisAngle4d",
"(",
")",
";",
"axis",
".",
"set",
"(",
"transformation",
")",
";",
"return",
"axis",
";",
"}"
] | Returns the AxisAngle of the helix transformation
@param transformation
helix transformation
@return | [
"Returns",
"the",
"AxisAngle",
"of",
"the",
"helix",
"transformation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java#L434-L438 |
31,504 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/CartesianProduct.java | CartesianProduct.getOrderedPairs | public List<OrderedPair<T>> getOrderedPairs() {
List<OrderedPair<T>> pairs = new ArrayList<OrderedPair<T>>(list1.size()*list2.size());
for (T element1: list1) {
for (T element2: list2) {
pairs.add(new OrderedPair<T>(element1, element2));
}
}
return pairs;
} | java | public List<OrderedPair<T>> getOrderedPairs() {
List<OrderedPair<T>> pairs = new ArrayList<OrderedPair<T>>(list1.size()*list2.size());
for (T element1: list1) {
for (T element2: list2) {
pairs.add(new OrderedPair<T>(element1, element2));
}
}
return pairs;
} | [
"public",
"List",
"<",
"OrderedPair",
"<",
"T",
">",
">",
"getOrderedPairs",
"(",
")",
"{",
"List",
"<",
"OrderedPair",
"<",
"T",
">>",
"pairs",
"=",
"new",
"ArrayList",
"<",
"OrderedPair",
"<",
"T",
">",
">",
"(",
"list1",
".",
"size",
"(",
")",
"... | Generates the list of ordered pair between two sets.
@return the list of ordered pairs | [
"Generates",
"the",
"list",
"of",
"ordered",
"pair",
"between",
"two",
"sets",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/CartesianProduct.java#L62-L72 |
31,505 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java | RemotePDPProvider.getDomain | @Override
public Structure getDomain(String pdpDomainName, AtomCache cache) throws IOException, StructureException {
return cache.getStructure(getPDPDomain(pdpDomainName));
} | java | @Override
public Structure getDomain(String pdpDomainName, AtomCache cache) throws IOException, StructureException {
return cache.getStructure(getPDPDomain(pdpDomainName));
} | [
"@",
"Override",
"public",
"Structure",
"getDomain",
"(",
"String",
"pdpDomainName",
",",
"AtomCache",
"cache",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"return",
"cache",
".",
"getStructure",
"(",
"getPDPDomain",
"(",
"pdpDomainName",
")",
")... | Get the structure for a particular PDP domain
@param pdpDomainName PDP identifier, e.g. "PDP:4HHBAa"
@param cache AtomCache, responsible for fetching and storing the coordinates
@return Structure representing the PDP domain
@throws IOException if the server cannot be reached
@throws StructureException For errors parsin... | [
"Get",
"the",
"structure",
"for",
"a",
"particular",
"PDP",
"domain"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java#L162-L165 |
31,506 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java | RemotePDPProvider.getPDPDomain | @Override
public PDPDomain getPDPDomain(String pdpDomainName) throws IOException{
SortedSet<String> domainRanges = null;
if ( serializedCache != null){
if ( serializedCache.containsKey(pdpDomainName)){
domainRanges= serializedCache.get(pdpDomainName);
}
}
boolean shouldRequestDomainRanges = checkD... | java | @Override
public PDPDomain getPDPDomain(String pdpDomainName) throws IOException{
SortedSet<String> domainRanges = null;
if ( serializedCache != null){
if ( serializedCache.containsKey(pdpDomainName)){
domainRanges= serializedCache.get(pdpDomainName);
}
}
boolean shouldRequestDomainRanges = checkD... | [
"@",
"Override",
"public",
"PDPDomain",
"getPDPDomain",
"(",
"String",
"pdpDomainName",
")",
"throws",
"IOException",
"{",
"SortedSet",
"<",
"String",
">",
"domainRanges",
"=",
"null",
";",
"if",
"(",
"serializedCache",
"!=",
"null",
")",
"{",
"if",
"(",
"se... | Get a StructureIdentifier representing the specified PDP domain.
@param pdpDomainName PDP domain name
@return a PDPDomain representing this domain name
@throws IOException if the server cannot be reached | [
"Get",
"a",
"StructureIdentifier",
"representing",
"the",
"specified",
"PDP",
"domain",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java#L174-L216 |
31,507 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java | RemotePDPProvider.checkDomainRanges | private boolean checkDomainRanges(SortedSet<String> domainRanges) {
if ( (domainRanges == null) || (domainRanges.size() == 0)){
return true;
}
for ( String d : domainRanges){
//System.out.println("domainRange: >" + d +"< " + d.length());
if ( (d != null) && (d.length() >0)){
return false;
}
}
... | java | private boolean checkDomainRanges(SortedSet<String> domainRanges) {
if ( (domainRanges == null) || (domainRanges.size() == 0)){
return true;
}
for ( String d : domainRanges){
//System.out.println("domainRange: >" + d +"< " + d.length());
if ( (d != null) && (d.length() >0)){
return false;
}
}
... | [
"private",
"boolean",
"checkDomainRanges",
"(",
"SortedSet",
"<",
"String",
">",
"domainRanges",
")",
"{",
"if",
"(",
"(",
"domainRanges",
"==",
"null",
")",
"||",
"(",
"domainRanges",
".",
"size",
"(",
")",
"==",
"0",
")",
")",
"{",
"return",
"true",
... | returns true if client should fetch domain definitions from server
@param domainRanges
@return | [
"returns",
"true",
"if",
"client",
"should",
"fetch",
"domain",
"definitions",
"from",
"server"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java#L223-L237 |
31,508 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java | RemotePDPProvider.getPDPDomainNamesForPDB | @Override
public SortedSet<String> getPDPDomainNamesForPDB(String pdbId) throws IOException{
SortedSet<String> results = null;
try {
URL u = new URL(server + "getPDPDomainNamesForPDB?pdbId="+pdbId);
logger.info("Fetching {}",u);
InputStream response = URLConnectionTools.getInputStream(u);
String xml = ... | java | @Override
public SortedSet<String> getPDPDomainNamesForPDB(String pdbId) throws IOException{
SortedSet<String> results = null;
try {
URL u = new URL(server + "getPDPDomainNamesForPDB?pdbId="+pdbId);
logger.info("Fetching {}",u);
InputStream response = URLConnectionTools.getInputStream(u);
String xml = ... | [
"@",
"Override",
"public",
"SortedSet",
"<",
"String",
">",
"getPDPDomainNamesForPDB",
"(",
"String",
"pdbId",
")",
"throws",
"IOException",
"{",
"SortedSet",
"<",
"String",
">",
"results",
"=",
"null",
";",
"try",
"{",
"URL",
"u",
"=",
"new",
"URL",
"(",
... | Get a list of all PDP domains for a given PDB entry
@param pdbId PDB ID
@return Set of domain names, e.g. "PDP:4HHBAa"
@throws IOException if the server cannot be reached | [
"Get",
"a",
"list",
"of",
"all",
"PDP",
"domains",
"for",
"a",
"given",
"PDB",
"entry"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java#L245-L260 |
31,509 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPOptimizer.java | AFPOptimizer.blockInfo | public static void blockInfo(AFPChain afpChain)
{
int i, j, k, a, n;
int blockNum = afpChain.getBlockNum();
int[] blockSize =afpChain.getBlockSize();
int[] afpChainList = afpChain.getAfpChainList();
int[] block2Afp = afpChain.getBlock2Afp();
int[][][]blockResList = afpChain.getBlockResList();
List... | java | public static void blockInfo(AFPChain afpChain)
{
int i, j, k, a, n;
int blockNum = afpChain.getBlockNum();
int[] blockSize =afpChain.getBlockSize();
int[] afpChainList = afpChain.getAfpChainList();
int[] block2Afp = afpChain.getBlock2Afp();
int[][][]blockResList = afpChain.getBlockResList();
List... | [
"public",
"static",
"void",
"blockInfo",
"(",
"AFPChain",
"afpChain",
")",
"{",
"int",
"i",
",",
"j",
",",
"k",
",",
"a",
",",
"n",
";",
"int",
"blockNum",
"=",
"afpChain",
".",
"getBlockNum",
"(",
")",
";",
"int",
"[",
"]",
"blockSize",
"=",
"afpC... | get the afp list and residue list for each block | [
"get",
"the",
"afp",
"list",
"and",
"residue",
"list",
"for",
"each",
"block"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPOptimizer.java#L170-L203 |
31,510 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPOptimizer.java | AFPOptimizer.updateScore | public static void updateScore(FatCatParameters params, AFPChain afpChain)
{
int i, j, bknow, bkold, g1, g2;
afpChain.setConn(0d);
afpChain.setDVar(0d);
int blockNum = afpChain.getBlockNum();
int alignScoreUpdate = 0;
double[] blockScore = afpChain.getBlockScore();
int[] blockGap = afpChain.getBlo... | java | public static void updateScore(FatCatParameters params, AFPChain afpChain)
{
int i, j, bknow, bkold, g1, g2;
afpChain.setConn(0d);
afpChain.setDVar(0d);
int blockNum = afpChain.getBlockNum();
int alignScoreUpdate = 0;
double[] blockScore = afpChain.getBlockScore();
int[] blockGap = afpChain.getBlo... | [
"public",
"static",
"void",
"updateScore",
"(",
"FatCatParameters",
"params",
",",
"AFPChain",
"afpChain",
")",
"{",
"int",
"i",
",",
"j",
",",
"bknow",
",",
"bkold",
",",
"g1",
",",
"g2",
";",
"afpChain",
".",
"setConn",
"(",
"0d",
")",
";",
"afpChain... | to update the chaining score after block delete and merge processed
the blockScore value is important for significance evaluation | [
"to",
"update",
"the",
"chaining",
"score",
"after",
"block",
"delete",
"and",
"merge",
"processed",
"the",
"blockScore",
"value",
"is",
"important",
"for",
"significance",
"evaluation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPOptimizer.java#L209-L260 |
31,511 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java | CeSymm.analyze | public static CeSymmResult analyze(Atom[] atoms) throws StructureException {
CESymmParameters params = new CESymmParameters();
return analyze(atoms, params);
} | java | public static CeSymmResult analyze(Atom[] atoms) throws StructureException {
CESymmParameters params = new CESymmParameters();
return analyze(atoms, params);
} | [
"public",
"static",
"CeSymmResult",
"analyze",
"(",
"Atom",
"[",
"]",
"atoms",
")",
"throws",
"StructureException",
"{",
"CESymmParameters",
"params",
"=",
"new",
"CESymmParameters",
"(",
")",
";",
"return",
"analyze",
"(",
"atoms",
",",
"params",
")",
";",
... | Analyze the symmetries of the input Atom array using the DEFAULT
parameters.
@param atoms
representative Atom array of the Structure
@return CeSymmResult
@throws StructureException | [
"Analyze",
"the",
"symmetries",
"of",
"the",
"input",
"Atom",
"array",
"using",
"the",
"DEFAULT",
"parameters",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java#L354-L357 |
31,512 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java | CeSymm.analyze | public static CeSymmResult analyze(Atom[] atoms, CESymmParameters params)
throws StructureException {
if (atoms.length < 1)
throw new IllegalArgumentException("Empty Atom array given.");
// If the SSE information is needed, we calculate it if the user did not
if (params.getSSEThreshold() > 0) {
Structu... | java | public static CeSymmResult analyze(Atom[] atoms, CESymmParameters params)
throws StructureException {
if (atoms.length < 1)
throw new IllegalArgumentException("Empty Atom array given.");
// If the SSE information is needed, we calculate it if the user did not
if (params.getSSEThreshold() > 0) {
Structu... | [
"public",
"static",
"CeSymmResult",
"analyze",
"(",
"Atom",
"[",
"]",
"atoms",
",",
"CESymmParameters",
"params",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"atoms",
".",
"length",
"<",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Em... | Analyze the symmetries of the input Atom array using the provided
parameters.
@param atoms
representative Atom array of the Structure
@param param
CeSymmParameters bean
@return CeSymmResult
@throws StructureException | [
"Analyze",
"the",
"symmetries",
"of",
"the",
"input",
"Atom",
"array",
"using",
"the",
"provided",
"parameters",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java#L370-L405 |
31,513 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java | CeSymm.analyzeLevel | public static CeSymmResult analyzeLevel(Atom[] atoms,
CESymmParameters params) throws StructureException {
if (atoms.length < 1)
throw new IllegalArgumentException("Empty Atom array given.");
CeSymmResult result = align(atoms, params);
if (result.isRefined()) {
// STEP 5: symmetry alignment optimizati... | java | public static CeSymmResult analyzeLevel(Atom[] atoms,
CESymmParameters params) throws StructureException {
if (atoms.length < 1)
throw new IllegalArgumentException("Empty Atom array given.");
CeSymmResult result = align(atoms, params);
if (result.isRefined()) {
// STEP 5: symmetry alignment optimizati... | [
"public",
"static",
"CeSymmResult",
"analyzeLevel",
"(",
"Atom",
"[",
"]",
"atoms",
",",
"CESymmParameters",
"params",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"atoms",
".",
"length",
"<",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Analyze a single level of symmetry.
@param atoms
Atom array of the current level
@return CeSymmResult
@throws StructureException | [
"Analyze",
"a",
"single",
"level",
"of",
"symmetry",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java#L415-L437 |
31,514 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java | AtomPositionMap.getLength | public int getLength(int positionA, int positionB, String startingChain) {
int positionStart, positionEnd;
if (positionA <= positionB) {
positionStart = positionA;
positionEnd = positionB;
} else {
positionStart = positionB;
positionEnd = positionA;
}
int count = 0;
// Inefficient search
for... | java | public int getLength(int positionA, int positionB, String startingChain) {
int positionStart, positionEnd;
if (positionA <= positionB) {
positionStart = positionA;
positionEnd = positionB;
} else {
positionStart = positionB;
positionEnd = positionA;
}
int count = 0;
// Inefficient search
for... | [
"public",
"int",
"getLength",
"(",
"int",
"positionA",
",",
"int",
"positionB",
",",
"String",
"startingChain",
")",
"{",
"int",
"positionStart",
",",
"positionEnd",
";",
"if",
"(",
"positionA",
"<=",
"positionB",
")",
"{",
"positionStart",
"=",
"positionA",
... | Calculates the number of residues of the specified chain in a given range, inclusive.
@param positionA index of the first atom to count
@param positionB index of the last atom to count
@param startingChain Case-sensitive chain
@return The number of atoms between A and B inclusive belonging to the given chain | [
"Calculates",
"the",
"number",
"of",
"residues",
"of",
"the",
"specified",
"chain",
"in",
"a",
"given",
"range",
"inclusive",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java#L187-L209 |
31,515 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java | AtomPositionMap.getLengthDirectional | public int getLengthDirectional(int positionStart, int positionEnd, String startingChain) {
int count = getLength(positionStart,positionEnd,startingChain);
if(positionStart <= positionEnd) {
return count;
} else {
return -count;
}
} | java | public int getLengthDirectional(int positionStart, int positionEnd, String startingChain) {
int count = getLength(positionStart,positionEnd,startingChain);
if(positionStart <= positionEnd) {
return count;
} else {
return -count;
}
} | [
"public",
"int",
"getLengthDirectional",
"(",
"int",
"positionStart",
",",
"int",
"positionEnd",
",",
"String",
"startingChain",
")",
"{",
"int",
"count",
"=",
"getLength",
"(",
"positionStart",
",",
"positionEnd",
",",
"startingChain",
")",
";",
"if",
"(",
"p... | Calculates the number of residues of the specified chain in a given range.
Will return a negative value if the start is past the end.
@param positionStart index of the first atom to count
@param positionEnd index of the last atom to count
@param startingChain Case-sensitive chain
@return The number of atoms from A to B... | [
"Calculates",
"the",
"number",
"of",
"residues",
"of",
"the",
"specified",
"chain",
"in",
"a",
"given",
"range",
".",
"Will",
"return",
"a",
"negative",
"value",
"if",
"the",
"start",
"is",
"past",
"the",
"end",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java#L220-L227 |
31,516 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java | AtomPositionMap.getLength | public int getLength(ResidueNumber start, ResidueNumber end) {
if( ! start.getChainName().equals(end.getChainName())) {
throw new IllegalArgumentException(String.format(
"Chains differ between %s and %s. Unable to calculate length.",
start,end));
}
Integer startPos = getPosition(start);
Integer end... | java | public int getLength(ResidueNumber start, ResidueNumber end) {
if( ! start.getChainName().equals(end.getChainName())) {
throw new IllegalArgumentException(String.format(
"Chains differ between %s and %s. Unable to calculate length.",
start,end));
}
Integer startPos = getPosition(start);
Integer end... | [
"public",
"int",
"getLength",
"(",
"ResidueNumber",
"start",
",",
"ResidueNumber",
"end",
")",
"{",
"if",
"(",
"!",
"start",
".",
"getChainName",
"(",
")",
".",
"equals",
"(",
"end",
".",
"getChainName",
"(",
")",
")",
")",
"{",
"throw",
"new",
"Illega... | Calculates the number of atoms between two ResidueNumbers, inclusive. Both residues
must belong to the same chain.
@param start First residue
@param end Last residue
@return The number of atoms from A to B inclusive
@throws IllegalArgumentException if start and end are on different chains,
or if either of the residues ... | [
"Calculates",
"the",
"number",
"of",
"atoms",
"between",
"two",
"ResidueNumbers",
"inclusive",
".",
"Both",
"residues",
"must",
"belong",
"to",
"the",
"same",
"chain",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java#L238-L253 |
31,517 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java | AtomPositionMap.trimToValidResidues | public ResidueRangeAndLength trimToValidResidues(ResidueRange rr) {
ResidueNumber start = rr.getStart();
ResidueNumber end = rr.getEnd();
String chain = rr.getChainName();
// Add chainName
if(start.getChainName() == null) {
start = new ResidueNumber(chain,start.getSeqNum(),start.getInsCode());
}
if(end... | java | public ResidueRangeAndLength trimToValidResidues(ResidueRange rr) {
ResidueNumber start = rr.getStart();
ResidueNumber end = rr.getEnd();
String chain = rr.getChainName();
// Add chainName
if(start.getChainName() == null) {
start = new ResidueNumber(chain,start.getSeqNum(),start.getInsCode());
}
if(end... | [
"public",
"ResidueRangeAndLength",
"trimToValidResidues",
"(",
"ResidueRange",
"rr",
")",
"{",
"ResidueNumber",
"start",
"=",
"rr",
".",
"getStart",
"(",
")",
";",
"ResidueNumber",
"end",
"=",
"rr",
".",
"getEnd",
"(",
")",
";",
"String",
"chain",
"=",
"rr",... | Trims a residue range so that both endpoints are contained in this map.
@param rr residue range
@return residue range and length | [
"Trims",
"a",
"residue",
"range",
"so",
"that",
"both",
"endpoints",
"are",
"contained",
"in",
"this",
"map",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java#L366-L431 |
31,518 | biojava/biojava | biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/StructureUtil.java | StructureUtil.findNearestAtomLinkage | public static Atom[] findNearestAtomLinkage(final Group group1, final Group group2,
List<String> potentialNamesOfAtomOnGroup1, List<String> potentialNamesOfAtomOnGroup2,
final boolean ignoreNCLinkage, double bondLengthTolerance) {
List<Atom[]> linkages = findAtomLinkages(group1, group2,
potentialNamesOfAt... | java | public static Atom[] findNearestAtomLinkage(final Group group1, final Group group2,
List<String> potentialNamesOfAtomOnGroup1, List<String> potentialNamesOfAtomOnGroup2,
final boolean ignoreNCLinkage, double bondLengthTolerance) {
List<Atom[]> linkages = findAtomLinkages(group1, group2,
potentialNamesOfAt... | [
"public",
"static",
"Atom",
"[",
"]",
"findNearestAtomLinkage",
"(",
"final",
"Group",
"group1",
",",
"final",
"Group",
"group2",
",",
"List",
"<",
"String",
">",
"potentialNamesOfAtomOnGroup1",
",",
"List",
"<",
"String",
">",
"potentialNamesOfAtomOnGroup2",
",",... | Find a linkage between two groups within tolerance of bond length,
from potential atoms.
@param group1 the first {@link Group}.
@param group2 the second {@link Group}.
@param potentialNamesOfAtomOnGroup1 potential names of the atom on the first group.
If null, search all atoms on the first group.
@param potentialNamesO... | [
"Find",
"a",
"linkage",
"between",
"two",
"groups",
"within",
"tolerance",
"of",
"bond",
"length",
"from",
"potential",
"atoms",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/StructureUtil.java#L111-L136 |
31,519 | biojava/biojava | biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/StructureUtil.java | StructureUtil.findLinkage | public static Atom[] findLinkage(final Group group1, final Group group2,
String nameOfAtomOnGroup1, String nameOfAtomOnGroup2,
double bondLengthTolerance) {
Atom[] ret = new Atom[2];
ret[0] = group1.getAtom(nameOfAtomOnGroup1);
ret[1] = group2.getAtom(nameOfAtomOnGroup2);
if (ret[0]==null || ret[1]==nu... | java | public static Atom[] findLinkage(final Group group1, final Group group2,
String nameOfAtomOnGroup1, String nameOfAtomOnGroup2,
double bondLengthTolerance) {
Atom[] ret = new Atom[2];
ret[0] = group1.getAtom(nameOfAtomOnGroup1);
ret[1] = group2.getAtom(nameOfAtomOnGroup2);
if (ret[0]==null || ret[1]==nu... | [
"public",
"static",
"Atom",
"[",
"]",
"findLinkage",
"(",
"final",
"Group",
"group1",
",",
"final",
"Group",
"group2",
",",
"String",
"nameOfAtomOnGroup1",
",",
"String",
"nameOfAtomOnGroup2",
",",
"double",
"bondLengthTolerance",
")",
"{",
"Atom",
"[",
"]",
"... | Find a linkage between two groups within tolerance of bond length.
@param group1 the first {@link Group}.
@param group2 the second {@link Group}.
@param nameOfAtomOnGroup1 atom name of the first group.
@param nameOfAtomOnGroup2 atom name of the second group.
@param bondLengthTolerance bond length error tolerance.
@retu... | [
"Find",
"a",
"linkage",
"between",
"two",
"groups",
"within",
"tolerance",
"of",
"bond",
"length",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/StructureUtil.java#L225-L279 |
31,520 | biojava/biojava | biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/StructureUtil.java | StructureUtil.getAminoAcids | public static List<Group> getAminoAcids(Chain chain) {
List<Group> gs = new ArrayList<>();
for ( Group g : chain.getAtomGroups()){
if ( g.isAminoAcid())
gs.add(g);
}
return gs;
} | java | public static List<Group> getAminoAcids(Chain chain) {
List<Group> gs = new ArrayList<>();
for ( Group g : chain.getAtomGroups()){
if ( g.isAminoAcid())
gs.add(g);
}
return gs;
} | [
"public",
"static",
"List",
"<",
"Group",
">",
"getAminoAcids",
"(",
"Chain",
"chain",
")",
"{",
"List",
"<",
"Group",
">",
"gs",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Group",
"g",
":",
"chain",
".",
"getAtomGroups",
"(",
")",
... | Get all amino acids in a chain.
@param chain
@return | [
"Get",
"all",
"amino",
"acids",
"in",
"a",
"chain",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/StructureUtil.java#L343-L356 |
31,521 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java | StructureImpl.isCrystallographic | @Override
public boolean isCrystallographic() {
if (pdbHeader.getExperimentalTechniques()!=null) {
return ExperimentalTechnique.isCrystallographic(pdbHeader.getExperimentalTechniques());
} else {
// no experimental technique known, we try to guess...
if (pdbHeader.getCrystallographicInfo().getSpaceGroup()... | java | @Override
public boolean isCrystallographic() {
if (pdbHeader.getExperimentalTechniques()!=null) {
return ExperimentalTechnique.isCrystallographic(pdbHeader.getExperimentalTechniques());
} else {
// no experimental technique known, we try to guess...
if (pdbHeader.getCrystallographicInfo().getSpaceGroup()... | [
"@",
"Override",
"public",
"boolean",
"isCrystallographic",
"(",
")",
"{",
"if",
"(",
"pdbHeader",
".",
"getExperimentalTechniques",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"ExperimentalTechnique",
".",
"isCrystallographic",
"(",
"pdbHeader",
".",
"getExperime... | Whether this Structure is a crystallographic structure or not.
It will first check the experimental technique and if not present it will try
to guess from the presence of a space group and sensible cell parameters
@return true if crystallographic, false otherwise | [
"Whether",
"this",
"Structure",
"is",
"a",
"crystallographic",
"structure",
"or",
"not",
".",
"It",
"will",
"first",
"check",
"the",
"experimental",
"technique",
"and",
"if",
"not",
"present",
"it",
"will",
"try",
"to",
"guess",
"from",
"the",
"presence",
"o... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java#L521-L534 |
31,522 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java | StructureImpl.isNmr | @Override
public boolean isNmr() {
// old implementation was:
//return nmrflag;
if (pdbHeader.getExperimentalTechniques()!=null) {
return ExperimentalTechnique.isNmr(pdbHeader.getExperimentalTechniques());
} else {
// no experimental technique known, we try to guess...
if (nrModels()>1) {
if (pd... | java | @Override
public boolean isNmr() {
// old implementation was:
//return nmrflag;
if (pdbHeader.getExperimentalTechniques()!=null) {
return ExperimentalTechnique.isNmr(pdbHeader.getExperimentalTechniques());
} else {
// no experimental technique known, we try to guess...
if (nrModels()>1) {
if (pd... | [
"@",
"Override",
"public",
"boolean",
"isNmr",
"(",
")",
"{",
"// old implementation was:",
"//return nmrflag;",
"if",
"(",
"pdbHeader",
".",
"getExperimentalTechniques",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"ExperimentalTechnique",
".",
"isNmr",
"(",
"pdbH... | Whether this Structure is a NMR structure or not.
It will first check the experimental technique and if not present it will try
to guess from the presence of more than 1 model and from b-factors being 0 in first chain of first model
@return true if NMR, false otherwise | [
"Whether",
"this",
"Structure",
"is",
"a",
"NMR",
"structure",
"or",
"not",
".",
"It",
"will",
"first",
"check",
"the",
"experimental",
"technique",
"and",
"if",
"not",
"present",
"it",
"will",
"try",
"to",
"guess",
"from",
"the",
"presence",
"of",
"more",... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java#L542-L567 |
31,523 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java | StructureImpl.toCanonical | private SubstructureIdentifier toCanonical() {
StructureIdentifier real = getStructureIdentifier();
if(real != null) {
try {
return real.toCanonical();
} catch (StructureException e) {
// generate fake one if needed
}
}
// No identifier set, so generate based on residues present in the structu... | java | private SubstructureIdentifier toCanonical() {
StructureIdentifier real = getStructureIdentifier();
if(real != null) {
try {
return real.toCanonical();
} catch (StructureException e) {
// generate fake one if needed
}
}
// No identifier set, so generate based on residues present in the structu... | [
"private",
"SubstructureIdentifier",
"toCanonical",
"(",
")",
"{",
"StructureIdentifier",
"real",
"=",
"getStructureIdentifier",
"(",
")",
";",
"if",
"(",
"real",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"real",
".",
"toCanonical",
"(",
")",
";",
"}",
... | Creates a SubstructureIdentifier based on the residues in this Structure.
Only the first and last residues of each chain are considered, so chains
with gaps
@return A {@link SubstructureIdentifier} with residue ranges constructed from each chain | [
"Creates",
"a",
"SubstructureIdentifier",
"based",
"on",
"the",
"residues",
"in",
"this",
"Structure",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java#L1122-L1155 |
31,524 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/WrapLayout.java | WrapLayout.layoutSize | private Dimension layoutSize(Container target, boolean preferred)
{
synchronized (target.getTreeLock())
{
// Each row must fit with the width allocated to the containter.
// When the container width = 0, the preferred width of the container
// has not yet been calculated so lets ask for the maximum.
int ... | java | private Dimension layoutSize(Container target, boolean preferred)
{
synchronized (target.getTreeLock())
{
// Each row must fit with the width allocated to the containter.
// When the container width = 0, the preferred width of the container
// has not yet been calculated so lets ask for the maximum.
int ... | [
"private",
"Dimension",
"layoutSize",
"(",
"Container",
"target",
",",
"boolean",
"preferred",
")",
"{",
"synchronized",
"(",
"target",
".",
"getTreeLock",
"(",
")",
")",
"{",
"// Each row must fit with the width allocated to the containter.",
"// When the container width... | Returns the minimum or preferred dimension needed to layout the target
container.
@param target target to get layout size for
@param preferred should preferred size be calculated
@return the dimension to layout the target container | [
"Returns",
"the",
"minimum",
"or",
"preferred",
"dimension",
"needed",
"to",
"layout",
"the",
"target",
"container",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/WrapLayout.java#L111-L194 |
31,525 | biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java | NumbersAtRiskPanel.setKaplanMeierFigure | public void setKaplanMeierFigure(KaplanMeierFigure kmf) {
this.kmf = kmf;
int numRows = kmf.getSurvivalFitInfo().getStrataInfoHashMap().size();
int height = (numRows + 1) * getFontMetrics(getFont()).getHeight();
int width = kmf.getWidth();
setPreferredSize(new Dimension(width,height));
this.setSize(width, ... | java | public void setKaplanMeierFigure(KaplanMeierFigure kmf) {
this.kmf = kmf;
int numRows = kmf.getSurvivalFitInfo().getStrataInfoHashMap().size();
int height = (numRows + 1) * getFontMetrics(getFont()).getHeight();
int width = kmf.getWidth();
setPreferredSize(new Dimension(width,height));
this.setSize(width, ... | [
"public",
"void",
"setKaplanMeierFigure",
"(",
"KaplanMeierFigure",
"kmf",
")",
"{",
"this",
".",
"kmf",
"=",
"kmf",
";",
"int",
"numRows",
"=",
"kmf",
".",
"getSurvivalFitInfo",
"(",
")",
".",
"getStrataInfoHashMap",
"(",
")",
".",
"size",
"(",
")",
";",
... | Pick up needed info and details from the KM Figure
@param kmf | [
"Pick",
"up",
"needed",
"info",
"and",
"details",
"from",
"the",
"KM",
"Figure"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java#L52-L61 |
31,526 | biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java | SurvivalInfoHelper.isCategorical | private static boolean isCategorical(LinkedHashMap<String, Double> values) {
try {
for (String value : values.keySet()) {
Double.parseDouble(value);
}
return false;
} catch (Exception e) {
return true;
}
} | java | private static boolean isCategorical(LinkedHashMap<String, Double> values) {
try {
for (String value : values.keySet()) {
Double.parseDouble(value);
}
return false;
} catch (Exception e) {
return true;
}
} | [
"private",
"static",
"boolean",
"isCategorical",
"(",
"LinkedHashMap",
"<",
"String",
",",
"Double",
">",
"values",
")",
"{",
"try",
"{",
"for",
"(",
"String",
"value",
":",
"values",
".",
"keySet",
"(",
")",
")",
"{",
"Double",
".",
"parseDouble",
"(",
... | If any not numeric value then categorical
@param values
@return | [
"If",
"any",
"not",
"numeric",
"value",
"then",
"categorical"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java#L70-L80 |
31,527 | biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java | SurvivalInfoHelper.categorizeData | public static void categorizeData(ArrayList<SurvivalInfo> DataT) {
//Go through and get all variable value pairs
LinkedHashMap<String, LinkedHashMap<String, Double>> valueMap = new LinkedHashMap<String, LinkedHashMap<String, Double>>();
for (SurvivalInfo si : DataT) {
for (String key : si.unknownDataType.key... | java | public static void categorizeData(ArrayList<SurvivalInfo> DataT) {
//Go through and get all variable value pairs
LinkedHashMap<String, LinkedHashMap<String, Double>> valueMap = new LinkedHashMap<String, LinkedHashMap<String, Double>>();
for (SurvivalInfo si : DataT) {
for (String key : si.unknownDataType.key... | [
"public",
"static",
"void",
"categorizeData",
"(",
"ArrayList",
"<",
"SurvivalInfo",
">",
"DataT",
")",
"{",
"//Go through and get all variable value pairs",
"LinkedHashMap",
"<",
"String",
",",
"LinkedHashMap",
"<",
"String",
",",
"Double",
">",
">",
"valueMap",
"=... | Take a collection of categorical data and convert it to numeric to be used in cox calculations
@param DataT | [
"Take",
"a",
"collection",
"of",
"categorical",
"data",
"and",
"convert",
"it",
"to",
"numeric",
"to",
"be",
"used",
"in",
"cox",
"calculations"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java#L86-L140 |
31,528 | biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java | SurvivalInfoHelper.addInteraction | public static ArrayList<String> addInteraction(String variable1, String variable2, ArrayList<SurvivalInfo> survivalInfoList) {
ArrayList<String> variables = new ArrayList<String>();
variables.add(variable1);
variables.add(variable2);
variables.add(variable1 + ":" + variable2);
for (SurvivalInfo si : survivalI... | java | public static ArrayList<String> addInteraction(String variable1, String variable2, ArrayList<SurvivalInfo> survivalInfoList) {
ArrayList<String> variables = new ArrayList<String>();
variables.add(variable1);
variables.add(variable2);
variables.add(variable1 + ":" + variable2);
for (SurvivalInfo si : survivalI... | [
"public",
"static",
"ArrayList",
"<",
"String",
">",
"addInteraction",
"(",
"String",
"variable1",
",",
"String",
"variable2",
",",
"ArrayList",
"<",
"SurvivalInfo",
">",
"survivalInfoList",
")",
"{",
"ArrayList",
"<",
"String",
">",
"variables",
"=",
"new",
"... | To test for interactions use two variables and create a third variable where the two are multiplied together.
@param variable1
@param variable2
@param survivalInfoList
@return | [
"To",
"test",
"for",
"interactions",
"use",
"two",
"variables",
"and",
"create",
"a",
"third",
"variable",
"where",
"the",
"two",
"are",
"multiplied",
"together",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java#L149-L161 |
31,529 | biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java | SurvivalInfoHelper.groupByRange | public static void groupByRange(double[] range, String variable, String groupName, ArrayList<SurvivalInfo> survivalInfoList) throws Exception {
ArrayList<String> labels = new ArrayList<String>();
for (int i = 0; i < range.length; i++) {
String label = "";
if (i == 0) {
label = "[<=" + range[i] + "]";
}... | java | public static void groupByRange(double[] range, String variable, String groupName, ArrayList<SurvivalInfo> survivalInfoList) throws Exception {
ArrayList<String> labels = new ArrayList<String>();
for (int i = 0; i < range.length; i++) {
String label = "";
if (i == 0) {
label = "[<=" + range[i] + "]";
}... | [
"public",
"static",
"void",
"groupByRange",
"(",
"double",
"[",
"]",
"range",
",",
"String",
"variable",
",",
"String",
"groupName",
",",
"ArrayList",
"<",
"SurvivalInfo",
">",
"survivalInfoList",
")",
"throws",
"Exception",
"{",
"ArrayList",
"<",
"String",
">... | Need to allow a range of values similar to cut in R and a continuous c
@param range
@param variable
@param groupName
@param survivalInfoList
@throws Exception | [
"Need",
"to",
"allow",
"a",
"range",
"of",
"values",
"similar",
"to",
"cut",
"in",
"R",
"and",
"a",
"continuous",
"c"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java#L172-L220 |
31,530 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java | SymmetryTools.grayOutCEOrig | public static Matrix grayOutCEOrig(Atom[] ca2, int rows, int cols,
CECalculator calculator, Matrix origM, int blankWindowSize,
double[] gradientPolyCoeff, double gradientExpCoeff) {
if (origM == null) {
origM = new Matrix(calculator.getMatMatrix());
}
// symmetry hack, disable main diagonal
for (int... | java | public static Matrix grayOutCEOrig(Atom[] ca2, int rows, int cols,
CECalculator calculator, Matrix origM, int blankWindowSize,
double[] gradientPolyCoeff, double gradientExpCoeff) {
if (origM == null) {
origM = new Matrix(calculator.getMatMatrix());
}
// symmetry hack, disable main diagonal
for (int... | [
"public",
"static",
"Matrix",
"grayOutCEOrig",
"(",
"Atom",
"[",
"]",
"ca2",
",",
"int",
"rows",
",",
"int",
"cols",
",",
"CECalculator",
"calculator",
",",
"Matrix",
"origM",
",",
"int",
"blankWindowSize",
",",
"double",
"[",
"]",
"gradientPolyCoeff",
",",
... | Grays out the main diagonal of a duplicated distance matrix.
@param ca2
@param rows
Number of rows
@param cols
Number of original columns
@param calculator
Used to get the matrix if origM is null
@param origM
starting matrix. If null, uses
{@link CECalculator#getMatMatrix()}
@param blankWindowSize
Width of section to ... | [
"Grays",
"out",
"the",
"main",
"diagonal",
"of",
"a",
"duplicated",
"distance",
"matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L140-L173 |
31,531 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java | SymmetryTools.buildSymmetryGraph | public static List<List<Integer>> buildSymmetryGraph(List<AFPChain> afps,
Atom[] atoms, boolean undirected) {
List<List<Integer>> graph = new ArrayList<List<Integer>>();
for (int n = 0; n < atoms.length; n++) {
graph.add(new ArrayList<Integer>());
}
for (int k = 0; k < afps.size(); k++) {
for (int i... | java | public static List<List<Integer>> buildSymmetryGraph(List<AFPChain> afps,
Atom[] atoms, boolean undirected) {
List<List<Integer>> graph = new ArrayList<List<Integer>>();
for (int n = 0; n < atoms.length; n++) {
graph.add(new ArrayList<Integer>());
}
for (int k = 0; k < afps.size(); k++) {
for (int i... | [
"public",
"static",
"List",
"<",
"List",
"<",
"Integer",
">",
">",
"buildSymmetryGraph",
"(",
"List",
"<",
"AFPChain",
">",
"afps",
",",
"Atom",
"[",
"]",
"atoms",
",",
"boolean",
"undirected",
")",
"{",
"List",
"<",
"List",
"<",
"Integer",
">>",
"grap... | Converts a set of AFP alignments into a Graph of aligned residues, where
each vertex is a residue and each edge means the connection between the
two residues in one of the alignments.
@param afps
List of AFPChains
@param atoms
Atom array of the symmetric structure
@param undirected
if true, the graph is undirected
@r... | [
"Converts",
"a",
"set",
"of",
"AFP",
"alignments",
"into",
"a",
"Graph",
"of",
"aligned",
"residues",
"where",
"each",
"vertex",
"is",
"a",
"residue",
"and",
"each",
"edge",
"means",
"the",
"connection",
"between",
"the",
"two",
"residues",
"in",
"one",
"o... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L443-L464 |
31,532 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java | SymmetryTools.buildSymmetryGraph | public static Graph<Integer, DefaultEdge> buildSymmetryGraph(
AFPChain selfAlignment) {
Graph<Integer, DefaultEdge> graph = new SimpleGraph<Integer, DefaultEdge>(
DefaultEdge.class);
for (int i = 0; i < selfAlignment.getOptAln().length; i++) {
for (int j = 0; j < selfAlignment.getOptAln()[i][0].length; ... | java | public static Graph<Integer, DefaultEdge> buildSymmetryGraph(
AFPChain selfAlignment) {
Graph<Integer, DefaultEdge> graph = new SimpleGraph<Integer, DefaultEdge>(
DefaultEdge.class);
for (int i = 0; i < selfAlignment.getOptAln().length; i++) {
for (int j = 0; j < selfAlignment.getOptAln()[i][0].length; ... | [
"public",
"static",
"Graph",
"<",
"Integer",
",",
"DefaultEdge",
">",
"buildSymmetryGraph",
"(",
"AFPChain",
"selfAlignment",
")",
"{",
"Graph",
"<",
"Integer",
",",
"DefaultEdge",
">",
"graph",
"=",
"new",
"SimpleGraph",
"<",
"Integer",
",",
"DefaultEdge",
">... | Converts a self alignment into a directed jGraphT of aligned residues,
where each vertex is a residue and each edge means the equivalence
between the two residues in the self-alignment.
@param selfAlignment
AFPChain
@return alignment Graph | [
"Converts",
"a",
"self",
"alignment",
"into",
"a",
"directed",
"jGraphT",
"of",
"aligned",
"residues",
"where",
"each",
"vertex",
"is",
"a",
"residue",
"and",
"each",
"edge",
"means",
"the",
"equivalence",
"between",
"the",
"two",
"residues",
"in",
"the",
"s... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L476-L492 |
31,533 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java | SymmetryTools.divideStructure | public static List<Structure> divideStructure(CeSymmResult symmetry)
throws StructureException {
if (!symmetry.isRefined())
throw new IllegalArgumentException("The symmetry result "
+ "is not refined, repeats cannot be defined");
int order = symmetry.getMultipleAlignment().size();
Atom[] atoms = symm... | java | public static List<Structure> divideStructure(CeSymmResult symmetry)
throws StructureException {
if (!symmetry.isRefined())
throw new IllegalArgumentException("The symmetry result "
+ "is not refined, repeats cannot be defined");
int order = symmetry.getMultipleAlignment().size();
Atom[] atoms = symm... | [
"public",
"static",
"List",
"<",
"Structure",
">",
"divideStructure",
"(",
"CeSymmResult",
"symmetry",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"!",
"symmetry",
".",
"isRefined",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The ... | Method that converts the symmetric units of a structure into different
structures, so that they can be individually visualized.
@param symmetry
CeSymmResult
@throws StructureException
@result List of structures, by repeat index sequentially | [
"Method",
"that",
"converts",
"the",
"symmetric",
"units",
"of",
"a",
"structure",
"into",
"different",
"structures",
"so",
"that",
"they",
"can",
"be",
"individually",
"visualized",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L504-L556 |
31,534 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java | SymmetryTools.fromAFP | public static MultipleAlignment fromAFP(AFPChain symm, Atom[] atoms)
throws StructureException {
if (!symm.getAlgorithmName().contains("symm")) {
throw new IllegalArgumentException(
"The input alignment is not a symmetry alignment.");
}
MultipleAlignmentEnsemble e = new MultipleAlignmentEnsembleImpl(... | java | public static MultipleAlignment fromAFP(AFPChain symm, Atom[] atoms)
throws StructureException {
if (!symm.getAlgorithmName().contains("symm")) {
throw new IllegalArgumentException(
"The input alignment is not a symmetry alignment.");
}
MultipleAlignmentEnsemble e = new MultipleAlignmentEnsembleImpl(... | [
"public",
"static",
"MultipleAlignment",
"fromAFP",
"(",
"AFPChain",
"symm",
",",
"Atom",
"[",
"]",
"atoms",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"!",
"symm",
".",
"getAlgorithmName",
"(",
")",
".",
"contains",
"(",
"\"symm\"",
")",
")",
"{... | Converts a refined symmetry AFPChain alignment into the standard
representation of symmetry in a MultipleAlignment, that contains the
entire Atom array of the strcuture and the symmetric repeats are orgaized
in different rows in a single Block.
@param symm
AFPChain created with a symmetry algorithm and refined
@param ... | [
"Converts",
"a",
"refined",
"symmetry",
"AFPChain",
"alignment",
"into",
"the",
"standard",
"representation",
"of",
"symmetry",
"in",
"a",
"MultipleAlignment",
"that",
"contains",
"the",
"entire",
"Atom",
"array",
"of",
"the",
"strcuture",
"and",
"the",
"symmetric... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L651-L693 |
31,535 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java | SymmetryTools.getRepresentativeAtoms | public static Atom[] getRepresentativeAtoms(Structure structure) {
if (structure.isNmr())
return StructureTools.getRepresentativeAtomArray(structure);
else {
// Get Atoms of all models
List<Atom> atomList = new ArrayList<Atom>();
for (int m = 0; m < structure.nrModels(); m++) {
for (Chain c : str... | java | public static Atom[] getRepresentativeAtoms(Structure structure) {
if (structure.isNmr())
return StructureTools.getRepresentativeAtomArray(structure);
else {
// Get Atoms of all models
List<Atom> atomList = new ArrayList<Atom>();
for (int m = 0; m < structure.nrModels(); m++) {
for (Chain c : str... | [
"public",
"static",
"Atom",
"[",
"]",
"getRepresentativeAtoms",
"(",
"Structure",
"structure",
")",
"{",
"if",
"(",
"structure",
".",
"isNmr",
"(",
")",
")",
"return",
"StructureTools",
".",
"getRepresentativeAtomArray",
"(",
"structure",
")",
";",
"else",
"{"... | Returns the representative Atom Array of the first model, if the
structure is NMR, or the Array for each model, if it is a biological
assembly with multiple models.
@param structure
@return representative Atom[] | [
"Returns",
"the",
"representative",
"Atom",
"Array",
"of",
"the",
"first",
"model",
"if",
"the",
"structure",
"is",
"NMR",
"or",
"the",
"Array",
"for",
"each",
"model",
"if",
"it",
"is",
"a",
"biological",
"assembly",
"with",
"multiple",
"models",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L861-L878 |
31,536 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AligNPE.java | AligNPE.align_NPE | public static Alignable align_NPE(Matrix sim,StrucAligParameters params){
//System.out.println("align_NPE");
float gapOpen = params.getGapOpen();
float gapExtension = params.getGapExtension();
int rows = sim.getRowDimension();
int cols = sim.getColumnDimension();
Alignable al = new StrCompAlignment(rows,... | java | public static Alignable align_NPE(Matrix sim,StrucAligParameters params){
//System.out.println("align_NPE");
float gapOpen = params.getGapOpen();
float gapExtension = params.getGapExtension();
int rows = sim.getRowDimension();
int cols = sim.getColumnDimension();
Alignable al = new StrCompAlignment(rows,... | [
"public",
"static",
"Alignable",
"align_NPE",
"(",
"Matrix",
"sim",
",",
"StrucAligParameters",
"params",
")",
"{",
"//System.out.println(\"align_NPE\");",
"float",
"gapOpen",
"=",
"params",
".",
"getGapOpen",
"(",
")",
";",
"float",
"gapExtension",
"=",
"params",
... | Align without penalizing end-gaps. Return alignment and score
@param sim the similarity matrix
@param params the structure alignment parameters to be used
@return an Alignable | [
"Align",
"without",
"penalizing",
"end",
"-",
"gaps",
".",
"Return",
"alignment",
"and",
"score"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AligNPE.java#L43-L84 |
31,537 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentScorer.java | MultipleAlignmentScorer.calculateScores | public static void calculateScores(MultipleAlignment alignment)
throws StructureException {
// Put RMSD
List<Atom[]> trans = MultipleAlignmentTools.transformAtoms(alignment);
alignment.putScore(RMSD, getRMSD(trans));
// Put AvgTM-Score
List<Integer> lengths = new ArrayList<Integer>(alignment.size());
f... | java | public static void calculateScores(MultipleAlignment alignment)
throws StructureException {
// Put RMSD
List<Atom[]> trans = MultipleAlignmentTools.transformAtoms(alignment);
alignment.putScore(RMSD, getRMSD(trans));
// Put AvgTM-Score
List<Integer> lengths = new ArrayList<Integer>(alignment.size());
f... | [
"public",
"static",
"void",
"calculateScores",
"(",
"MultipleAlignment",
"alignment",
")",
"throws",
"StructureException",
"{",
"// Put RMSD",
"List",
"<",
"Atom",
"[",
"]",
">",
"trans",
"=",
"MultipleAlignmentTools",
".",
"transformAtoms",
"(",
"alignment",
")",
... | Calculates and puts the RMSD and the average TM-Score of the
MultipleAlignment.
@param alignment
@throws StructureException
@see #getAvgTMScore(MultipleAlignment)
@see #getRMSD(MultipleAlignment) | [
"Calculates",
"and",
"puts",
"the",
"RMSD",
"and",
"the",
"average",
"TM",
"-",
"Score",
"of",
"the",
"MultipleAlignment",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentScorer.java#L61-L74 |
31,538 | biojava/biojava | biojava-ontology/src/main/java/org/biojava/nbio/ontology/io/TabDelimParser.java | TabDelimParser.parse | public Ontology parse(BufferedReader in, OntologyFactory of)
throws IOException, OntologyException {
String name = "";
String description = "";
Ontology onto = null;
for(
String line = in.readLine();
line != null;
line = in.readLine()
) {
line = line.trim();
if(line.length() > 0) {
if(lin... | java | public Ontology parse(BufferedReader in, OntologyFactory of)
throws IOException, OntologyException {
String name = "";
String description = "";
Ontology onto = null;
for(
String line = in.readLine();
line != null;
line = in.readLine()
) {
line = line.trim();
if(line.length() > 0) {
if(lin... | [
"public",
"Ontology",
"parse",
"(",
"BufferedReader",
"in",
",",
"OntologyFactory",
"of",
")",
"throws",
"IOException",
",",
"OntologyException",
"{",
"String",
"name",
"=",
"\"\"",
";",
"String",
"description",
"=",
"\"\"",
";",
"Ontology",
"onto",
"=",
"null... | Parse an ontology from a reader.
The reader will be emptied of text. It is the caller's responsibility to
close the reader.
@param in the BufferedReader to read from
@param of an OntologyFactory used to create the Ontology instance
@return a new Ontology
@throws IOException if there is some problem with the buffere... | [
"Parse",
"an",
"ontology",
"from",
"a",
"reader",
".",
"The",
"reader",
"will",
"be",
"emptied",
"of",
"text",
".",
"It",
"is",
"the",
"caller",
"s",
"responsibility",
"to",
"close",
"the",
"reader",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ontology/src/main/java/org/biojava/nbio/ontology/io/TabDelimParser.java#L92-L152 |
31,539 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java | AFPChainXMLParser.fromXML | public static AFPChain fromXML(String xml, String name1, String name2, Atom[] ca1, Atom[] ca2) throws IOException, StructureException{
AFPChain[] afps = parseMultiXML( xml);
if ( afps.length > 0 ) {
AFPChain afpChain = afps[0];
String n1 = afpChain.getName1();
String n2 = afpChain.getName2();
i... | java | public static AFPChain fromXML(String xml, String name1, String name2, Atom[] ca1, Atom[] ca2) throws IOException, StructureException{
AFPChain[] afps = parseMultiXML( xml);
if ( afps.length > 0 ) {
AFPChain afpChain = afps[0];
String n1 = afpChain.getName1();
String n2 = afpChain.getName2();
i... | [
"public",
"static",
"AFPChain",
"fromXML",
"(",
"String",
"xml",
",",
"String",
"name1",
",",
"String",
"name2",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"AFPChain",
"[",
"]... | new utility method that checks that the order of the pair in the XML alignment is correct and flips the direction if needed
@param xml
@param name1
@param name1
@param ca1
@param ca2
@return | [
"new",
"utility",
"method",
"that",
"checks",
"that",
"the",
"order",
"of",
"the",
"pair",
"in",
"the",
"XML",
"alignment",
"is",
"correct",
"and",
"flips",
"the",
"direction",
"if",
"needed"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java#L64-L90 |
31,540 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java | AFPChainXMLParser.flipAlignment | public static String flipAlignment(String xml) throws IOException,StructureException{
AFPChain[] afps = parseMultiXML( xml);
if ( afps.length < 1 )
return null;
if ( afps.length == 1) {
AFPChain newChain = AFPChainFlipper.flipChain(afps[0]);
if ( newChain.getAlgorithmName() == null) {
newChain.setAl... | java | public static String flipAlignment(String xml) throws IOException,StructureException{
AFPChain[] afps = parseMultiXML( xml);
if ( afps.length < 1 )
return null;
if ( afps.length == 1) {
AFPChain newChain = AFPChainFlipper.flipChain(afps[0]);
if ( newChain.getAlgorithmName() == null) {
newChain.setAl... | [
"public",
"static",
"String",
"flipAlignment",
"(",
"String",
"xml",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"AFPChain",
"[",
"]",
"afps",
"=",
"parseMultiXML",
"(",
"xml",
")",
";",
"if",
"(",
"afps",
".",
"length",
"<",
"1",
")",
... | Takes an XML representation of the alignment and flips the positions of name1 and name2
@param xml String representing the alignment
@return XML representation of the flipped alignment | [
"Takes",
"an",
"XML",
"representation",
"of",
"the",
"alignment",
"and",
"flips",
"the",
"positions",
"of",
"name1",
"and",
"name2"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java#L125-L138 |
31,541 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java | AFPChainXMLParser.getPositionForPDBresunm | private static int getPositionForPDBresunm(String pdbresnum, String authId , Atom[] atoms){
ResidueNumber residueNumber = ResidueNumber.fromString(pdbresnum);
residueNumber.setChainName(authId);
boolean blankChain = authId == null || authId.equalsIgnoreCase("null") || authId.equals("_");
for ( int i =0; i< a... | java | private static int getPositionForPDBresunm(String pdbresnum, String authId , Atom[] atoms){
ResidueNumber residueNumber = ResidueNumber.fromString(pdbresnum);
residueNumber.setChainName(authId);
boolean blankChain = authId == null || authId.equalsIgnoreCase("null") || authId.equals("_");
for ( int i =0; i< a... | [
"private",
"static",
"int",
"getPositionForPDBresunm",
"(",
"String",
"pdbresnum",
",",
"String",
"authId",
",",
"Atom",
"[",
"]",
"atoms",
")",
"{",
"ResidueNumber",
"residueNumber",
"=",
"ResidueNumber",
".",
"fromString",
"(",
"pdbresnum",
")",
";",
"residueN... | get the position of PDB residue nr X in the ato marray
@param pdbresnum pdbresidue number
@param authId chain name
@param atoms atom array
@return | [
"get",
"the",
"position",
"of",
"PDB",
"residue",
"nr",
"X",
"in",
"the",
"ato",
"marray"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java#L519-L543 |
31,542 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java | SpaceGroup.getTransformations | public List<Matrix4d> getTransformations() {
List<Matrix4d> transfs = new ArrayList<Matrix4d>();
for (int i=1;i<this.transformations.size();i++){
transfs.add(transformations.get(i));
}
return transfs;
} | java | public List<Matrix4d> getTransformations() {
List<Matrix4d> transfs = new ArrayList<Matrix4d>();
for (int i=1;i<this.transformations.size();i++){
transfs.add(transformations.get(i));
}
return transfs;
} | [
"public",
"List",
"<",
"Matrix4d",
">",
"getTransformations",
"(",
")",
"{",
"List",
"<",
"Matrix4d",
">",
"transfs",
"=",
"new",
"ArrayList",
"<",
"Matrix4d",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"this",
".",
"trans... | Gets all transformations except for the identity in crystal axes basis.
@return | [
"Gets",
"all",
"transformations",
"except",
"for",
"the",
"identity",
"in",
"crystal",
"axes",
"basis",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java#L274-L280 |
31,543 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FatCatAligner.java | FatCatAligner.rChainAfp | private static Group[] rChainAfp(FatCatParameters params, AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException{
params.setMaxTra(0);
afpChain.setMaxTra(0);
return chainAfp(params,afpChain,ca1,ca2);
} | java | private static Group[] rChainAfp(FatCatParameters params, AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException{
params.setMaxTra(0);
afpChain.setMaxTra(0);
return chainAfp(params,afpChain,ca1,ca2);
} | [
"private",
"static",
"Group",
"[",
"]",
"rChainAfp",
"(",
"FatCatParameters",
"params",
",",
"AFPChain",
"afpChain",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"throws",
"StructureException",
"{",
"params",
".",
"setMaxTra",
"(",
"0",... | runs rigid chaining process | [
"runs",
"rigid",
"chaining",
"process"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FatCatAligner.java#L125-L129 |
31,544 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FatCatAligner.java | FatCatAligner.chainAfp | private static Group[] chainAfp(FatCatParameters params,AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException{
// we don;t want to rotate input atoms, do we?
Atom[] ca2clone = StructureTools.cloneAtomArray(ca2);
List<AFP> afpSet = afpChain.getAfpSet();
if (debug)
System.out.println("enterin... | java | private static Group[] chainAfp(FatCatParameters params,AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException{
// we don;t want to rotate input atoms, do we?
Atom[] ca2clone = StructureTools.cloneAtomArray(ca2);
List<AFP> afpSet = afpChain.getAfpSet();
if (debug)
System.out.println("enterin... | [
"private",
"static",
"Group",
"[",
"]",
"chainAfp",
"(",
"FatCatParameters",
"params",
",",
"AFPChain",
"afpChain",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"throws",
"StructureException",
"{",
"// we don;t want to rotate input atoms, do we... | run AFP chaining allowing up to maxTra flexible regions.
Input is original coordinates. | [
"run",
"AFP",
"chaining",
"allowing",
"up",
"to",
"maxTra",
"flexible",
"regions",
".",
"Input",
"is",
"original",
"coordinates",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FatCatAligner.java#L136-L221 |
31,545 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankWriter.java | GenbankWriter.process | public void process() throws Exception {
// Loosely based on code from Howard Salis
// TODO - Force lower case?
// boolean closeit = false;
PrintWriter writer = new PrintWriter(os);
for (S sequence : sequences) {
String header = headerFormat.getHeader(sequence);
writer.format(header);
writer.println(... | java | public void process() throws Exception {
// Loosely based on code from Howard Salis
// TODO - Force lower case?
// boolean closeit = false;
PrintWriter writer = new PrintWriter(os);
for (S sequence : sequences) {
String header = headerFormat.getHeader(sequence);
writer.format(header);
writer.println(... | [
"public",
"void",
"process",
"(",
")",
"throws",
"Exception",
"{",
"// Loosely based on code from Howard Salis",
"// TODO - Force lower case?",
"// boolean closeit = false;",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter",
"(",
"os",
")",
";",
"for",
"(",
"S",
"sequ... | Allow an override of operating system line separator for programs that
needs a specific CRLF or CR or LF option
@param lineSeparator | [
"Allow",
"an",
"override",
"of",
"operating",
"system",
"line",
"separator",
"for",
"programs",
"that",
"needs",
"a",
"specific",
"CRLF",
"or",
"CR",
"or",
"LF",
"option"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankWriter.java#L88-L133 |
31,546 | biojava/biojava | biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastOutputProperties.java | NCBIQBlastOutputProperties.getOutputOptions | @Override
public Set<String> getOutputOptions() {
Set<String> result = new HashSet<String>();
for (BlastOutputParameterEnum parameter : param.keySet()) {
result.add(parameter.name());
}
return result;
} | java | @Override
public Set<String> getOutputOptions() {
Set<String> result = new HashSet<String>();
for (BlastOutputParameterEnum parameter : param.keySet()) {
result.add(parameter.name());
}
return result;
} | [
"@",
"Override",
"public",
"Set",
"<",
"String",
">",
"getOutputOptions",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"BlastOutputParameterEnum",
"parameter",
":",
"param",
"."... | Gets output parameters, which are currently set | [
"Gets",
"output",
"parameters",
"which",
"are",
"currently",
"set"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastOutputProperties.java#L97-L104 |
31,547 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/GroupIterator.java | GroupIterator.getCurrentChain | public Chain getCurrentChain(){
if ( current_model_pos >= structure.nrModels()){
return null;
}
List<Chain> model = structure.getModel(current_model_pos);
if ( current_chain_pos >= model.size() ){
return null;
}
return model.get(current_chain_pos);
} | java | public Chain getCurrentChain(){
if ( current_model_pos >= structure.nrModels()){
return null;
}
List<Chain> model = structure.getModel(current_model_pos);
if ( current_chain_pos >= model.size() ){
return null;
}
return model.get(current_chain_pos);
} | [
"public",
"Chain",
"getCurrentChain",
"(",
")",
"{",
"if",
"(",
"current_model_pos",
">=",
"structure",
".",
"nrModels",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"Chain",
">",
"model",
"=",
"structure",
".",
"getModel",
"(",
"current_... | Get the current Chain. Returns null if we are at the end of the iteration.
@return the Chain of the current position | [
"Get",
"the",
"current",
"Chain",
".",
"Returns",
"null",
"if",
"we",
"are",
"at",
"the",
"end",
"of",
"the",
"iteration",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/GroupIterator.java#L141-L154 |
31,548 | biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.roundToDecimals | public final static double roundToDecimals(double d, int c) {
if(c < 0) return d;
double p = Math.pow(10,c);
d = d * p;
double tmp = Math.round(d);
return tmp/p;
} | java | public final static double roundToDecimals(double d, int c) {
if(c < 0) return d;
double p = Math.pow(10,c);
d = d * p;
double tmp = Math.round(d);
return tmp/p;
} | [
"public",
"final",
"static",
"double",
"roundToDecimals",
"(",
"double",
"d",
",",
"int",
"c",
")",
"{",
"if",
"(",
"c",
"<",
"0",
")",
"return",
"d",
";",
"double",
"p",
"=",
"Math",
".",
"pow",
"(",
"10",
",",
"c",
")",
";",
"d",
"=",
"d",
... | Returns a value with the desired number of decimal places.
@param d
value to round
@param c
number of decimal places desired.
Must be greater or equal to zero, otherwise, the given value d would be returned without any modification.
@return
a value with the given number of decimal places. | [
"Returns",
"a",
"value",
"with",
"the",
"desired",
"number",
"of",
"decimal",
"places",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L51-L57 |
31,549 | biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.doesSequenceContainInvalidChar | public final static boolean doesSequenceContainInvalidChar(String sequence, Set<Character> cSet){
for(char c:sequence.toCharArray()){
if(!cSet.contains(c)) return true;
}
return false;
} | java | public final static boolean doesSequenceContainInvalidChar(String sequence, Set<Character> cSet){
for(char c:sequence.toCharArray()){
if(!cSet.contains(c)) return true;
}
return false;
} | [
"public",
"final",
"static",
"boolean",
"doesSequenceContainInvalidChar",
"(",
"String",
"sequence",
",",
"Set",
"<",
"Character",
">",
"cSet",
")",
"{",
"for",
"(",
"char",
"c",
":",
"sequence",
".",
"toCharArray",
"(",
")",
")",
"{",
"if",
"(",
"!",
"c... | Checks if given sequence contains invalid characters. Returns true if invalid characters are found, else return false.
Note that any characters are deemed as valid only if it is found in cSet.
@param sequence
protein sequence to be check.
@param cSet
the set of characters that are deemed valid.
@return
true if invalid... | [
"Checks",
"if",
"given",
"sequence",
"contains",
"invalid",
"characters",
".",
"Returns",
"true",
"if",
"invalid",
"characters",
"are",
"found",
"else",
"return",
"false",
".",
"Note",
"that",
"any",
"characters",
"are",
"deemed",
"as",
"valid",
"only",
"if",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L70-L75 |
31,550 | biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.getNumberOfInvalidChar | public final static int getNumberOfInvalidChar(String sequence, Set<Character> cSet, boolean ignoreCase){
int total = 0;
char[] cArray;
if(ignoreCase) cArray = sequence.toUpperCase().toCharArray();
else cArray = sequence.toCharArray();
if(cSet == null) cSet = PeptideProperties.standardAASet;
for(char c:cArr... | java | public final static int getNumberOfInvalidChar(String sequence, Set<Character> cSet, boolean ignoreCase){
int total = 0;
char[] cArray;
if(ignoreCase) cArray = sequence.toUpperCase().toCharArray();
else cArray = sequence.toCharArray();
if(cSet == null) cSet = PeptideProperties.standardAASet;
for(char c:cArr... | [
"public",
"final",
"static",
"int",
"getNumberOfInvalidChar",
"(",
"String",
"sequence",
",",
"Set",
"<",
"Character",
">",
"cSet",
",",
"boolean",
"ignoreCase",
")",
"{",
"int",
"total",
"=",
"0",
";",
"char",
"[",
"]",
"cArray",
";",
"if",
"(",
"ignore... | Return the number of invalid characters in sequence.
@param sequence
protein sequence to count for invalid characters.
@param cSet
the set of characters that are deemed valid.
@param ignoreCase
indicates if cases should be ignored
@return
the number of invalid characters in sequence. | [
"Return",
"the",
"number",
"of",
"invalid",
"characters",
"in",
"sequence",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L89-L99 |
31,551 | biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.cleanSequence | public final static String cleanSequence(String sequence, Set<Character> cSet){
Set<Character> invalidCharSet = new HashSet<Character>();
StringBuilder cleanSeq = new StringBuilder();
if(cSet == null) cSet = PeptideProperties.standardAASet;
for(char c:sequence.toCharArray()){
if(!cSet.contains(c)){
clean... | java | public final static String cleanSequence(String sequence, Set<Character> cSet){
Set<Character> invalidCharSet = new HashSet<Character>();
StringBuilder cleanSeq = new StringBuilder();
if(cSet == null) cSet = PeptideProperties.standardAASet;
for(char c:sequence.toCharArray()){
if(!cSet.contains(c)){
clean... | [
"public",
"final",
"static",
"String",
"cleanSequence",
"(",
"String",
"sequence",
",",
"Set",
"<",
"Character",
">",
"cSet",
")",
"{",
"Set",
"<",
"Character",
">",
"invalidCharSet",
"=",
"new",
"HashSet",
"<",
"Character",
">",
"(",
")",
";",
"StringBuil... | Returns a new sequence with all invalid characters being replaced by '-'.
Note that any character outside of the 20 standard protein amino acid codes are considered as invalid.
@param sequence
protein sequence to be clean
@param cSet
user defined characters that are valid. Can be null. If null, then 20 standard protei... | [
"Returns",
"a",
"new",
"sequence",
"with",
"all",
"invalid",
"characters",
"being",
"replaced",
"by",
"-",
".",
"Note",
"that",
"any",
"character",
"outside",
"of",
"the",
"20",
"standard",
"protein",
"amino",
"acid",
"codes",
"are",
"considered",
"as",
"inv... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L112-L135 |
31,552 | biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.checkSequence | public static final String checkSequence(String sequence, Set<Character> cSet){
boolean containInvalid = false;
if(cSet != null){
containInvalid = sequence != null && doesSequenceContainInvalidChar(sequence, cSet);
}else{
containInvalid = sequence != null && doesSequenceContainInvalidChar(sequence, PeptideP... | java | public static final String checkSequence(String sequence, Set<Character> cSet){
boolean containInvalid = false;
if(cSet != null){
containInvalid = sequence != null && doesSequenceContainInvalidChar(sequence, cSet);
}else{
containInvalid = sequence != null && doesSequenceContainInvalidChar(sequence, PeptideP... | [
"public",
"static",
"final",
"String",
"checkSequence",
"(",
"String",
"sequence",
",",
"Set",
"<",
"Character",
">",
"cSet",
")",
"{",
"boolean",
"containInvalid",
"=",
"false",
";",
"if",
"(",
"cSet",
"!=",
"null",
")",
"{",
"containInvalid",
"=",
"seque... | Checks if the sequence contains invalid characters.
Note that any character outside of the 20 standard protein amino acid codes are considered as invalid.
If yes, it will return a new sequence where invalid characters are replaced with '-'.
If no, it will simply return the input sequence.
@param sequence
protein seque... | [
"Checks",
"if",
"the",
"sequence",
"contains",
"invalid",
"characters",
".",
"Note",
"that",
"any",
"character",
"outside",
"of",
"the",
"20",
"standard",
"protein",
"amino",
"acid",
"codes",
"are",
"considered",
"as",
"invalid",
".",
"If",
"yes",
"it",
"wil... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L165-L182 |
31,553 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java | FastaReaderHelper.readFastaProteinSequence | public static LinkedHashMap<String, ProteinSequence> readFastaProteinSequence(
File file) throws IOException {
FileInputStream inStream = new FileInputStream(file);
LinkedHashMap<String, ProteinSequence> proteinSequences = readFastaProteinSequence(inStream);
inStream.close();
return proteinSequences;
} | java | public static LinkedHashMap<String, ProteinSequence> readFastaProteinSequence(
File file) throws IOException {
FileInputStream inStream = new FileInputStream(file);
LinkedHashMap<String, ProteinSequence> proteinSequences = readFastaProteinSequence(inStream);
inStream.close();
return proteinSequences;
} | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"ProteinSequence",
">",
"readFastaProteinSequence",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"inStream",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"LinkedHashMap",... | Read a fasta file containing amino acids with setup that would handle most
cases.
@param file
@return
@throws IOException | [
"Read",
"a",
"fasta",
"file",
"containing",
"amino",
"acids",
"with",
"setup",
"that",
"would",
"handle",
"most",
"cases",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java#L109-L115 |
31,554 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java | FastaReaderHelper.readFastaProteinSequence | public static LinkedHashMap<String, ProteinSequence> readFastaProteinSequence(
InputStream inStream) throws IOException {
FastaReader<ProteinSequence, AminoAcidCompound> fastaReader = new FastaReader<ProteinSequence, AminoAcidCompound>(
inStream,
new GenericFastaHeaderParser<ProteinSequence, AminoAcidCompo... | java | public static LinkedHashMap<String, ProteinSequence> readFastaProteinSequence(
InputStream inStream) throws IOException {
FastaReader<ProteinSequence, AminoAcidCompound> fastaReader = new FastaReader<ProteinSequence, AminoAcidCompound>(
inStream,
new GenericFastaHeaderParser<ProteinSequence, AminoAcidCompo... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"ProteinSequence",
">",
"readFastaProteinSequence",
"(",
"InputStream",
"inStream",
")",
"throws",
"IOException",
"{",
"FastaReader",
"<",
"ProteinSequence",
",",
"AminoAcidCompound",
">",
"fastaReader",
"=",
"n... | Read a fasta file containing amino acids with setup that would handle most
cases. User is responsible for closing InputStream because you opened it
@param inStream
@return
@throws IOException | [
"Read",
"a",
"fasta",
"file",
"containing",
"amino",
"acids",
"with",
"setup",
"that",
"would",
"handle",
"most",
"cases",
".",
"User",
"is",
"responsible",
"for",
"closing",
"InputStream",
"because",
"you",
"opened",
"it"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java#L125-L132 |
31,555 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java | FastaReaderHelper.readFastaDNASequence | public static LinkedHashMap<String, DNASequence> readFastaDNASequence(
InputStream inStream) throws IOException {
FastaReader<DNASequence, NucleotideCompound> fastaReader = new FastaReader<DNASequence, NucleotideCompound>(
inStream,
new GenericFastaHeaderParser<DNASequence, NucleotideCompound>(),
new D... | java | public static LinkedHashMap<String, DNASequence> readFastaDNASequence(
InputStream inStream) throws IOException {
FastaReader<DNASequence, NucleotideCompound> fastaReader = new FastaReader<DNASequence, NucleotideCompound>(
inStream,
new GenericFastaHeaderParser<DNASequence, NucleotideCompound>(),
new D... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"DNASequence",
">",
"readFastaDNASequence",
"(",
"InputStream",
"inStream",
")",
"throws",
"IOException",
"{",
"FastaReader",
"<",
"DNASequence",
",",
"NucleotideCompound",
">",
"fastaReader",
"=",
"new",
"Fas... | Read a fasta DNA sequence
@param inStream
@return
@throws IOException | [
"Read",
"a",
"fasta",
"DNA",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java#L140-L147 |
31,556 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java | FastaReaderHelper.readFastaRNASequence | public static LinkedHashMap<String, RNASequence> readFastaRNASequence(
InputStream inStream) throws IOException {
FastaReader<RNASequence, NucleotideCompound> fastaReader = new FastaReader<RNASequence, NucleotideCompound>(
inStream,
new GenericFastaHeaderParser<RNASequence, NucleotideCompound>(),
new R... | java | public static LinkedHashMap<String, RNASequence> readFastaRNASequence(
InputStream inStream) throws IOException {
FastaReader<RNASequence, NucleotideCompound> fastaReader = new FastaReader<RNASequence, NucleotideCompound>(
inStream,
new GenericFastaHeaderParser<RNASequence, NucleotideCompound>(),
new R... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"RNASequence",
">",
"readFastaRNASequence",
"(",
"InputStream",
"inStream",
")",
"throws",
"IOException",
"{",
"FastaReader",
"<",
"RNASequence",
",",
"NucleotideCompound",
">",
"fastaReader",
"=",
"new",
"Fas... | Read a fasta RNA sequence
@param inStream
@return
@throws IOException | [
"Read",
"a",
"fasta",
"RNA",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FastaReaderHelper.java#L169-L176 |
31,557 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java | ConcurrencyTools.setThreadPoolCPUsFraction | public static void setThreadPoolCPUsFraction(float fraction) {
setThreadPoolSize(Math.max(1, Math.round(fraction * Runtime.getRuntime().availableProcessors())));
} | java | public static void setThreadPoolCPUsFraction(float fraction) {
setThreadPoolSize(Math.max(1, Math.round(fraction * Runtime.getRuntime().availableProcessors())));
} | [
"public",
"static",
"void",
"setThreadPoolCPUsFraction",
"(",
"float",
"fraction",
")",
"{",
"setThreadPoolSize",
"(",
"Math",
".",
"max",
"(",
"1",
",",
"Math",
".",
"round",
"(",
"fraction",
"*",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"availableProce... | Sets thread pool to a given fraction of the available processors.
@param fraction portion of available processors to use in thread pool | [
"Sets",
"thread",
"pool",
"to",
"a",
"given",
"fraction",
"of",
"the",
"available",
"processors",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java#L71-L73 |
31,558 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java | ConcurrencyTools.setThreadPoolSize | public static void setThreadPoolSize(int threads) {
setThreadPool( new ThreadPoolExecutor(threads, threads,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>()));
} | java | public static void setThreadPoolSize(int threads) {
setThreadPool( new ThreadPoolExecutor(threads, threads,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>()));
} | [
"public",
"static",
"void",
"setThreadPoolSize",
"(",
"int",
"threads",
")",
"{",
"setThreadPool",
"(",
"new",
"ThreadPoolExecutor",
"(",
"threads",
",",
"threads",
",",
"0L",
",",
"TimeUnit",
".",
"MILLISECONDS",
",",
"new",
"LinkedBlockingQueue",
"<",
"Runnabl... | Sets thread pool to given size.
@param threads number of threads in pool | [
"Sets",
"thread",
"pool",
"to",
"given",
"size",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java#L94-L100 |
31,559 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java | ConcurrencyTools.shutdownAndAwaitTermination | public static void shutdownAndAwaitTermination() {
shutdown();
if (pool != null) {
try {
// wait a while for existing tasks to terminate
if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
pool.shutdownNow(); // cancel currently executing tasks
// wait a while for tasks to respond to being can... | java | public static void shutdownAndAwaitTermination() {
shutdown();
if (pool != null) {
try {
// wait a while for existing tasks to terminate
if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
pool.shutdownNow(); // cancel currently executing tasks
// wait a while for tasks to respond to being can... | [
"public",
"static",
"void",
"shutdownAndAwaitTermination",
"(",
")",
"{",
"shutdown",
"(",
")",
";",
"if",
"(",
"pool",
"!=",
"null",
")",
"{",
"try",
"{",
"// wait a while for existing tasks to terminate",
"if",
"(",
"!",
"pool",
".",
"awaitTermination",
"(",
... | Closes the thread pool. Waits 1 minute for a clean exit; if necessary, waits another minute for cancellation. | [
"Closes",
"the",
"thread",
"pool",
".",
"Waits",
"1",
"minute",
"for",
"a",
"clean",
"exit",
";",
"if",
"necessary",
"waits",
"another",
"minute",
"for",
"cancellation",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java#L126-L143 |
31,560 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java | ConcurrencyTools.submit | public static<T> Future<T> submit(Callable<T> task, String message) {
logger.debug("Task " + (++tasks) + " submitted to shared thread pool. " + message);
return getThreadPool().submit(task);
} | java | public static<T> Future<T> submit(Callable<T> task, String message) {
logger.debug("Task " + (++tasks) + " submitted to shared thread pool. " + message);
return getThreadPool().submit(task);
} | [
"public",
"static",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"submit",
"(",
"Callable",
"<",
"T",
">",
"task",
",",
"String",
"message",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Task \"",
"+",
"(",
"++",
"tasks",
")",
"+",
"\" submitted to shared threa... | Queues up a task and adds a log entry.
@param <T> type returned from the submitted task
@param task submitted task
@param message logged message
@return future on which the desired value is retrieved by calling get() | [
"Queues",
"up",
"a",
"task",
"and",
"adds",
"a",
"log",
"entry",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java#L153-L156 |
31,561 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/uniprot/UniprotToFasta.java | UniprotToFasta.process | public void process( String uniprotDatFileName,String fastaFileName ) throws Exception{
FileReader fr = new FileReader(uniprotDatFileName);
BufferedReader br = new BufferedReader(fr);
String line = br.readLine();
String id = "";
StringBuffer sequence = new StringBuffer();
ArrayList<ProteinSequence> s... | java | public void process( String uniprotDatFileName,String fastaFileName ) throws Exception{
FileReader fr = new FileReader(uniprotDatFileName);
BufferedReader br = new BufferedReader(fr);
String line = br.readLine();
String id = "";
StringBuffer sequence = new StringBuffer();
ArrayList<ProteinSequence> s... | [
"public",
"void",
"process",
"(",
"String",
"uniprotDatFileName",
",",
"String",
"fastaFileName",
")",
"throws",
"Exception",
"{",
"FileReader",
"fr",
"=",
"new",
"FileReader",
"(",
"uniprotDatFileName",
")",
";",
"BufferedReader",
"br",
"=",
"new",
"BufferedReade... | Convert a Uniprot sequence file to a fasta file. Allows you to download all sequence data for a species
and convert to fasta to be used in a blast database
@param uniprotDatFileName
@param fastaFileName
@throws Exception | [
"Convert",
"a",
"Uniprot",
"sequence",
"file",
"to",
"a",
"fasta",
"file",
".",
"Allows",
"you",
"to",
"download",
"all",
"sequence",
"data",
"for",
"a",
"species",
"and",
"convert",
"to",
"fasta",
"to",
"be",
"used",
"in",
"a",
"blast",
"database"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/uniprot/UniprotToFasta.java#L63-L121 |
31,562 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomIterator.java | AtomIterator.hasNext | @Override
public boolean hasNext() {
// trying to iterate over an empty structure...
if ( group == null)
return false;
// if there is another group ...
if ( current_atom_pos < group.size()-1 ) {
return true ;
} else {
// search through the next groups if they contain an atom
if (groupiter != n... | java | @Override
public boolean hasNext() {
// trying to iterate over an empty structure...
if ( group == null)
return false;
// if there is another group ...
if ( current_atom_pos < group.size()-1 ) {
return true ;
} else {
// search through the next groups if they contain an atom
if (groupiter != n... | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"// trying to iterate over an empty structure...",
"if",
"(",
"group",
"==",
"null",
")",
"return",
"false",
";",
"// if there is another group ...",
"if",
"(",
"current_atom_pos",
"<",
"group",
".",
"s... | Is there a next atom ?
@return true if there is an atom after the current one | [
"Is",
"there",
"a",
"next",
"atom",
"?"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomIterator.java#L111-L140 |
31,563 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomIterator.java | AtomIterator.next | @Override
public Atom next()
throws NoSuchElementException
{
current_atom_pos++ ;
if ( current_atom_pos >= group.size() ) {
if ( groupiter == null ) {
throw new NoSuchElementException("no more atoms found in group!");
}
if ( groupiter.hasNext() ) {
group = groupiter.next() ;
current_atom_po... | java | @Override
public Atom next()
throws NoSuchElementException
{
current_atom_pos++ ;
if ( current_atom_pos >= group.size() ) {
if ( groupiter == null ) {
throw new NoSuchElementException("no more atoms found in group!");
}
if ( groupiter.hasNext() ) {
group = groupiter.next() ;
current_atom_po... | [
"@",
"Override",
"public",
"Atom",
"next",
"(",
")",
"throws",
"NoSuchElementException",
"{",
"current_atom_pos",
"++",
";",
"if",
"(",
"current_atom_pos",
">=",
"group",
".",
"size",
"(",
")",
")",
"{",
"if",
"(",
"groupiter",
"==",
"null",
")",
"{",
"t... | Return next atom.
@return the next Atom
@throws NoSuchElementException if there is no atom after the current one | [
"Return",
"next",
"atom",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomIterator.java#L147-L178 |
31,564 | biojava/biojava | biojava-ws/src/main/java/demo/HmmerDemo.java | HmmerDemo.getUniprot | private static ProteinSequence getUniprot(String uniProtID) throws Exception {
AminoAcidCompoundSet set = AminoAcidCompoundSet.getAminoAcidCompoundSet();
UniprotProxySequenceReader<AminoAcidCompound> uniprotSequence = new UniprotProxySequenceReader<AminoAcidCompound>(uniProtID,set);
ProteinSequence seq = new Pr... | java | private static ProteinSequence getUniprot(String uniProtID) throws Exception {
AminoAcidCompoundSet set = AminoAcidCompoundSet.getAminoAcidCompoundSet();
UniprotProxySequenceReader<AminoAcidCompound> uniprotSequence = new UniprotProxySequenceReader<AminoAcidCompound>(uniProtID,set);
ProteinSequence seq = new Pr... | [
"private",
"static",
"ProteinSequence",
"getUniprot",
"(",
"String",
"uniProtID",
")",
"throws",
"Exception",
"{",
"AminoAcidCompoundSet",
"set",
"=",
"AminoAcidCompoundSet",
".",
"getAminoAcidCompoundSet",
"(",
")",
";",
"UniprotProxySequenceReader",
"<",
"AminoAcidCompo... | Fetch a protein sequence from the UniProt web site
@param uniProtID
@return a Protein Sequence
@throws Exception | [
"Fetch",
"a",
"protein",
"sequence",
"from",
"the",
"UniProt",
"web",
"site"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/demo/HmmerDemo.java#L86-L94 |
31,565 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/SequenceTools.java | SequenceTools.equalLengthSequences | public static boolean equalLengthSequences(ProteinSequence[] sequences) {
for (int i=0; i<sequences.length-1; i++) {
if (sequences[i]==null)
continue;
for (int j=i+1; j<sequences.length; j++) {
if (sequences[j]==null)
continue;
if (sequences[i].getLength() == sequences[j].getLength())
ret... | java | public static boolean equalLengthSequences(ProteinSequence[] sequences) {
for (int i=0; i<sequences.length-1; i++) {
if (sequences[i]==null)
continue;
for (int j=i+1; j<sequences.length; j++) {
if (sequences[j]==null)
continue;
if (sequences[i].getLength() == sequences[j].getLength())
ret... | [
"public",
"static",
"boolean",
"equalLengthSequences",
"(",
"ProteinSequence",
"[",
"]",
"sequences",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sequences",
".",
"length",
"-",
"1",
";",
"i",
"++",
")",
"{",
"if",
"(",
"sequences",
"... | A method to check whether an array of sequences contains at least two sequences having an equal length.
@param sequences the array of {@link org.biojava.nbio.core.sequence.ProteinSequence} sequences
@return true if any two sequences are of an equal length | [
"A",
"method",
"to",
"check",
"whether",
"an",
"array",
"of",
"sequences",
"contains",
"at",
"least",
"two",
"sequences",
"having",
"an",
"equal",
"length",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/SequenceTools.java#L123-L136 |
31,566 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/search/io/SearchIO.java | SearchIO.readResults | private void readResults() throws IOException, ParseException {
factory.setFile(file);
results = factory.createObjects(evalueThreshold);
} | java | private void readResults() throws IOException, ParseException {
factory.setFile(file);
results = factory.createObjects(evalueThreshold);
} | [
"private",
"void",
"readResults",
"(",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"factory",
".",
"setFile",
"(",
"file",
")",
";",
"results",
"=",
"factory",
".",
"createObjects",
"(",
"evalueThreshold",
")",
";",
"}"
] | This method is declared private because it is the default action of constructor
when file exists
@throws java.io.IOException for file access related issues
@throws java.text.ParseException for file format related issues | [
"This",
"method",
"is",
"declared",
"private",
"because",
"it",
"is",
"the",
"default",
"action",
"of",
"constructor",
"when",
"file",
"exists"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/search/io/SearchIO.java#L114-L117 |
31,567 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.formatExonStructure | public static String formatExonStructure(GeneChromosomePosition chromosomePosition ){
if ( chromosomePosition.getOrientation() == '+')
return formatExonStructureForward(chromosomePosition);
return formatExonStructureReverse(chromosomePosition);
} | java | public static String formatExonStructure(GeneChromosomePosition chromosomePosition ){
if ( chromosomePosition.getOrientation() == '+')
return formatExonStructureForward(chromosomePosition);
return formatExonStructureReverse(chromosomePosition);
} | [
"public",
"static",
"String",
"formatExonStructure",
"(",
"GeneChromosomePosition",
"chromosomePosition",
")",
"{",
"if",
"(",
"chromosomePosition",
".",
"getOrientation",
"(",
")",
"==",
"'",
"'",
")",
"return",
"formatExonStructureForward",
"(",
"chromosomePosition",
... | Pretty print the details of a GeneChromosomePosition to a String
@param chromosomePosition
@return | [
"Pretty",
"print",
"the",
"details",
"of",
"a",
"GeneChromosomePosition",
"to",
"a",
"String"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L63-L67 |
31,568 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getCDSLength | public static int getCDSLength(GeneChromosomePosition chromPos) {
List<Integer> exonStarts = chromPos.getExonStarts();
List<Integer> exonEnds = chromPos.getExonEnds();
int cdsStart = chromPos.getCdsStart();
int cdsEnd = chromPos.getCdsEnd();
int codingLength;
if (chromPos.getOrientation().equals('+'))
... | java | public static int getCDSLength(GeneChromosomePosition chromPos) {
List<Integer> exonStarts = chromPos.getExonStarts();
List<Integer> exonEnds = chromPos.getExonEnds();
int cdsStart = chromPos.getCdsStart();
int cdsEnd = chromPos.getCdsEnd();
int codingLength;
if (chromPos.getOrientation().equals('+'))
... | [
"public",
"static",
"int",
"getCDSLength",
"(",
"GeneChromosomePosition",
"chromPos",
")",
"{",
"List",
"<",
"Integer",
">",
"exonStarts",
"=",
"chromPos",
".",
"getExonStarts",
"(",
")",
";",
"List",
"<",
"Integer",
">",
"exonEnds",
"=",
"chromPos",
".",
"g... | Get the length of the CDS in nucleotides.
@param chromPos
@return length of the CDS in nucleotides. | [
"Get",
"the",
"length",
"of",
"the",
"CDS",
"in",
"nucleotides",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L210-L224 |
31,569 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getChromosomePosForCDScoordinate | public static ChromPos getChromosomePosForCDScoordinate(int cdsNucleotidePosition, GeneChromosomePosition chromPos) {
logger.debug(" ? Checking chromosome position for CDS position " + cdsNucleotidePosition);
List<Integer> exonStarts = chromPos.getExonStarts();
List<Integer> exonEnds = chromPos.getExonEnds();
... | java | public static ChromPos getChromosomePosForCDScoordinate(int cdsNucleotidePosition, GeneChromosomePosition chromPos) {
logger.debug(" ? Checking chromosome position for CDS position " + cdsNucleotidePosition);
List<Integer> exonStarts = chromPos.getExonStarts();
List<Integer> exonEnds = chromPos.getExonEnds();
... | [
"public",
"static",
"ChromPos",
"getChromosomePosForCDScoordinate",
"(",
"int",
"cdsNucleotidePosition",
",",
"GeneChromosomePosition",
"chromPos",
")",
"{",
"logger",
".",
"debug",
"(",
"\" ? Checking chromosome position for CDS position \"",
"+",
"cdsNucleotidePosition",
")",... | Maps the position of a CDS nucleotide back to the genome
@param cdsNucleotidePosition
@return a ChromPos object | [
"Maps",
"the",
"position",
"of",
"a",
"CDS",
"nucleotide",
"back",
"to",
"the",
"genome"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L232-L256 |
31,570 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getChromosomalRangesForCDS | public static List<Range<Integer>> getChromosomalRangesForCDS(GeneChromosomePosition chromPos){
if ( chromPos.getOrientation() == '+')
return getCDSExonRangesForward(chromPos,CHROMOSOME);
return getCDSExonRangesReverse(chromPos,CHROMOSOME);
} | java | public static List<Range<Integer>> getChromosomalRangesForCDS(GeneChromosomePosition chromPos){
if ( chromPos.getOrientation() == '+')
return getCDSExonRangesForward(chromPos,CHROMOSOME);
return getCDSExonRangesReverse(chromPos,CHROMOSOME);
} | [
"public",
"static",
"List",
"<",
"Range",
"<",
"Integer",
">",
">",
"getChromosomalRangesForCDS",
"(",
"GeneChromosomePosition",
"chromPos",
")",
"{",
"if",
"(",
"chromPos",
".",
"getOrientation",
"(",
")",
"==",
"'",
"'",
")",
"return",
"getCDSExonRangesForward... | Extracts the boundaries of the coding regions in chromosomal coordinates
@param chromPos
@return | [
"Extracts",
"the",
"boundaries",
"of",
"the",
"coding",
"regions",
"in",
"chromosomal",
"coordinates"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L588-L592 |
31,571 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getCDSPosForChromosomeCoordinate | public static int getCDSPosForChromosomeCoordinate(int coordinate, GeneChromosomePosition chromosomePosition) {
if ( chromosomePosition.getOrientation() == '+')
return getCDSPosForward(coordinate,
chromosomePosition.getExonStarts(),
chromosomePosition.getExonEnds(),
chromosomePosition.getCdsStart()... | java | public static int getCDSPosForChromosomeCoordinate(int coordinate, GeneChromosomePosition chromosomePosition) {
if ( chromosomePosition.getOrientation() == '+')
return getCDSPosForward(coordinate,
chromosomePosition.getExonStarts(),
chromosomePosition.getExonEnds(),
chromosomePosition.getCdsStart()... | [
"public",
"static",
"int",
"getCDSPosForChromosomeCoordinate",
"(",
"int",
"coordinate",
",",
"GeneChromosomePosition",
"chromosomePosition",
")",
"{",
"if",
"(",
"chromosomePosition",
".",
"getOrientation",
"(",
")",
"==",
"'",
"'",
")",
"return",
"getCDSPosForward",... | I have a genomic coordinate, where is it on the mRNA
@param coordinate
@param chromosomePosition
@return | [
"I",
"have",
"a",
"genomic",
"coordinate",
"where",
"is",
"it",
"on",
"the",
"mRNA"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L779-L793 |
31,572 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getCDSPosForward | public static int getCDSPosForward(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds,
int cdsStart, int cdsEnd) {
// the genetic coordinate is not in a coding region
if ( (chromPos < (cdsStart+base) ) || ( chromPos > (cdsEnd+base) ) ) {
logger.debug("The "+format(chromPos)+" position is not in a... | java | public static int getCDSPosForward(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds,
int cdsStart, int cdsEnd) {
// the genetic coordinate is not in a coding region
if ( (chromPos < (cdsStart+base) ) || ( chromPos > (cdsEnd+base) ) ) {
logger.debug("The "+format(chromPos)+" position is not in a... | [
"public",
"static",
"int",
"getCDSPosForward",
"(",
"int",
"chromPos",
",",
"List",
"<",
"Integer",
">",
"exonStarts",
",",
"List",
"<",
"Integer",
">",
"exonEnds",
",",
"int",
"cdsStart",
",",
"int",
"cdsEnd",
")",
"{",
"// the genetic coordinate is not in a co... | Converts the genetic coordinate to the position of the nucleotide on the mRNA sequence for a gene
living on the forward DNA strand.
@param chromPos The genetic coordinate on a chromosome
@param exonStarts The list holding the genetic coordinates pointing to the start positions of the exons (including UTR regions)
@par... | [
"Converts",
"the",
"genetic",
"coordinate",
"to",
"the",
"position",
"of",
"the",
"nucleotide",
"on",
"the",
"mRNA",
"sequence",
"for",
"a",
"gene",
"living",
"on",
"the",
"forward",
"DNA",
"strand",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L809-L840 |
31,573 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getCDSPosReverse | public static int getCDSPosReverse(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds,
int cdsStart, int cdsEnd) {
// the genetic coordinate is not in a coding region
if ( (chromPos < (cdsStart+base)) || ( chromPos > (cdsEnd+base) ) ) {
logger.debug("The "+format(chromPos)+" position is not in a ... | java | public static int getCDSPosReverse(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds,
int cdsStart, int cdsEnd) {
// the genetic coordinate is not in a coding region
if ( (chromPos < (cdsStart+base)) || ( chromPos > (cdsEnd+base) ) ) {
logger.debug("The "+format(chromPos)+" position is not in a ... | [
"public",
"static",
"int",
"getCDSPosReverse",
"(",
"int",
"chromPos",
",",
"List",
"<",
"Integer",
">",
"exonStarts",
",",
"List",
"<",
"Integer",
">",
"exonEnds",
",",
"int",
"cdsStart",
",",
"int",
"cdsEnd",
")",
"{",
"// the genetic coordinate is not in a co... | Converts the genetic coordinate to the position of the nucleotide on the mRNA sequence for a gene
living on the reverse DNA strand.
@param chromPos The genetic coordinate on a chromosome
@param exonStarts The list holding the genetic coordinates pointing to the start positions of the exons (including UTR regions)
@par... | [
"Converts",
"the",
"genetic",
"coordinate",
"to",
"the",
"position",
"of",
"the",
"nucleotide",
"on",
"the",
"mRNA",
"sequence",
"for",
"a",
"gene",
"living",
"on",
"the",
"reverse",
"DNA",
"strand",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L856-L887 |
31,574 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getCDSRegions | public static List<Range<Integer>> getCDSRegions(List<Integer> origExonStarts, List<Integer> origExonEnds, int cdsStart, int cdsEnd) {
// remove exons that are fully landed in UTRs
List<Integer> exonStarts = new ArrayList<Integer>(origExonStarts);
List<Integer> exonEnds = new ArrayList<Integer>(origExonEnds);
... | java | public static List<Range<Integer>> getCDSRegions(List<Integer> origExonStarts, List<Integer> origExonEnds, int cdsStart, int cdsEnd) {
// remove exons that are fully landed in UTRs
List<Integer> exonStarts = new ArrayList<Integer>(origExonStarts);
List<Integer> exonEnds = new ArrayList<Integer>(origExonEnds);
... | [
"public",
"static",
"List",
"<",
"Range",
"<",
"Integer",
">",
">",
"getCDSRegions",
"(",
"List",
"<",
"Integer",
">",
"origExonStarts",
",",
"List",
"<",
"Integer",
">",
"origExonEnds",
",",
"int",
"cdsStart",
",",
"int",
"cdsEnd",
")",
"{",
"// remove ex... | Extracts the exons boundaries in CDS coordinates corresponding to the forward DNA strand.
@param origExonStarts The list holding the genetic coordinates pointing to the start positions of the exons (including UTR regions)
@param origExonEnds The list holding the genetic coordinates pointing to the end positions of the... | [
"Extracts",
"the",
"exons",
"boundaries",
"in",
"CDS",
"coordinates",
"corresponding",
"to",
"the",
"forward",
"DNA",
"strand",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L899-L929 |
31,575 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/UncompressInputStream.java | UncompressInputStream.resetbuf | private int resetbuf(int bit_pos) {
int pos = bit_pos >> 3;
System.arraycopy(data, pos, data, 0, end - pos);
end -= pos;
return 0;
} | java | private int resetbuf(int bit_pos) {
int pos = bit_pos >> 3;
System.arraycopy(data, pos, data, 0, end - pos);
end -= pos;
return 0;
} | [
"private",
"int",
"resetbuf",
"(",
"int",
"bit_pos",
")",
"{",
"int",
"pos",
"=",
"bit_pos",
">>",
"3",
";",
"System",
".",
"arraycopy",
"(",
"data",
",",
"pos",
",",
"data",
",",
"0",
",",
"end",
"-",
"pos",
")",
";",
"end",
"-=",
"pos",
";",
... | Moves the unread data in the buffer to the beginning and resets
the pointers. | [
"Moves",
"the",
"unread",
"data",
"in",
"the",
"buffer",
"to",
"the",
"beginning",
"and",
"resets",
"the",
"pointers",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/UncompressInputStream.java#L368-L373 |
31,576 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/cath/CathFactory.java | CathFactory.getCathDatabase | public static CathDatabase getCathDatabase(String version) {
if (version == null) version = DEFAULT_VERSION;
CathDatabase cath = versions.get(version);
if (cath == null) {
CathInstallation newCath = new CathInstallation();
newCath.setCathVersion(version);
cath = newCath;
}
return cath;
} | java | public static CathDatabase getCathDatabase(String version) {
if (version == null) version = DEFAULT_VERSION;
CathDatabase cath = versions.get(version);
if (cath == null) {
CathInstallation newCath = new CathInstallation();
newCath.setCathVersion(version);
cath = newCath;
}
return cath;
} | [
"public",
"static",
"CathDatabase",
"getCathDatabase",
"(",
"String",
"version",
")",
"{",
"if",
"(",
"version",
"==",
"null",
")",
"version",
"=",
"DEFAULT_VERSION",
";",
"CathDatabase",
"cath",
"=",
"versions",
".",
"get",
"(",
"version",
")",
";",
"if",
... | Returns a CATH database of the specified version.
@param version For example, "3.5.0" | [
"Returns",
"a",
"CATH",
"database",
"of",
"the",
"specified",
"version",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/cath/CathFactory.java#L76-L85 |
31,577 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSuperpositionScorer.java | QuatSuperpositionScorer.calcScores | public static QuatSymmetryScores calcScores(QuatSymmetrySubunits subunits, Matrix4d transformation, List<Integer> permutation) {
QuatSymmetryScores scores = new QuatSymmetryScores();
double minTm = Double.MAX_VALUE;
double maxTm = Double.MIN_VALUE;
double minRmsd = Double.MAX_VALUE;
double maxRmsd = Double.M... | java | public static QuatSymmetryScores calcScores(QuatSymmetrySubunits subunits, Matrix4d transformation, List<Integer> permutation) {
QuatSymmetryScores scores = new QuatSymmetryScores();
double minTm = Double.MAX_VALUE;
double maxTm = Double.MIN_VALUE;
double minRmsd = Double.MAX_VALUE;
double maxRmsd = Double.M... | [
"public",
"static",
"QuatSymmetryScores",
"calcScores",
"(",
"QuatSymmetrySubunits",
"subunits",
",",
"Matrix4d",
"transformation",
",",
"List",
"<",
"Integer",
">",
"permutation",
")",
"{",
"QuatSymmetryScores",
"scores",
"=",
"new",
"QuatSymmetryScores",
"(",
")",
... | Returns minimum, mean, and maximum RMSD and TM-Score for two superimposed sets of subunits
TM score: Yang Zhang and Jeffrey Skolnick, PROTEINS: Structure, Function, and Bioinformatics 57:702–710 (2004)
@param subunits subunits to be scored
@param transformation transformation matrix
@param permutations permutation tha... | [
"Returns",
"minimum",
"mean",
"and",
"maximum",
"RMSD",
"and",
"TM",
"-",
"Score",
"for",
"two",
"superimposed",
"sets",
"of",
"subunits"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSuperpositionScorer.java#L46-L118 |
31,578 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPPostProcessor.java | AFPPostProcessor.combineRmsd | private static double combineRmsd(int b1, int b2, AFPChain afpChain,Atom[] ca1,Atom[] ca2)
{
int i;
int afpn = 0;
int[] afpChainList =afpChain.getAfpChainList();
int[] block2Afp = afpChain.getBlock2Afp();
int[] blockSize = afpChain.getBlockSize();
int[] list = new int[blockSize[b1]+blockSize[... | java | private static double combineRmsd(int b1, int b2, AFPChain afpChain,Atom[] ca1,Atom[] ca2)
{
int i;
int afpn = 0;
int[] afpChainList =afpChain.getAfpChainList();
int[] block2Afp = afpChain.getBlock2Afp();
int[] blockSize = afpChain.getBlockSize();
int[] list = new int[blockSize[b1]+blockSize[... | [
"private",
"static",
"double",
"combineRmsd",
"(",
"int",
"b1",
",",
"int",
"b2",
",",
"AFPChain",
"afpChain",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"{",
"int",
"i",
";",
"int",
"afpn",
"=",
"0",
";",
"int",
"[",
"]",
... | return the rmsd of two blocks | [
"return",
"the",
"rmsd",
"of",
"two",
"blocks"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPPostProcessor.java#L331-L356 |
31,579 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/template/AbstractProfileProfileAligner.java | AbstractProfileProfileAligner.getSubstitutionScore | private int getSubstitutionScore(float[] qv, float[] tv) {
float score = 0.0f;
for (int q = 0; q < qv.length; q++) {
if (qv[q] > 0.0f) {
for (int t = 0; t < tv.length; t++) {
if (tv[t] > 0.0f) {
score += qv[q]*tv[t]*getSubstitutionMatrix().getValue(cslist.get(q), cslist.get(t));
}
}
}
... | java | private int getSubstitutionScore(float[] qv, float[] tv) {
float score = 0.0f;
for (int q = 0; q < qv.length; q++) {
if (qv[q] > 0.0f) {
for (int t = 0; t < tv.length; t++) {
if (tv[t] > 0.0f) {
score += qv[q]*tv[t]*getSubstitutionMatrix().getValue(cslist.get(q), cslist.get(t));
}
}
}
... | [
"private",
"int",
"getSubstitutionScore",
"(",
"float",
"[",
"]",
"qv",
",",
"float",
"[",
"]",
"tv",
")",
"{",
"float",
"score",
"=",
"0.0f",
";",
"for",
"(",
"int",
"q",
"=",
"0",
";",
"q",
"<",
"qv",
".",
"length",
";",
"q",
"++",
")",
"{",
... | helper method that scores alignment of two column vectors | [
"helper",
"method",
"that",
"scores",
"alignment",
"of",
"two",
"column",
"vectors"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/template/AbstractProfileProfileAligner.java#L257-L269 |
31,580 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java | EntityFinder.findUniqueEntities | private static List<EntityInfo> findUniqueEntities(TreeMap<String,EntityInfo> chainIds2entities) {
List<EntityInfo> list = new ArrayList<EntityInfo>();
for (EntityInfo cluster:chainIds2entities.values()) {
boolean present = false;
for (EntityInfo cl:list) {
if (cl==cluster) {
present = true;
b... | java | private static List<EntityInfo> findUniqueEntities(TreeMap<String,EntityInfo> chainIds2entities) {
List<EntityInfo> list = new ArrayList<EntityInfo>();
for (EntityInfo cluster:chainIds2entities.values()) {
boolean present = false;
for (EntityInfo cl:list) {
if (cl==cluster) {
present = true;
b... | [
"private",
"static",
"List",
"<",
"EntityInfo",
">",
"findUniqueEntities",
"(",
"TreeMap",
"<",
"String",
",",
"EntityInfo",
">",
"chainIds2entities",
")",
"{",
"List",
"<",
"EntityInfo",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"EntityInfo",
">",
"(",
")"... | Utility method to obtain a list of unique entities from the chainIds2entities map
@return | [
"Utility",
"method",
"to",
"obtain",
"a",
"list",
"of",
"unique",
"entities",
"from",
"the",
"chainIds2entities",
"map"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java#L103-L118 |
31,581 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java | EntityFinder.createPurelyNonPolyEntities | public static void createPurelyNonPolyEntities(List<List<Chain>> nonPolyModels, List<List<Chain>> waterModels, List<EntityInfo> entities) {
if (nonPolyModels.isEmpty()) return;
// let's find first the max entity id to assign entity ids to the newly found entities
int maxMolId = 0;
if (!entities.isEmpty()) {
... | java | public static void createPurelyNonPolyEntities(List<List<Chain>> nonPolyModels, List<List<Chain>> waterModels, List<EntityInfo> entities) {
if (nonPolyModels.isEmpty()) return;
// let's find first the max entity id to assign entity ids to the newly found entities
int maxMolId = 0;
if (!entities.isEmpty()) {
... | [
"public",
"static",
"void",
"createPurelyNonPolyEntities",
"(",
"List",
"<",
"List",
"<",
"Chain",
">",
">",
"nonPolyModels",
",",
"List",
"<",
"List",
"<",
"Chain",
">",
">",
"waterModels",
",",
"List",
"<",
"EntityInfo",
">",
"entities",
")",
"{",
"if",
... | Given all chains of all models find entities for the nonpolymers and water chains within them,
assigning entity ids, types and descriptions to them. The result is written back to the passed entities List.
@param nonPolyModels
@param waterModels
@param entities | [
"Given",
"all",
"chains",
"of",
"all",
"models",
"find",
"entities",
"for",
"the",
"nonpolymers",
"and",
"water",
"chains",
"within",
"them",
"assigning",
"entity",
"ids",
"types",
"and",
"descriptions",
"to",
"them",
".",
"The",
"result",
"is",
"written",
"... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java#L127-L185 |
31,582 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java | EntityFinder.getProteinSequence | private static ProteinSequence getProteinSequence(String str) {
try {
ProteinSequence s = new ProteinSequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating ProteinSequence",e);
}
return null;
} | java | private static ProteinSequence getProteinSequence(String str) {
try {
ProteinSequence s = new ProteinSequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating ProteinSequence",e);
}
return null;
} | [
"private",
"static",
"ProteinSequence",
"getProteinSequence",
"(",
"String",
"str",
")",
"{",
"try",
"{",
"ProteinSequence",
"s",
"=",
"new",
"ProteinSequence",
"(",
"str",
")",
";",
"return",
"s",
";",
"}",
"catch",
"(",
"CompoundNotFoundException",
"e",
")",... | Returns the ProteinSequence or null if one can't be created
@param str
@return | [
"Returns",
"the",
"ProteinSequence",
"or",
"null",
"if",
"one",
"can",
"t",
"be",
"created"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java#L498-L507 |
31,583 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java | EntityFinder.getDNASequence | private static DNASequence getDNASequence(String str) {
try {
DNASequence s = new DNASequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating DNASequence ",e);
}
return null;
} | java | private static DNASequence getDNASequence(String str) {
try {
DNASequence s = new DNASequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating DNASequence ",e);
}
return null;
} | [
"private",
"static",
"DNASequence",
"getDNASequence",
"(",
"String",
"str",
")",
"{",
"try",
"{",
"DNASequence",
"s",
"=",
"new",
"DNASequence",
"(",
"str",
")",
";",
"return",
"s",
";",
"}",
"catch",
"(",
"CompoundNotFoundException",
"e",
")",
"{",
"logge... | Returns the DNASequence or null if one can't be created
@param str
@return | [
"Returns",
"the",
"DNASequence",
"or",
"null",
"if",
"one",
"can",
"t",
"be",
"created"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java#L514-L523 |
31,584 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java | EntityFinder.getRNASequence | private static RNASequence getRNASequence(String str) {
try {
RNASequence s = new RNASequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating RNASequence ",e);
}
return null;
} | java | private static RNASequence getRNASequence(String str) {
try {
RNASequence s = new RNASequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating RNASequence ",e);
}
return null;
} | [
"private",
"static",
"RNASequence",
"getRNASequence",
"(",
"String",
"str",
")",
"{",
"try",
"{",
"RNASequence",
"s",
"=",
"new",
"RNASequence",
"(",
"str",
")",
";",
"return",
"s",
";",
"}",
"catch",
"(",
"CompoundNotFoundException",
"e",
")",
"{",
"logge... | Returns the RNASequence or null if one can't be created
@param str
@return | [
"Returns",
"the",
"RNASequence",
"or",
"null",
"if",
"one",
"can",
"t",
"be",
"created"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java#L530-L539 |
31,585 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/SystematicSolver.java | SystematicSolver.combineWithTranslation | private void combineWithTranslation(Matrix4d rotation) {
rotation.setTranslation(centroid);
rotation.mul(rotation, centroidInverse);
} | java | private void combineWithTranslation(Matrix4d rotation) {
rotation.setTranslation(centroid);
rotation.mul(rotation, centroidInverse);
} | [
"private",
"void",
"combineWithTranslation",
"(",
"Matrix4d",
"rotation",
")",
"{",
"rotation",
".",
"setTranslation",
"(",
"centroid",
")",
";",
"rotation",
".",
"mul",
"(",
"rotation",
",",
"centroidInverse",
")",
";",
"}"
] | Adds translational component to rotation matrix
@param rotTrans
@param rotation
@return | [
"Adds",
"translational",
"component",
"to",
"rotation",
"matrix"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/SystematicSolver.java#L106-L109 |
31,586 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getAxisAngle4d | public AxisAngle4d getAxisAngle4d() {
return new AxisAngle4d(rotationAxis.getX(),rotationAxis.getY(),rotationAxis.getZ(),theta);
} | java | public AxisAngle4d getAxisAngle4d() {
return new AxisAngle4d(rotationAxis.getX(),rotationAxis.getY(),rotationAxis.getZ(),theta);
} | [
"public",
"AxisAngle4d",
"getAxisAngle4d",
"(",
")",
"{",
"return",
"new",
"AxisAngle4d",
"(",
"rotationAxis",
".",
"getX",
"(",
")",
",",
"rotationAxis",
".",
"getY",
"(",
")",
",",
"rotationAxis",
".",
"getZ",
"(",
")",
",",
"theta",
")",
";",
"}"
] | Returns the rotation axis and angle in a single javax.vecmath.AxisAngle4d object
@return | [
"Returns",
"the",
"rotation",
"axis",
"and",
"angle",
"in",
"a",
"single",
"javax",
".",
"vecmath",
".",
"AxisAngle4d",
"object"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L93-L95 |
31,587 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getRotationMatrix | public Matrix getRotationMatrix(double theta) {
if( rotationAxis == null) {
// special case for pure translational axes
return Matrix.identity(3, 3);
}
double x = rotationAxis.getX();
double y = rotationAxis.getY();
double z = rotationAxis.getZ();
double cos = Math.cos(theta);
double sin = Math.sin(... | java | public Matrix getRotationMatrix(double theta) {
if( rotationAxis == null) {
// special case for pure translational axes
return Matrix.identity(3, 3);
}
double x = rotationAxis.getX();
double y = rotationAxis.getY();
double z = rotationAxis.getZ();
double cos = Math.cos(theta);
double sin = Math.sin(... | [
"public",
"Matrix",
"getRotationMatrix",
"(",
"double",
"theta",
")",
"{",
"if",
"(",
"rotationAxis",
"==",
"null",
")",
"{",
"// special case for pure translational axes",
"return",
"Matrix",
".",
"identity",
"(",
"3",
",",
"3",
")",
";",
"}",
"double",
"x",
... | Get the rotation matrix corresponding to a rotation about this axis
@param theta The amount to rotate
@return A 3x3 rotation matrix | [
"Get",
"the",
"rotation",
"matrix",
"corresponding",
"to",
"a",
"rotation",
"about",
"this",
"axis"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L187-L203 |
31,588 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.calculateTranslationalAxis | private void calculateTranslationalAxis(Matrix rotation, Atom translation) {
// set axis parallel to translation
rotationAxis = Calc.scale(translation, 1./Calc.amount(translation));
// position is undefined
rotationPos = null;
screwTranslation = translation;
otherTranslation = new AtomImpl();
otherTrans... | java | private void calculateTranslationalAxis(Matrix rotation, Atom translation) {
// set axis parallel to translation
rotationAxis = Calc.scale(translation, 1./Calc.amount(translation));
// position is undefined
rotationPos = null;
screwTranslation = translation;
otherTranslation = new AtomImpl();
otherTrans... | [
"private",
"void",
"calculateTranslationalAxis",
"(",
"Matrix",
"rotation",
",",
"Atom",
"translation",
")",
"{",
"// set axis parallel to translation",
"rotationAxis",
"=",
"Calc",
".",
"scale",
"(",
"translation",
",",
"1.",
"/",
"Calc",
".",
"amount",
"(",
"tra... | Handle cases with small angles of rotation
@param rotation
@param translation | [
"Handle",
"cases",
"with",
"small",
"angles",
"of",
"rotation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L352-L362 |
31,589 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getProjectedPoint | public Atom getProjectedPoint(Atom point) {
if(rotationPos == null) {
// translation only
return null;
}
Atom localPoint = Calc.subtract(point, rotationPos);
double dot = Calc.scalarProduct(localPoint, rotationAxis);
Atom localProjected = Calc.scale(rotationAxis, dot);
Atom projected = Calc.add(loca... | java | public Atom getProjectedPoint(Atom point) {
if(rotationPos == null) {
// translation only
return null;
}
Atom localPoint = Calc.subtract(point, rotationPos);
double dot = Calc.scalarProduct(localPoint, rotationAxis);
Atom localProjected = Calc.scale(rotationAxis, dot);
Atom projected = Calc.add(loca... | [
"public",
"Atom",
"getProjectedPoint",
"(",
"Atom",
"point",
")",
"{",
"if",
"(",
"rotationPos",
"==",
"null",
")",
"{",
"// translation only",
"return",
"null",
";",
"}",
"Atom",
"localPoint",
"=",
"Calc",
".",
"subtract",
"(",
"point",
",",
"rotationPos",
... | Projects a given point onto the axis of rotation
@param point
@return An atom which lies on the axis, or null if the RotationAxis is purely translational | [
"Projects",
"a",
"given",
"point",
"onto",
"the",
"axis",
"of",
"rotation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L504-L516 |
31,590 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getProjectedDistance | public double getProjectedDistance(Atom point) {
Atom projected = getProjectedPoint(point);
if( projected == null) {
// translation only
return Double.NaN;
}
return Calc.getDistance(point, projected);
} | java | public double getProjectedDistance(Atom point) {
Atom projected = getProjectedPoint(point);
if( projected == null) {
// translation only
return Double.NaN;
}
return Calc.getDistance(point, projected);
} | [
"public",
"double",
"getProjectedDistance",
"(",
"Atom",
"point",
")",
"{",
"Atom",
"projected",
"=",
"getProjectedPoint",
"(",
"point",
")",
";",
"if",
"(",
"projected",
"==",
"null",
")",
"{",
"// translation only",
"return",
"Double",
".",
"NaN",
";",
"}"... | Get the distance from a point to the axis of rotation
@param point
@return The distance to the axis, or NaN if the RotationAxis is purely translational | [
"Get",
"the",
"distance",
"from",
"a",
"point",
"to",
"the",
"axis",
"of",
"rotation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L523-L533 |
31,591 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getAngle | public static double getAngle(AFPChain afpChain) throws StructureException {
if(afpChain.getBlockNum() < 1) {
throw new StructureException("No aligned residues");
}
Matrix rotation = afpChain.getBlockRotationMatrix()[0];
if(rotation == null) {
throw new NullPointerException("AFPChain does not contain a r... | java | public static double getAngle(AFPChain afpChain) throws StructureException {
if(afpChain.getBlockNum() < 1) {
throw new StructureException("No aligned residues");
}
Matrix rotation = afpChain.getBlockRotationMatrix()[0];
if(rotation == null) {
throw new NullPointerException("AFPChain does not contain a r... | [
"public",
"static",
"double",
"getAngle",
"(",
"AFPChain",
"afpChain",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"afpChain",
".",
"getBlockNum",
"(",
")",
"<",
"1",
")",
"{",
"throw",
"new",
"StructureException",
"(",
"\"No aligned residues\"",
")",
... | Calculate the rotation angle for a structure
@param afpChain
@return The rotation angle, in radians
@throws StructureException If the alignment doesn't contain any blocks
@throws NullPointerException If the alignment doesn't have a rotation matrix set | [
"Calculate",
"the",
"rotation",
"angle",
"for",
"a",
"structure"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L561-L571 |
31,592 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getAngle | public static double getAngle(Matrix rotation) {
double c = (rotation.trace()-1)/2.0; //=cos(theta)
// c is sometimes slightly out of the [-1,1] range due to numerical instabilities
if( -1-1e-8 < c && c < -1 ) c = -1;
if( 1+1e-8 > c && c > 1 ) c = 1;
if( -1 > c || c > 1 ) {
throw new IllegalArgumentExcepti... | java | public static double getAngle(Matrix rotation) {
double c = (rotation.trace()-1)/2.0; //=cos(theta)
// c is sometimes slightly out of the [-1,1] range due to numerical instabilities
if( -1-1e-8 < c && c < -1 ) c = -1;
if( 1+1e-8 > c && c > 1 ) c = 1;
if( -1 > c || c > 1 ) {
throw new IllegalArgumentExcepti... | [
"public",
"static",
"double",
"getAngle",
"(",
"Matrix",
"rotation",
")",
"{",
"double",
"c",
"=",
"(",
"rotation",
".",
"trace",
"(",
")",
"-",
"1",
")",
"/",
"2.0",
";",
"//=cos(theta)",
"// c is sometimes slightly out of the [-1,1] range due to numerical instabil... | Calculate the rotation angle for a given matrix
@param rotation Rotation matrix
@return The angle, in radians | [
"Calculate",
"the",
"rotation",
"angle",
"for",
"a",
"given",
"matrix"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L577-L586 |
31,593 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.getAngle | public static double getAngle(Matrix4d transform) {
// Calculate angle
double c = (transform.m00 + transform.m11 + transform.m22 - 1)/2.0; //=cos(theta)
// c is sometimes slightly out of the [-1,1] range due to numerical instabilities
if( -1-1e-8 < c && c < -1 ) c = -1;
if( 1+1e-8 > c && c > 1 ) c = 1;
if( ... | java | public static double getAngle(Matrix4d transform) {
// Calculate angle
double c = (transform.m00 + transform.m11 + transform.m22 - 1)/2.0; //=cos(theta)
// c is sometimes slightly out of the [-1,1] range due to numerical instabilities
if( -1-1e-8 < c && c < -1 ) c = -1;
if( 1+1e-8 > c && c > 1 ) c = 1;
if( ... | [
"public",
"static",
"double",
"getAngle",
"(",
"Matrix4d",
"transform",
")",
"{",
"// Calculate angle",
"double",
"c",
"=",
"(",
"transform",
".",
"m00",
"+",
"transform",
".",
"m11",
"+",
"transform",
".",
"m22",
"-",
"1",
")",
"/",
"2.0",
";",
"//=cos(... | Quickly compute the rotation angle from a rotation matrix.
@param transform 4D transformation matrix. Translation components are ignored.
@return Angle, from 0 to PI | [
"Quickly",
"compute",
"the",
"rotation",
"angle",
"from",
"a",
"rotation",
"matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L601-L611 |
31,594 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractNucleotideCompoundSet.java | AbstractNucleotideCompoundSet.calculateIndirectAmbiguities | @SuppressWarnings("unchecked")
protected void calculateIndirectAmbiguities() {
Map<NucleotideCompound, List<NucleotideCompound>> equivalentsMap = new HashMap<NucleotideCompound, List<NucleotideCompound>>();
List<NucleotideCompound> ambiguousCompounds = new ArrayList<NucleotideCompound>();
for(NucleotideCompound... | java | @SuppressWarnings("unchecked")
protected void calculateIndirectAmbiguities() {
Map<NucleotideCompound, List<NucleotideCompound>> equivalentsMap = new HashMap<NucleotideCompound, List<NucleotideCompound>>();
List<NucleotideCompound> ambiguousCompounds = new ArrayList<NucleotideCompound>();
for(NucleotideCompound... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"calculateIndirectAmbiguities",
"(",
")",
"{",
"Map",
"<",
"NucleotideCompound",
",",
"List",
"<",
"NucleotideCompound",
">",
">",
"equivalentsMap",
"=",
"new",
"HashMap",
"<",
"NucleotideCompo... | Loops through all known nucleotides and attempts to find which are
equivalent to each other. Also takes into account lower casing
nucleotides as well as upper-cased ones. | [
"Loops",
"through",
"all",
"known",
"nucleotides",
"and",
"attempts",
"to",
"find",
"which",
"are",
"equivalent",
"to",
"each",
"other",
".",
"Also",
"takes",
"into",
"account",
"lower",
"casing",
"nucleotides",
"as",
"well",
"as",
"upper",
"-",
"cased",
"on... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractNucleotideCompoundSet.java#L65-L111 |
31,595 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractNucleotideCompoundSet.java | AbstractNucleotideCompoundSet.getAmbiguity | public NucleotideCompound getAmbiguity(NucleotideCompound... compounds) {
Set<NucleotideCompound> settedCompounds = new HashSet<NucleotideCompound>();
for(NucleotideCompound compound: compounds) {
for(NucleotideCompound subCompound: compound.getConstituents()) {
settedCompounds.add(getCompoundForString(subCo... | java | public NucleotideCompound getAmbiguity(NucleotideCompound... compounds) {
Set<NucleotideCompound> settedCompounds = new HashSet<NucleotideCompound>();
for(NucleotideCompound compound: compounds) {
for(NucleotideCompound subCompound: compound.getConstituents()) {
settedCompounds.add(getCompoundForString(subCo... | [
"public",
"NucleotideCompound",
"getAmbiguity",
"(",
"NucleotideCompound",
"...",
"compounds",
")",
"{",
"Set",
"<",
"NucleotideCompound",
">",
"settedCompounds",
"=",
"new",
"HashSet",
"<",
"NucleotideCompound",
">",
"(",
")",
";",
"for",
"(",
"NucleotideCompound",... | Calculates the best symbol for a collection of compounds. For example
if you gave this method a AC it will return a M which is the ambiguity
symbol for these compounds.
@param compounds Compounds to calculate ambiguity for
@return The ambiguity symbol which represents this set of nucleotides best | [
"Calculates",
"the",
"best",
"symbol",
"for",
"a",
"collection",
"of",
"compounds",
".",
"For",
"example",
"if",
"you",
"gave",
"this",
"method",
"a",
"AC",
"it",
"will",
"return",
"a",
"M",
"which",
"is",
"the",
"ambiguity",
"symbol",
"for",
"these",
"c... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractNucleotideCompoundSet.java#L141-L154 |
31,596 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AFPAlignmentDisplay.java | AFPAlignmentDisplay.getBlockNrForAlignPos | public static int getBlockNrForAlignPos(AFPChain afpChain, int aligPos){
// moved here from DisplayAFP;
int blockNum = afpChain.getBlockNum();
int[] optLen = afpChain.getOptLen();
int[][][] optAln = afpChain.getOptAln();
int len = 0;
int p1b=0;
int p2b=0;
for(int i = 0; i < blockNum; i ++) {
fo... | java | public static int getBlockNrForAlignPos(AFPChain afpChain, int aligPos){
// moved here from DisplayAFP;
int blockNum = afpChain.getBlockNum();
int[] optLen = afpChain.getOptLen();
int[][][] optAln = afpChain.getOptAln();
int len = 0;
int p1b=0;
int p2b=0;
for(int i = 0; i < blockNum; i ++) {
fo... | [
"public",
"static",
"int",
"getBlockNrForAlignPos",
"(",
"AFPChain",
"afpChain",
",",
"int",
"aligPos",
")",
"{",
"// moved here from DisplayAFP;",
"int",
"blockNum",
"=",
"afpChain",
".",
"getBlockNum",
"(",
")",
";",
"int",
"[",
"]",
"optLen",
"=",
"afpChain",... | get the block number for an aligned position
@param afpChain
@param aligPos
@return | [
"get",
"the",
"block",
"number",
"for",
"an",
"aligned",
"position"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AFPAlignmentDisplay.java#L449-L489 |
31,597 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java | AlternativeAlignment.apairs_from_seed | public void apairs_from_seed(int l,int i, int j){
aligpath = new IndexPair[l];
idx1 = new int[l];
idx2 = new int[l];
for (int x = 0 ; x < l ; x++) {
idx1[x]=i+x;
idx2[x]=j+x;
aligpath[x] = new IndexPair((short)(i+x),(short)(j+x));
}
} | java | public void apairs_from_seed(int l,int i, int j){
aligpath = new IndexPair[l];
idx1 = new int[l];
idx2 = new int[l];
for (int x = 0 ; x < l ; x++) {
idx1[x]=i+x;
idx2[x]=j+x;
aligpath[x] = new IndexPair((short)(i+x),(short)(j+x));
}
} | [
"public",
"void",
"apairs_from_seed",
"(",
"int",
"l",
",",
"int",
"i",
",",
"int",
"j",
")",
"{",
"aligpath",
"=",
"new",
"IndexPair",
"[",
"l",
"]",
";",
"idx1",
"=",
"new",
"int",
"[",
"l",
"]",
";",
"idx2",
"=",
"new",
"int",
"[",
"l",
"]",... | Set apairs according to a seed position.
@param l
@param i
@param j | [
"Set",
"apairs",
"according",
"to",
"a",
"seed",
"position",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L242-L251 |
31,598 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java | AlternativeAlignment.rotateShiftAtoms | private void rotateShiftAtoms(Atom[] ca){
for (int i = 0 ; i < ca.length; i++){
Atom c = ca[i];
Calc.rotate(c,currentRotMatrix);
Calc.shift(c,currentTranMatrix);
//System.out.println("after " + c);
ca[i] = c;
}
//System.out.println("after " + ca[0]);
} | java | private void rotateShiftAtoms(Atom[] ca){
for (int i = 0 ; i < ca.length; i++){
Atom c = ca[i];
Calc.rotate(c,currentRotMatrix);
Calc.shift(c,currentTranMatrix);
//System.out.println("after " + c);
ca[i] = c;
}
//System.out.println("after " + ca[0]);
} | [
"private",
"void",
"rotateShiftAtoms",
"(",
"Atom",
"[",
"]",
"ca",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ca",
".",
"length",
";",
"i",
"++",
")",
"{",
"Atom",
"c",
"=",
"ca",
"[",
"i",
"]",
";",
"Calc",
".",
"rotate",
... | rotate and shift atoms with currentRotMatrix and current Tranmatrix
@param ca | [
"rotate",
"and",
"shift",
"atoms",
"with",
"currentRotMatrix",
"and",
"current",
"Tranmatrix"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L295-L306 |
31,599 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java | AlternativeAlignment.count_gaps | private int count_gaps(int[] i1, int[] i2){
int i0 = i1[0];
int j0 = i2[0];
int gaps = 0;
for (int i =1 ; i<i1.length;i++ ){
if ( Math.abs(i1[i]-i0) != 1 ||
( Math.abs(i2[i]-j0) != 1)){
gaps +=1;
}
i0 = i1[i];
j0 = i2[i];
}
return gaps;
} | java | private int count_gaps(int[] i1, int[] i2){
int i0 = i1[0];
int j0 = i2[0];
int gaps = 0;
for (int i =1 ; i<i1.length;i++ ){
if ( Math.abs(i1[i]-i0) != 1 ||
( Math.abs(i2[i]-j0) != 1)){
gaps +=1;
}
i0 = i1[i];
j0 = i2[i];
}
return gaps;
} | [
"private",
"int",
"count_gaps",
"(",
"int",
"[",
"]",
"i1",
",",
"int",
"[",
"]",
"i2",
")",
"{",
"int",
"i0",
"=",
"i1",
"[",
"0",
"]",
";",
"int",
"j0",
"=",
"i2",
"[",
"0",
"]",
";",
"int",
"gaps",
"=",
"0",
";",
"for",
"(",
"int",
"i"... | Count the number of gaps in an alignment represented by idx1,idx2.
@param i1
@param i2
@return the number of gaps in this alignment | [
"Count",
"the",
"number",
"of",
"gaps",
"in",
"an",
"alignment",
"represented",
"by",
"idx1",
"idx2",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L729-L744 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.