id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
32,000 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java | StructurePairAligner.main | public static void main(String[] args) throws Exception {
// UPDATE THE FOLLOWING LINES TO MATCH YOUR SETUP
PDBFileReader pdbr = new PDBFileReader();
pdbr.setPath("/Users/andreas/WORK/PDB/");
// String pdb1 = "1crl";
// String pdb2 = "1ede";
String pdb1 = "1buz";
String pdb2 = "1ali";
String outputfi... | java | public static void main(String[] args) throws Exception {
// UPDATE THE FOLLOWING LINES TO MATCH YOUR SETUP
PDBFileReader pdbr = new PDBFileReader();
pdbr.setPath("/Users/andreas/WORK/PDB/");
// String pdb1 = "1crl";
// String pdb2 = "1ede";
String pdb1 = "1buz";
String pdb2 = "1ali";
String outputfi... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"// UPDATE THE FOLLOWING LINES TO MATCH YOUR SETUP",
"PDBFileReader",
"pdbr",
"=",
"new",
"PDBFileReader",
"(",
")",
";",
"pdbr",
".",
"setPath",
"(",
"\"/Users/a... | example usage of this class
@param args | [
"example",
"usage",
"of",
"this",
"class"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java#L169-L236 |
32,001 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java | StructurePairAligner.align | public void align(Structure s1, Structure s2) throws StructureException {
align(s1, s2, params);
} | java | public void align(Structure s1, Structure s2) throws StructureException {
align(s1, s2, params);
} | [
"public",
"void",
"align",
"(",
"Structure",
"s1",
",",
"Structure",
"s2",
")",
"throws",
"StructureException",
"{",
"align",
"(",
"s1",
",",
"s2",
",",
"params",
")",
";",
"}"
] | Calculate the alignment between the two full structures with default
parameters
@param s1
@param s2
@throws StructureException | [
"Calculate",
"the",
"alignment",
"between",
"the",
"two",
"full",
"structures",
"with",
"default",
"parameters"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java#L306-L309 |
32,002 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java | StructurePairAligner.align | public void align(Structure s1, Structure s2, StrucAligParameters params)
throws StructureException {
// step 1 convert the structures to Atom Arrays
Atom[] ca1 = getAlignmentAtoms(s1);
Atom[] ca2 = getAlignmentAtoms(s2);
notifyStartingAlignment(s1.getName(), ca1, s2.getName(), ca2);
align(ca1, ca2, para... | java | public void align(Structure s1, Structure s2, StrucAligParameters params)
throws StructureException {
// step 1 convert the structures to Atom Arrays
Atom[] ca1 = getAlignmentAtoms(s1);
Atom[] ca2 = getAlignmentAtoms(s2);
notifyStartingAlignment(s1.getName(), ca1, s2.getName(), ca2);
align(ca1, ca2, para... | [
"public",
"void",
"align",
"(",
"Structure",
"s1",
",",
"Structure",
"s2",
",",
"StrucAligParameters",
"params",
")",
"throws",
"StructureException",
"{",
"// step 1 convert the structures to Atom Arrays",
"Atom",
"[",
"]",
"ca1",
"=",
"getAlignmentAtoms",
"(",
"s1",
... | Calculate the alignment between the two full structures with user
provided parameters
@param s1
@param s2
@param params
@throws StructureException | [
"Calculate",
"the",
"alignment",
"between",
"the",
"two",
"full",
"structures",
"with",
"user",
"provided",
"parameters"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java#L320-L329 |
32,003 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java | StructurePairAligner.align | public void align(Structure s1, String chainId1, Structure s2,
String chainId2) throws StructureException {
align(s1, chainId1, s2, chainId2, params);
} | java | public void align(Structure s1, String chainId1, Structure s2,
String chainId2) throws StructureException {
align(s1, chainId1, s2, chainId2, params);
} | [
"public",
"void",
"align",
"(",
"Structure",
"s1",
",",
"String",
"chainId1",
",",
"Structure",
"s2",
",",
"String",
"chainId2",
")",
"throws",
"StructureException",
"{",
"align",
"(",
"s1",
",",
"chainId1",
",",
"s2",
",",
"chainId2",
",",
"params",
")",
... | Align two chains from the structures. Uses default parameters.
@param s1
@param chainId1
@param s2
@param chainId2 | [
"Align",
"two",
"chains",
"from",
"the",
"structures",
".",
"Uses",
"default",
"parameters",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java#L339-L342 |
32,004 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java | StructurePairAligner.align | public void align(Structure s1, String chainId1, Structure s2,
String chainId2, StrucAligParameters params)
throws StructureException {
reset();
this.params = params;
Chain c1 = s1.getPolyChainByPDB(chainId1);
Chain c2 = s2.getPolyChainByPDB(chainId2);
Structure s3 = new StructureImpl();
s3.addChain... | java | public void align(Structure s1, String chainId1, Structure s2,
String chainId2, StrucAligParameters params)
throws StructureException {
reset();
this.params = params;
Chain c1 = s1.getPolyChainByPDB(chainId1);
Chain c2 = s2.getPolyChainByPDB(chainId2);
Structure s3 = new StructureImpl();
s3.addChain... | [
"public",
"void",
"align",
"(",
"Structure",
"s1",
",",
"String",
"chainId1",
",",
"Structure",
"s2",
",",
"String",
"chainId2",
",",
"StrucAligParameters",
"params",
")",
"throws",
"StructureException",
"{",
"reset",
"(",
")",
";",
"this",
".",
"params",
"=... | Aligns two chains from the structures using user provided parameters.
@param s1
@param chainId1
@param s2
@param chainId2
@param params
@throws StructureException | [
"Aligns",
"two",
"chains",
"from",
"the",
"structures",
"using",
"user",
"provided",
"parameters",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java#L354-L374 |
32,005 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/jmol/JmolPanel.java | JmolPanel.jmolColorByChain | public void jmolColorByChain(){
String script =
"function color_by_chain(objtype, color_list) {"+ String.format("%n") +
""+ String.format("%n") +
" if (color_list) {"+ String.format("%n") +
" if (color_list.type == \"string\") {"+ String.format("%n") +
" color_list = color_list.split(\... | java | public void jmolColorByChain(){
String script =
"function color_by_chain(objtype, color_list) {"+ String.format("%n") +
""+ String.format("%n") +
" if (color_list) {"+ String.format("%n") +
" if (color_list.type == \"string\") {"+ String.format("%n") +
" color_list = color_list.split(\... | [
"public",
"void",
"jmolColorByChain",
"(",
")",
"{",
"String",
"script",
"=",
"\"function color_by_chain(objtype, color_list) {\"",
"+",
"String",
".",
"format",
"(",
"\"%n\"",
")",
"+",
"\"\"",
"+",
"String",
".",
"format",
"(",
"\"%n\"",
")",
"+",
"\"\t\t if (... | assign a custom color to the Jmol chains command. | [
"assign",
"a",
"custom",
"color",
"to",
"the",
"Jmol",
"chains",
"command",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/jmol/JmolPanel.java#L172-L209 |
32,006 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/compound/AminoAcidCompoundSet.java | AminoAcidCompoundSet.addAmbiguousEquivalents | private void addAmbiguousEquivalents(String one, String two, String either) {
Set<AminoAcidCompound> equivalents;
AminoAcidCompound cOne, cTwo, cEither;
equivalents = new HashSet<AminoAcidCompound>();
equivalents.add(cOne = aminoAcidCompoundCache.get(one));
equivalents.add(cTwo = aminoAcidCompoundCache.get(t... | java | private void addAmbiguousEquivalents(String one, String two, String either) {
Set<AminoAcidCompound> equivalents;
AminoAcidCompound cOne, cTwo, cEither;
equivalents = new HashSet<AminoAcidCompound>();
equivalents.add(cOne = aminoAcidCompoundCache.get(one));
equivalents.add(cTwo = aminoAcidCompoundCache.get(t... | [
"private",
"void",
"addAmbiguousEquivalents",
"(",
"String",
"one",
",",
"String",
"two",
",",
"String",
"either",
")",
"{",
"Set",
"<",
"AminoAcidCompound",
">",
"equivalents",
";",
"AminoAcidCompound",
"cOne",
",",
"cTwo",
",",
"cEither",
";",
"equivalents",
... | helper method to initialize the equivalent sets for 2 amino acid compounds and their ambiguity compound | [
"helper",
"method",
"to",
"initialize",
"the",
"equivalent",
"sets",
"for",
"2",
"amino",
"acid",
"compounds",
"and",
"their",
"ambiguity",
"compound"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/compound/AminoAcidCompoundSet.java#L171-L190 |
32,007 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.getNewGroup | private Group getNewGroup(String recordName,Character aminoCode1, long seq_id,String groupCode3) {
Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(groupCode3);
if ( g != null && !g.getChemComp().isEmpty()) {
if ( g instanceof AminoAcidImpl) {
AminoAcidImpl aa = (AminoAcidImpl) g;
aa.setId(... | java | private Group getNewGroup(String recordName,Character aminoCode1, long seq_id,String groupCode3) {
Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(groupCode3);
if ( g != null && !g.getChemComp().isEmpty()) {
if ( g instanceof AminoAcidImpl) {
AminoAcidImpl aa = (AminoAcidImpl) g;
aa.setId(... | [
"private",
"Group",
"getNewGroup",
"(",
"String",
"recordName",
",",
"Character",
"aminoCode1",
",",
"long",
"seq_id",
",",
"String",
"groupCode3",
")",
"{",
"Group",
"g",
"=",
"ChemCompGroupFactory",
".",
"getGroupFromChemCompDictionary",
"(",
"groupCode3",
")",
... | initiate new group, either Hetatom, Nucleotide, or AminoAcid | [
"initiate",
"new",
"group",
"either",
"Hetatom",
"Nucleotide",
"or",
"AminoAcid"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L250-L308 |
32,008 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.isKnownChain | private static Chain isKnownChain(String asymId, List<Chain> chains){
for (int i = 0; i< chains.size();i++){
Chain testchain = chains.get(i);
//System.out.println("comparing chainID >"+chainID+"< against testchain " + i+" >" +testchain.getName()+"<");
if (asymId.equals(testchain.getId())) {
//System.ou... | java | private static Chain isKnownChain(String asymId, List<Chain> chains){
for (int i = 0; i< chains.size();i++){
Chain testchain = chains.get(i);
//System.out.println("comparing chainID >"+chainID+"< against testchain " + i+" >" +testchain.getName()+"<");
if (asymId.equals(testchain.getId())) {
//System.ou... | [
"private",
"static",
"Chain",
"isKnownChain",
"(",
"String",
"asymId",
",",
"List",
"<",
"Chain",
">",
"chains",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chains",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Chain",
"testc... | Test if the given asymId is already present in the list of chains given. If yes, returns the chain
otherwise returns null. | [
"Test",
"if",
"the",
"given",
"asymId",
"is",
"already",
"present",
"in",
"the",
"list",
"of",
"chains",
"given",
".",
"If",
"yes",
"returns",
"the",
"chain",
"otherwise",
"returns",
"null",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L314-L326 |
32,009 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.convertAtom | private Atom convertAtom(AtomSite atom){
Atom a = new AtomImpl();
a.setPDBserial(Integer.parseInt(atom.getId()));
a.setName(atom.getLabel_atom_id());
double x = Double.parseDouble (atom.getCartn_x());
double y = Double.parseDouble (atom.getCartn_y());
double z = Double.parseDouble (atom.getCartn_z());
... | java | private Atom convertAtom(AtomSite atom){
Atom a = new AtomImpl();
a.setPDBserial(Integer.parseInt(atom.getId()));
a.setName(atom.getLabel_atom_id());
double x = Double.parseDouble (atom.getCartn_x());
double y = Double.parseDouble (atom.getCartn_y());
double z = Double.parseDouble (atom.getCartn_z());
... | [
"private",
"Atom",
"convertAtom",
"(",
"AtomSite",
"atom",
")",
"{",
"Atom",
"a",
"=",
"new",
"AtomImpl",
"(",
")",
";",
"a",
".",
"setPDBserial",
"(",
"Integer",
".",
"parseInt",
"(",
"atom",
".",
"getId",
"(",
")",
")",
")",
";",
"a",
".",
"setNa... | Convert a mmCIF AtomSite object to a BioJava Atom object
@param atom the mmmcif AtomSite record
@return an Atom | [
"Convert",
"a",
"mmCIF",
"AtomSite",
"object",
"to",
"a",
"BioJava",
"Atom",
"object"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L549-L587 |
32,010 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.documentStart | @Override
public void documentStart() {
structure = new StructureImpl();
currentChain = null;
currentGroup = null;
currentNmrModelNumber = null;
//atomCount = 0;
allModels = new ArrayList<List<Chain>>();
currentModel = new ArrayList<Chain>();
entities = new ArrayList<Entity>... | java | @Override
public void documentStart() {
structure = new StructureImpl();
currentChain = null;
currentGroup = null;
currentNmrModelNumber = null;
//atomCount = 0;
allModels = new ArrayList<List<Chain>>();
currentModel = new ArrayList<Chain>();
entities = new ArrayList<Entity>... | [
"@",
"Override",
"public",
"void",
"documentStart",
"(",
")",
"{",
"structure",
"=",
"new",
"StructureImpl",
"(",
")",
";",
"currentChain",
"=",
"null",
";",
"currentGroup",
"=",
"null",
";",
"currentNmrModelNumber",
"=",
"null",
";",
"//atomCount \t\t= 0;",... | Start the parsing | [
"Start",
"the",
"parsing"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L652-L682 |
32,011 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.addAncilliaryEntityData | private void addAncilliaryEntityData(StructAsym asym, int entityId, Entity entity, EntityInfo entityInfo) {
// Loop through each of the entity types and add the corresponding data
// We're assuming if data is duplicated between sources it is consistent
// This is a potentially huge assumption...
for (EntitySr... | java | private void addAncilliaryEntityData(StructAsym asym, int entityId, Entity entity, EntityInfo entityInfo) {
// Loop through each of the entity types and add the corresponding data
// We're assuming if data is duplicated between sources it is consistent
// This is a potentially huge assumption...
for (EntitySr... | [
"private",
"void",
"addAncilliaryEntityData",
"(",
"StructAsym",
"asym",
",",
"int",
"entityId",
",",
"Entity",
"entity",
",",
"EntityInfo",
"entityInfo",
")",
"{",
"// Loop through each of the entity types and add the corresponding data",
"// We're assuming if data is duplicated... | Add any extra information to the entity information.
@param asym
@param entityId
@param entity
@param entityInfo | [
"Add",
"any",
"extra",
"information",
"to",
"the",
"entity",
"information",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L1160-L1188 |
32,012 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.addInformationFromESG | private void addInformationFromESG(EntitySrcGen entitySrcInfo, int entityId, EntityInfo c) {
c.setAtcc(entitySrcInfo.getPdbx_gene_src_atcc());
c.setCell(entitySrcInfo.getPdbx_gene_src_cell());
c.setOrganismCommon(entitySrcInfo.getGene_src_common_name());
c.setOrganismScientific(entitySrcInfo.getPdbx_gene_src_sc... | java | private void addInformationFromESG(EntitySrcGen entitySrcInfo, int entityId, EntityInfo c) {
c.setAtcc(entitySrcInfo.getPdbx_gene_src_atcc());
c.setCell(entitySrcInfo.getPdbx_gene_src_cell());
c.setOrganismCommon(entitySrcInfo.getGene_src_common_name());
c.setOrganismScientific(entitySrcInfo.getPdbx_gene_src_sc... | [
"private",
"void",
"addInformationFromESG",
"(",
"EntitySrcGen",
"entitySrcInfo",
",",
"int",
"entityId",
",",
"EntityInfo",
"c",
")",
"{",
"c",
".",
"setAtcc",
"(",
"entitySrcInfo",
".",
"getPdbx_gene_src_atcc",
"(",
")",
")",
";",
"c",
".",
"setCell",
"(",
... | Add the information from an ESG to a compound.
@param entitySrcInfo
@param entityId
@param c | [
"Add",
"the",
"information",
"from",
"an",
"ESG",
"to",
"a",
"compound",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L1196-L1204 |
32,013 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.addInformationFromESN | private void addInformationFromESN(EntitySrcNat esn, int eId, EntityInfo c) {
c.setAtcc(esn.getPdbx_atcc());
c.setCell(esn.getPdbx_cell());
c.setOrganismCommon(esn.getCommon_name());
c.setOrganismScientific(esn.getPdbx_organism_scientific());
c.setOrganismTaxId(esn.getPdbx_ncbi_taxonomy_id());
} | java | private void addInformationFromESN(EntitySrcNat esn, int eId, EntityInfo c) {
c.setAtcc(esn.getPdbx_atcc());
c.setCell(esn.getPdbx_cell());
c.setOrganismCommon(esn.getCommon_name());
c.setOrganismScientific(esn.getPdbx_organism_scientific());
c.setOrganismTaxId(esn.getPdbx_ncbi_taxonomy_id());
} | [
"private",
"void",
"addInformationFromESN",
"(",
"EntitySrcNat",
"esn",
",",
"int",
"eId",
",",
"EntityInfo",
"c",
")",
"{",
"c",
".",
"setAtcc",
"(",
"esn",
".",
"getPdbx_atcc",
"(",
")",
")",
";",
"c",
".",
"setCell",
"(",
"esn",
".",
"getPdbx_cell",
... | Add the information to entity info from ESN.
@param esn
@param eId
@param c | [
"Add",
"the",
"information",
"to",
"entity",
"info",
"from",
"ESN",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L1212-L1220 |
32,014 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.addInfoFromESS | private void addInfoFromESS(EntitySrcSyn ess, int eId, EntityInfo c) {
c.setOrganismCommon(ess.getOrganism_common_name());
c.setOrganismScientific(ess.getOrganism_scientific());
c.setOrganismTaxId(ess.getNcbi_taxonomy_id());
} | java | private void addInfoFromESS(EntitySrcSyn ess, int eId, EntityInfo c) {
c.setOrganismCommon(ess.getOrganism_common_name());
c.setOrganismScientific(ess.getOrganism_scientific());
c.setOrganismTaxId(ess.getNcbi_taxonomy_id());
} | [
"private",
"void",
"addInfoFromESS",
"(",
"EntitySrcSyn",
"ess",
",",
"int",
"eId",
",",
"EntityInfo",
"c",
")",
"{",
"c",
".",
"setOrganismCommon",
"(",
"ess",
".",
"getOrganism_common_name",
"(",
")",
")",
";",
"c",
".",
"setOrganismScientific",
"(",
"ess"... | Add the information from ESS to Entity info.
@param ess
@param eId
@param c | [
"Add",
"the",
"information",
"from",
"ESS",
"to",
"Entity",
"info",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L1227-L1232 |
32,015 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.addSites | private void addSites() {
List<Site> sites = structure.getSites();
if (sites == null) sites = new ArrayList<Site>();
for (StructSiteGen siteGen : structSiteGens) {
// For each StructSiteGen, find the residues involved, if they exist then
String site_id = siteGen.getSite_id(); // multiple could be in same... | java | private void addSites() {
List<Site> sites = structure.getSites();
if (sites == null) sites = new ArrayList<Site>();
for (StructSiteGen siteGen : structSiteGens) {
// For each StructSiteGen, find the residues involved, if they exist then
String site_id = siteGen.getSite_id(); // multiple could be in same... | [
"private",
"void",
"addSites",
"(",
")",
"{",
"List",
"<",
"Site",
">",
"sites",
"=",
"structure",
".",
"getSites",
"(",
")",
";",
"if",
"(",
"sites",
"==",
"null",
")",
"sites",
"=",
"new",
"ArrayList",
"<",
"Site",
">",
"(",
")",
";",
"for",
"(... | Build sites in a BioJava Structure using the original author chain id & residue numbers.
Sites are built from struct_site_gen records that have been parsed. | [
"Build",
"sites",
"in",
"a",
"BioJava",
"Structure",
"using",
"the",
"original",
"author",
"chain",
"id",
"&",
"residue",
"numbers",
".",
"Sites",
"are",
"built",
"from",
"struct_site_gen",
"records",
"that",
"have",
"been",
"parsed",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L2097-L2166 |
32,016 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/JMatrixPanel.java | JMatrixPanel.drawPairs | public void drawPairs(Graphics g){
if ( aligs == null)
return;
int nr = aligs.length;
Graphics2D g2D = (Graphics2D)g;
Stroke oldStroke = g2D.getStroke();
g2D.setStroke(stroke);
Color color;
float hue;
int width = Math.round(scale);
int w2 = width / 2 ;
for (int i = 0; i < aligs.length; i++)... | java | public void drawPairs(Graphics g){
if ( aligs == null)
return;
int nr = aligs.length;
Graphics2D g2D = (Graphics2D)g;
Stroke oldStroke = g2D.getStroke();
g2D.setStroke(stroke);
Color color;
float hue;
int width = Math.round(scale);
int w2 = width / 2 ;
for (int i = 0; i < aligs.length; i++)... | [
"public",
"void",
"drawPairs",
"(",
"Graphics",
"g",
")",
"{",
"if",
"(",
"aligs",
"==",
"null",
")",
"return",
";",
"int",
"nr",
"=",
"aligs",
".",
"length",
";",
"Graphics2D",
"g2D",
"=",
"(",
"Graphics2D",
")",
"g",
";",
"Stroke",
"oldStroke",
"="... | draw alternative alignments
@param g | [
"draw",
"alternative",
"alignments"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/JMatrixPanel.java#L176-L234 |
32,017 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/JMatrixPanel.java | JMatrixPanel.drawBoxes | public void drawBoxes(Graphics g){
if ( fragmentPairs == null )
return;
g.setColor(Color.yellow);
for (int i = 0; i < fragmentPairs.length; i++) {
FragmentPair fp =fragmentPairs[i];
int xp = fp.getPos1();
int yp = fp.getPos2();
int width = Math.round(scale);
g.drawRect(Math.round(xp*scale),... | java | public void drawBoxes(Graphics g){
if ( fragmentPairs == null )
return;
g.setColor(Color.yellow);
for (int i = 0; i < fragmentPairs.length; i++) {
FragmentPair fp =fragmentPairs[i];
int xp = fp.getPos1();
int yp = fp.getPos2();
int width = Math.round(scale);
g.drawRect(Math.round(xp*scale),... | [
"public",
"void",
"drawBoxes",
"(",
"Graphics",
"g",
")",
"{",
"if",
"(",
"fragmentPairs",
"==",
"null",
")",
"return",
";",
"g",
".",
"setColor",
"(",
"Color",
".",
"yellow",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fragmentPair... | draw high scoring fragments that are used for the initial alignment seed
selection
@param g | [
"draw",
"high",
"scoring",
"fragments",
"that",
"are",
"used",
"for",
"the",
"initial",
"alignment",
"seed",
"selection"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/JMatrixPanel.java#L242-L259 |
32,018 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/JMatrixPanel.java | JMatrixPanel.drawDistances | public void drawDistances(Graphics g1){
Graphics2D g = (Graphics2D)g1;
int c = matrix.getRowDimension();
int d = matrix.getColumnDimension();
float scale = getScale();
int width = Math.round(scale);
for (int i = 0; i < c; i++) {
int ipaint = Math.round(i*scale);
for (int j = 0; j < d; j++) {
d... | java | public void drawDistances(Graphics g1){
Graphics2D g = (Graphics2D)g1;
int c = matrix.getRowDimension();
int d = matrix.getColumnDimension();
float scale = getScale();
int width = Math.round(scale);
for (int i = 0; i < c; i++) {
int ipaint = Math.round(i*scale);
for (int j = 0; j < d; j++) {
d... | [
"public",
"void",
"drawDistances",
"(",
"Graphics",
"g1",
")",
"{",
"Graphics2D",
"g",
"=",
"(",
"Graphics2D",
")",
"g1",
";",
"int",
"c",
"=",
"matrix",
".",
"getRowDimension",
"(",
")",
";",
"int",
"d",
"=",
"matrix",
".",
"getColumnDimension",
"(",
... | For each element in matrix, draw it as a colored square or pixel.
The color of a matrix element with value x is specified as
- H: 1-x/scalevalue
- S: saturation
- B: 1-x/scalevalue
@param g1 | [
"For",
"each",
"element",
"in",
"matrix",
"draw",
"it",
"as",
"a",
"colored",
"square",
"or",
"pixel",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/JMatrixPanel.java#L271-L296 |
32,019 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.ABITraceInit | private void ABITraceInit(BufferedInputStream bis) throws IOException{
byte[] bytes = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int b;
while ((b = bis.read()) >= 0)
{
baos.write(b);
}
bis.close(); baos.close();
bytes = baos.toByteArray();
initData(bytes);
} | java | private void ABITraceInit(BufferedInputStream bis) throws IOException{
byte[] bytes = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int b;
while ((b = bis.read()) >= 0)
{
baos.write(b);
}
bis.close(); baos.close();
bytes = baos.toByteArray();
initData(bytes);
} | [
"private",
"void",
"ABITraceInit",
"(",
"BufferedInputStream",
"bis",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"null",
";",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"int",
"b",
";",
"while",... | Helper method for constructors
@param bis - BufferedInputStream
@throws IOException if there is a problem reading from the BufferedInputStream | [
"Helper",
"method",
"for",
"constructors"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L112-L123 |
32,020 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.getTrace | public int[] getTrace (String base) throws CompoundNotFoundException {
if (base.equals("A")) {
return A;
} else if (base.equals("C")) {
return C;
} else if (base.equals("G")) {
return G;
} else if (base.equals("T")) {
return T;
} else {
throw new CompoundNotFoundException("Don't know base: " + ... | java | public int[] getTrace (String base) throws CompoundNotFoundException {
if (base.equals("A")) {
return A;
} else if (base.equals("C")) {
return C;
} else if (base.equals("G")) {
return G;
} else if (base.equals("T")) {
return T;
} else {
throw new CompoundNotFoundException("Don't know base: " + ... | [
"public",
"int",
"[",
"]",
"getTrace",
"(",
"String",
"base",
")",
"throws",
"CompoundNotFoundException",
"{",
"if",
"(",
"base",
".",
"equals",
"(",
"\"A\"",
")",
")",
"{",
"return",
"A",
";",
"}",
"else",
"if",
"(",
"base",
".",
"equals",
"(",
"\"C... | Returns one of the four traces - all of the y-coordinate values,
each of which correspond to a single x-coordinate relative to the
position in the array, so that if element 4 in the array is 972, then
x is 4 and y is 972 for that point.
@param base - the DNA String to retrieve the trace values for
@return an array of ... | [
"Returns",
"one",
"of",
"the",
"four",
"traces",
"-",
"all",
"of",
"the",
"y",
"-",
"coordinate",
"values",
"each",
"of",
"which",
"correspond",
"to",
"a",
"single",
"x",
"-",
"coordinate",
"relative",
"to",
"the",
"position",
"in",
"the",
"array",
"so",... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L193-L205 |
32,021 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.calculateScale | private double calculateScale(int height) {
double newScale = 0.0;
double max = (double) getMaximum();
double ht = (double) height;
newScale = ((ht - 50.0)) / max;
return newScale;
} | java | private double calculateScale(int height) {
double newScale = 0.0;
double max = (double) getMaximum();
double ht = (double) height;
newScale = ((ht - 50.0)) / max;
return newScale;
} | [
"private",
"double",
"calculateScale",
"(",
"int",
"height",
")",
"{",
"double",
"newScale",
"=",
"0.0",
";",
"double",
"max",
"=",
"(",
"double",
")",
"getMaximum",
"(",
")",
";",
"double",
"ht",
"=",
"(",
"double",
")",
"height",
";",
"newScale",
"="... | Returns the scaling factor necessary to allow all of the traces to fit vertically
into the specified space.
@param height - required height in pixels
@return - scaling factor | [
"Returns",
"the",
"scaling",
"factor",
"necessary",
"to",
"allow",
"all",
"of",
"the",
"traces",
"to",
"fit",
"vertically",
"into",
"the",
"specified",
"space",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L322-L328 |
32,022 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.getMaximum | private int getMaximum() {
int max = 0;
for (int x = 0; x <= T.length - 1; x++) {
if (T[x] > max) max = T[x];
if (A[x] > max) max = A[x];
if (C[x] > max) max = C[x];
if (G[x] > max) max = G[x];
}
return max;
} | java | private int getMaximum() {
int max = 0;
for (int x = 0; x <= T.length - 1; x++) {
if (T[x] > max) max = T[x];
if (A[x] > max) max = A[x];
if (C[x] > max) max = C[x];
if (G[x] > max) max = G[x];
}
return max;
} | [
"private",
"int",
"getMaximum",
"(",
")",
"{",
"int",
"max",
"=",
"0",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<=",
"T",
".",
"length",
"-",
"1",
";",
"x",
"++",
")",
"{",
"if",
"(",
"T",
"[",
"x",
"]",
">",
"max",
")",
"max",
... | Get the maximum height of any of the traces. The data is persisted for performance
in the event of multiple calls, but it initialized lazily.
@return - maximum height of any of the traces | [
"Get",
"the",
"maximum",
"height",
"of",
"any",
"of",
"the",
"traces",
".",
"The",
"data",
"is",
"persisted",
"for",
"performance",
"in",
"the",
"event",
"of",
"multiple",
"calls",
"but",
"it",
"initialized",
"lazily",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L336-L345 |
32,023 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.initData | private void initData(byte[] fileData) {
traceData = fileData;
if (isABI()) {
setIndex();
setBasecalls();
setQcalls();
setSeq();
setTraces();
} else throw new IllegalArgumentException("Not a valid ABI file.");
} | java | private void initData(byte[] fileData) {
traceData = fileData;
if (isABI()) {
setIndex();
setBasecalls();
setQcalls();
setSeq();
setTraces();
} else throw new IllegalArgumentException("Not a valid ABI file.");
} | [
"private",
"void",
"initData",
"(",
"byte",
"[",
"]",
"fileData",
")",
"{",
"traceData",
"=",
"fileData",
";",
"if",
"(",
"isABI",
"(",
")",
")",
"{",
"setIndex",
"(",
")",
";",
"setBasecalls",
"(",
")",
";",
"setQcalls",
"(",
")",
";",
"setSeq",
"... | Initialize all of the data fields for this object.
@param fileData - data for object
@throws IllegalArgumentException which will propagate to all of the constructors. | [
"Initialize",
"all",
"of",
"the",
"data",
"fields",
"for",
"this",
"object",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L353-L362 |
32,024 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.setTraces | private void setTraces() {
int pointers[] = new int[4]; //alphabetical, 0=A, 1=C, 2=G, 3=T
int datas[] = new int[4];
char order[] = new char[4];
datas[0] = DATA9;
datas[1] = DATA10;
datas[2] = DATA11;
datas[3] = DATA12;
for (int i = 0; i <= 3; i++) {
order[i] = (char) traceData[FWO + i];
}
for... | java | private void setTraces() {
int pointers[] = new int[4]; //alphabetical, 0=A, 1=C, 2=G, 3=T
int datas[] = new int[4];
char order[] = new char[4];
datas[0] = DATA9;
datas[1] = DATA10;
datas[2] = DATA11;
datas[3] = DATA12;
for (int i = 0; i <= 3; i++) {
order[i] = (char) traceData[FWO + i];
}
for... | [
"private",
"void",
"setTraces",
"(",
")",
"{",
"int",
"pointers",
"[",
"]",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"//alphabetical, 0=A, 1=C, 2=G, 3=T",
"int",
"datas",
"[",
"]",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"char",
"order",
"[",
"]",
"=",
... | Shuffle the pointers to point to the proper spots in the trace, then load the
traces into their arrays. | [
"Shuffle",
"the",
"pointers",
"to",
"point",
"to",
"the",
"proper",
"spots",
"in",
"the",
"trace",
"then",
"load",
"the",
"traces",
"into",
"their",
"arrays",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L368-L427 |
32,025 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.setSeq | private void setSeq() {
char tempseq[] = new char[seqLength];
for (int x = 0; x <= seqLength - 1; ++x) {
tempseq[x] = (char) traceData[PBAS2 + x];
}
sequence = new String(tempseq);
} | java | private void setSeq() {
char tempseq[] = new char[seqLength];
for (int x = 0; x <= seqLength - 1; ++x) {
tempseq[x] = (char) traceData[PBAS2 + x];
}
sequence = new String(tempseq);
} | [
"private",
"void",
"setSeq",
"(",
")",
"{",
"char",
"tempseq",
"[",
"]",
"=",
"new",
"char",
"[",
"seqLength",
"]",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<=",
"seqLength",
"-",
"1",
";",
"++",
"x",
")",
"{",
"tempseq",
"[",
"x",
"... | Fetch the sequence from the trace data. | [
"Fetch",
"the",
"sequence",
"from",
"the",
"trace",
"data",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L432-L438 |
32,026 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.setQcalls | private void setQcalls() {
qCalls = new int[seqLength];
byte[] qq = new byte[seqLength];
getSubArray(qq, PCON);
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(qq));
for (int i = 0; i <= seqLength - 1; ++i) {
try {
qCalls[i] = (int) dis.readByte();
} catch (IOException e)//This sh... | java | private void setQcalls() {
qCalls = new int[seqLength];
byte[] qq = new byte[seqLength];
getSubArray(qq, PCON);
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(qq));
for (int i = 0; i <= seqLength - 1; ++i) {
try {
qCalls[i] = (int) dis.readByte();
} catch (IOException e)//This sh... | [
"private",
"void",
"setQcalls",
"(",
")",
"{",
"qCalls",
"=",
"new",
"int",
"[",
"seqLength",
"]",
";",
"byte",
"[",
"]",
"qq",
"=",
"new",
"byte",
"[",
"seqLength",
"]",
";",
"getSubArray",
"(",
"qq",
",",
"PCON",
")",
";",
"DataInputStream",
"dis",... | Fetch the quality calls from the trace data. | [
"Fetch",
"the",
"quality",
"calls",
"from",
"the",
"trace",
"data",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L443-L456 |
32,027 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.setBasecalls | private void setBasecalls() {
baseCalls = new int[seqLength];
byte[] qq = new byte[seqLength * 2];
getSubArray(qq, PLOC);
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(qq));
for (int i = 0; i <= seqLength - 1; ++i) {
try {
baseCalls[i] = (int) dis.readShort();
} catch (IOExcepti... | java | private void setBasecalls() {
baseCalls = new int[seqLength];
byte[] qq = new byte[seqLength * 2];
getSubArray(qq, PLOC);
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(qq));
for (int i = 0; i <= seqLength - 1; ++i) {
try {
baseCalls[i] = (int) dis.readShort();
} catch (IOExcepti... | [
"private",
"void",
"setBasecalls",
"(",
")",
"{",
"baseCalls",
"=",
"new",
"int",
"[",
"seqLength",
"]",
";",
"byte",
"[",
"]",
"qq",
"=",
"new",
"byte",
"[",
"seqLength",
"*",
"2",
"]",
";",
"getSubArray",
"(",
"qq",
",",
"PLOC",
")",
";",
"DataIn... | Fetch the basecalls from the trace data. | [
"Fetch",
"the",
"basecalls",
"from",
"the",
"trace",
"data",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L461-L474 |
32,028 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.setIndex | private void setIndex() {
int DataCounter, PBASCounter, PLOCCounter, PCONCounter, NumRecords, indexBase;
byte[] RecNameArray = new byte[4];
String RecName;
DataCounter = 0;
PBASCounter = 0;
PLOCCounter = 0;
PCONCounter = 0;
indexBase = getIntAt(absIndexBase + macJunk);
NumRecords = getIntAt(absIndex... | java | private void setIndex() {
int DataCounter, PBASCounter, PLOCCounter, PCONCounter, NumRecords, indexBase;
byte[] RecNameArray = new byte[4];
String RecName;
DataCounter = 0;
PBASCounter = 0;
PLOCCounter = 0;
PCONCounter = 0;
indexBase = getIntAt(absIndexBase + macJunk);
NumRecords = getIntAt(absIndex... | [
"private",
"void",
"setIndex",
"(",
")",
"{",
"int",
"DataCounter",
",",
"PBASCounter",
",",
"PLOCCounter",
",",
"PCONCounter",
",",
"NumRecords",
",",
"indexBase",
";",
"byte",
"[",
"]",
"RecNameArray",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"String",
... | Sets up all of the initial pointers to the important records in TraceData. | [
"Sets",
"up",
"all",
"of",
"the",
"initial",
"pointers",
"to",
"the",
"important",
"records",
"in",
"TraceData",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L479-L534 |
32,029 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.getSubArray | private void getSubArray(byte[] b, int traceDataOffset) {
for (int x = 0; x <= b.length - 1; x++) {
b[x] = traceData[traceDataOffset + x];
}
} | java | private void getSubArray(byte[] b, int traceDataOffset) {
for (int x = 0; x <= b.length - 1; x++) {
b[x] = traceData[traceDataOffset + x];
}
} | [
"private",
"void",
"getSubArray",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"traceDataOffset",
")",
"{",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<=",
"b",
".",
"length",
"-",
"1",
";",
"x",
"++",
")",
"{",
"b",
"[",
"x",
"]",
"=",
"traceDa... | A utility method which fills array b with data from the trace starting at traceDataOffset.
@param b - trace byte array
@param traceDataOffset - starting point | [
"A",
"utility",
"method",
"which",
"fills",
"array",
"b",
"with",
"data",
"from",
"the",
"trace",
"starting",
"at",
"traceDataOffset",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L562-L566 |
32,030 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java | ABITrace.isABI | private boolean isABI() {
char ABI[] = new char[4];
for (int i = 0; i <= 2; i++) {
ABI[i] = (char) traceData[i];
}
if (ABI[0] == 'A' && (ABI[1] == 'B' && ABI[2] == 'I')) {
return true;
} else {
for (int i = 128; i <= 130; i++) {
ABI[i-128] = (char) traceData[i];
}
if (ABI[0] == 'A' && (ABI... | java | private boolean isABI() {
char ABI[] = new char[4];
for (int i = 0; i <= 2; i++) {
ABI[i] = (char) traceData[i];
}
if (ABI[0] == 'A' && (ABI[1] == 'B' && ABI[2] == 'I')) {
return true;
} else {
for (int i = 128; i <= 130; i++) {
ABI[i-128] = (char) traceData[i];
}
if (ABI[0] == 'A' && (ABI... | [
"private",
"boolean",
"isABI",
"(",
")",
"{",
"char",
"ABI",
"[",
"]",
"=",
"new",
"char",
"[",
"4",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<=",
"2",
";",
"i",
"++",
")",
"{",
"ABI",
"[",
"i",
"]",
"=",
"(",
"char",
")",
... | Test to see if the file is ABI format by checking to see that the first three bytes
are "ABI". Also handle the special case where 128 bytes were prepended to the file
due to binary FTP from an older macintosh system.
@return - if format of ABI file is correct | [
"Test",
"to",
"see",
"if",
"the",
"file",
"is",
"ABI",
"format",
"by",
"checking",
"to",
"see",
"that",
"the",
"first",
"three",
"bytes",
"are",
"ABI",
".",
"Also",
"handle",
"the",
"special",
"case",
"where",
"128",
"bytes",
"were",
"prepended",
"to",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/ABITrace.java#L575-L593 |
32,031 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/genename/GeneNamesParser.java | GeneNamesParser.main | public static void main(String[] args) {
try {
List<GeneName> geneNames = getGeneNames();
logger.info("got {} gene names", geneNames.size());
for ( GeneName g : geneNames){
if ( g.getApprovedSymbol().equals("FOLH1"))
logger.info("Gene Name: {}", g);
}
// and returns a list of beans that co... | java | public static void main(String[] args) {
try {
List<GeneName> geneNames = getGeneNames();
logger.info("got {} gene names", geneNames.size());
for ( GeneName g : geneNames){
if ( g.getApprovedSymbol().equals("FOLH1"))
logger.info("Gene Name: {}", g);
}
// and returns a list of beans that co... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"List",
"<",
"GeneName",
">",
"geneNames",
"=",
"getGeneNames",
"(",
")",
";",
"logger",
".",
"info",
"(",
"\"got {} gene names\"",
",",
"geneNames",
".",
"size",
... | parses a file from the genenames website
@param args | [
"parses",
"a",
"file",
"from",
"the",
"genenames",
"website"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/genename/GeneNamesParser.java#L55-L74 |
32,032 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/genename/GeneNamesParser.java | GeneNamesParser.getGeneNames | public static List<GeneName> getGeneNames(InputStream inStream) throws IOException{
ArrayList<GeneName> geneNames = new ArrayList<GeneName>();
BufferedReader reader = new BufferedReader(new InputStreamReader(inStream));
// skip reading first line (it is the legend)
String line = reader.readLine();
while ((... | java | public static List<GeneName> getGeneNames(InputStream inStream) throws IOException{
ArrayList<GeneName> geneNames = new ArrayList<GeneName>();
BufferedReader reader = new BufferedReader(new InputStreamReader(inStream));
// skip reading first line (it is the legend)
String line = reader.readLine();
while ((... | [
"public",
"static",
"List",
"<",
"GeneName",
">",
"getGeneNames",
"(",
"InputStream",
"inStream",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"GeneName",
">",
"geneNames",
"=",
"new",
"ArrayList",
"<",
"GeneName",
">",
"(",
")",
";",
"BufferedReader",... | Get a list of GeneNames from an input stream.
@param inStream
@return list of geneNames
@throws IOException | [
"Get",
"a",
"list",
"of",
"GeneNames",
"from",
"an",
"input",
"stream",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/genename/GeneNamesParser.java#L93-L115 |
32,033 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.addIntronsUsingExons | public void addIntronsUsingExons() throws Exception {
if (intronAdded) { //going to assume introns are correct
return;
}
if (exonSequenceList.size() == 0) {
return;
}
ExonComparator exonComparator = new ExonComparator();
//sort based on start position and sense;
Collections.sort(exonSequenceList, ex... | java | public void addIntronsUsingExons() throws Exception {
if (intronAdded) { //going to assume introns are correct
return;
}
if (exonSequenceList.size() == 0) {
return;
}
ExonComparator exonComparator = new ExonComparator();
//sort based on start position and sense;
Collections.sort(exonSequenceList, ex... | [
"public",
"void",
"addIntronsUsingExons",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"intronAdded",
")",
"{",
"//going to assume introns are correct",
"return",
";",
"}",
"if",
"(",
"exonSequenceList",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return"... | Once everything has been added to the gene sequence where you might have added exon sequences only then you
can infer the intron sequences and add them. You may also have the case where you only added one or more
TranscriptSequences and from that you can infer the exon sequences and intron sequences.
Currently not impl... | [
"Once",
"everything",
"has",
"been",
"added",
"to",
"the",
"gene",
"sequence",
"where",
"you",
"might",
"have",
"added",
"exon",
"sequences",
"only",
"then",
"you",
"can",
"infer",
"the",
"intron",
"sequences",
"and",
"add",
"them",
".",
"You",
"may",
"als... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L96-L131 |
32,034 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.addTranscript | public TranscriptSequence addTranscript(AccessionID accession, int begin, int end) throws Exception {
if (transcriptSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
TranscriptSequence transcriptSequence = new TranscriptSequence(this, begin, ... | java | public TranscriptSequence addTranscript(AccessionID accession, int begin, int end) throws Exception {
if (transcriptSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
TranscriptSequence transcriptSequence = new TranscriptSequence(this, begin, ... | [
"public",
"TranscriptSequence",
"addTranscript",
"(",
"AccessionID",
"accession",
",",
"int",
"begin",
",",
"int",
"end",
")",
"throws",
"Exception",
"{",
"if",
"(",
"transcriptSequenceHashMap",
".",
"containsKey",
"(",
"accession",
".",
"getID",
"(",
")",
")",
... | Add a transcription sequence to a gene which describes a ProteinSequence
@param accession
@param begin
@param end
@return transcript sequence
@throws Exception If the accession id is already used | [
"Add",
"a",
"transcription",
"sequence",
"to",
"a",
"gene",
"which",
"describes",
"a",
"ProteinSequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L184-L192 |
32,035 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.removeIntron | public IntronSequence removeIntron(String accession) {
for (IntronSequence intronSequence : intronSequenceList) {
if (intronSequence.getAccession().getID().equals(accession)) {
intronSequenceList.remove(intronSequence);
intronSequenceHashMap.remove(accession);
return intronSequence;
}
}
return n... | java | public IntronSequence removeIntron(String accession) {
for (IntronSequence intronSequence : intronSequenceList) {
if (intronSequence.getAccession().getID().equals(accession)) {
intronSequenceList.remove(intronSequence);
intronSequenceHashMap.remove(accession);
return intronSequence;
}
}
return n... | [
"public",
"IntronSequence",
"removeIntron",
"(",
"String",
"accession",
")",
"{",
"for",
"(",
"IntronSequence",
"intronSequence",
":",
"intronSequenceList",
")",
"{",
"if",
"(",
"intronSequence",
".",
"getAccession",
"(",
")",
".",
"getID",
"(",
")",
".",
"equ... | Remove the intron by accession
@param accession
@return intron sequence | [
"Remove",
"the",
"intron",
"by",
"accession"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L199-L208 |
32,036 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.addIntron | public IntronSequence addIntron(AccessionID accession, int begin, int end) throws Exception {
if (intronSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
intronAdded = true;
IntronSequence intronSequence = new IntronSequence(this, begin, en... | java | public IntronSequence addIntron(AccessionID accession, int begin, int end) throws Exception {
if (intronSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
intronAdded = true;
IntronSequence intronSequence = new IntronSequence(this, begin, en... | [
"public",
"IntronSequence",
"addIntron",
"(",
"AccessionID",
"accession",
",",
"int",
"begin",
",",
"int",
"end",
")",
"throws",
"Exception",
"{",
"if",
"(",
"intronSequenceHashMap",
".",
"containsKey",
"(",
"accession",
".",
"getID",
"(",
")",
")",
")",
"{"... | Add an Intron Currently used to mark an IntronSequence as a feature
@param accession
@param begin
@param end
@return intron sequence | [
"Add",
"an",
"Intron",
"Currently",
"used",
"to",
"mark",
"an",
"IntronSequence",
"as",
"a",
"feature"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L217-L227 |
32,037 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.removeExon | public ExonSequence removeExon(String accession) {
for (ExonSequence exonSequence : exonSequenceList) {
if (exonSequence.getAccession().getID().equals(accession)) {
exonSequenceList.remove(exonSequence);
exonSequenceHashMap.remove(accession);
// we now have a new gap which creates an intron
intronS... | java | public ExonSequence removeExon(String accession) {
for (ExonSequence exonSequence : exonSequenceList) {
if (exonSequence.getAccession().getID().equals(accession)) {
exonSequenceList.remove(exonSequence);
exonSequenceHashMap.remove(accession);
// we now have a new gap which creates an intron
intronS... | [
"public",
"ExonSequence",
"removeExon",
"(",
"String",
"accession",
")",
"{",
"for",
"(",
"ExonSequence",
"exonSequence",
":",
"exonSequenceList",
")",
"{",
"if",
"(",
"exonSequence",
".",
"getAccession",
"(",
")",
".",
"getID",
"(",
")",
".",
"equals",
"(",... | Remove the exon sequence
@param accession
@return exon sequence | [
"Remove",
"the",
"exon",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L234-L252 |
32,038 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.addExon | public ExonSequence addExon(AccessionID accession, int begin, int end) throws Exception {
if (exonSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
ExonSequence exonSequence = new ExonSequence(this, begin, end); //sense should be the same as... | java | public ExonSequence addExon(AccessionID accession, int begin, int end) throws Exception {
if (exonSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
ExonSequence exonSequence = new ExonSequence(this, begin, end); //sense should be the same as... | [
"public",
"ExonSequence",
"addExon",
"(",
"AccessionID",
"accession",
",",
"int",
"begin",
",",
"int",
"end",
")",
"throws",
"Exception",
"{",
"if",
"(",
"exonSequenceHashMap",
".",
"containsKey",
"(",
"accession",
".",
"getID",
"(",
")",
")",
")",
"{",
"t... | Add an ExonSequence mainly used to mark as a feature
@param accession
@param begin
@param end
@return exon sequence | [
"Add",
"an",
"ExonSequence",
"mainly",
"used",
"to",
"mark",
"as",
"a",
"feature"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L261-L271 |
32,039 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.getSequence5PrimeTo3Prime | public DNASequence getSequence5PrimeTo3Prime() {
String sequence = getSequenceAsString(this.getBioBegin(), this.getBioEnd(), this.getStrand());
if (getStrand() == Strand.NEGATIVE) {
//need to take complement of sequence because it is negative and we are returning the gene sequence from the opposite strand
Str... | java | public DNASequence getSequence5PrimeTo3Prime() {
String sequence = getSequenceAsString(this.getBioBegin(), this.getBioEnd(), this.getStrand());
if (getStrand() == Strand.NEGATIVE) {
//need to take complement of sequence because it is negative and we are returning the gene sequence from the opposite strand
Str... | [
"public",
"DNASequence",
"getSequence5PrimeTo3Prime",
"(",
")",
"{",
"String",
"sequence",
"=",
"getSequenceAsString",
"(",
"this",
".",
"getBioBegin",
"(",
")",
",",
"this",
".",
"getBioEnd",
"(",
")",
",",
"this",
".",
"getStrand",
"(",
")",
")",
";",
"i... | Try to give method clarity where you want a DNASequence coding in the 5' to 3' direction
Returns the DNASequence representative of the 5' and 3' reading based on strand
@return dna sequence | [
"Try",
"to",
"give",
"method",
"clarity",
"where",
"you",
"want",
"a",
"DNASequence",
"coding",
"in",
"the",
"5",
"to",
"3",
"direction",
"Returns",
"the",
"DNASequence",
"representative",
"of",
"the",
"5",
"and",
"3",
"reading",
"based",
"on",
"strand"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L294-L316 |
32,040 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/PDBHeader.java | PDBHeader.toPDB | @Override
public void toPDB(StringBuffer buf){
// 1 2 3 4 5 6 7
//01234567890123456789012345678901234567890123456789012345678901234567890123456789
//HEADER COMPLEX (SERINE PROTEASE/INHIBITORS) 06-FEB-98 1A4W
//TITLE CRYSTAL STRUCTURES OF THRO... | java | @Override
public void toPDB(StringBuffer buf){
// 1 2 3 4 5 6 7
//01234567890123456789012345678901234567890123456789012345678901234567890123456789
//HEADER COMPLEX (SERINE PROTEASE/INHIBITORS) 06-FEB-98 1A4W
//TITLE CRYSTAL STRUCTURES OF THRO... | [
"@",
"Override",
"public",
"void",
"toPDB",
"(",
"StringBuffer",
"buf",
")",
"{",
"// 1 2 3 4 5 6 7",
"//01234567890123456789012345678901234567890123456789012345678901234567890123456789",
"//HEADER COMPLEX (SERINE PROTEASE/INHIBITOR... | Appends a PDB representation of the PDB header to the provided StringBuffer
@param buf | [
"Appends",
"a",
"PDB",
"representation",
"of",
"the",
"PDB",
"header",
"to",
"the",
"provided",
"StringBuffer"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBHeader.java#L151-L165 |
32,041 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/PDBHeader.java | PDBHeader.setExperimentalTechnique | public boolean setExperimentalTechnique(String techniqueStr) {
ExperimentalTechnique et = ExperimentalTechnique.getByName(techniqueStr);
if (et==null) return false;
if (techniques==null) {
techniques = EnumSet.of(et);
return true;
} else {
return techniques.add(et);
}
} | java | public boolean setExperimentalTechnique(String techniqueStr) {
ExperimentalTechnique et = ExperimentalTechnique.getByName(techniqueStr);
if (et==null) return false;
if (techniques==null) {
techniques = EnumSet.of(et);
return true;
} else {
return techniques.add(et);
}
} | [
"public",
"boolean",
"setExperimentalTechnique",
"(",
"String",
"techniqueStr",
")",
"{",
"ExperimentalTechnique",
"et",
"=",
"ExperimentalTechnique",
".",
"getByName",
"(",
"techniqueStr",
")",
";",
"if",
"(",
"et",
"==",
"null",
")",
"return",
"false",
";",
"i... | Adds the experimental technique to the set of experimental techniques of this header.
Note that if input is not a recognised technique string then no errors will be produced but
false will be returned
@param techniqueStr
@return true if the input corresponds to a recognised technique string (see {@link ExperimentalTech... | [
"Adds",
"the",
"experimental",
"technique",
"to",
"the",
"set",
"of",
"experimental",
"techniques",
"of",
"this",
"header",
".",
"Note",
"that",
"if",
"input",
"is",
"not",
"a",
"recognised",
"technique",
"string",
"then",
"no",
"errors",
"will",
"be",
"prod... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/PDBHeader.java#L511-L524 |
32,042 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/ChargeAdder.java | ChargeAdder.addCharges | public static void addCharges(Structure structure) {
// Loop through the models
for(int i=0; i<structure.nrModels(); i++){
for(Chain c: structure.getChains(i)){
for(Group g: c.getAtomGroups()){
ChemComp thisChemComp = ChemCompGroupFactory.getChemComp(g.getPDBName());
List<ChemCompAtom> chemAtoms = ... | java | public static void addCharges(Structure structure) {
// Loop through the models
for(int i=0; i<structure.nrModels(); i++){
for(Chain c: structure.getChains(i)){
for(Group g: c.getAtomGroups()){
ChemComp thisChemComp = ChemCompGroupFactory.getChemComp(g.getPDBName());
List<ChemCompAtom> chemAtoms = ... | [
"public",
"static",
"void",
"addCharges",
"(",
"Structure",
"structure",
")",
"{",
"// Loop through the models",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"structure",
".",
"nrModels",
"(",
")",
";",
"i",
"++",
")",
"{",
"for",
"(",
"Chain",
"c"... | Function to add the charges to a given structure. | [
"Function",
"to",
"add",
"the",
"charges",
"to",
"a",
"given",
"structure",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/ChargeAdder.java#L49-L91 |
32,043 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java | SymmOptimizer.updateMultipleAlignment | private void updateMultipleAlignment() throws StructureException,
RefinerFailedException {
msa.clear();
// Override the alignment with the new information
Block b = msa.getBlock(0);
b.setAlignRes(block);
repeatCore = b.getCoreLength();
if (repeatCore < 1)
throw new RefinerFailedException(
"Opti... | java | private void updateMultipleAlignment() throws StructureException,
RefinerFailedException {
msa.clear();
// Override the alignment with the new information
Block b = msa.getBlock(0);
b.setAlignRes(block);
repeatCore = b.getCoreLength();
if (repeatCore < 1)
throw new RefinerFailedException(
"Opti... | [
"private",
"void",
"updateMultipleAlignment",
"(",
")",
"throws",
"StructureException",
",",
"RefinerFailedException",
"{",
"msa",
".",
"clear",
"(",
")",
";",
"// Override the alignment with the new information",
"Block",
"b",
"=",
"msa",
".",
"getBlock",
"(",
"0",
... | This method translates the internal data structures to a
MultipleAlignment of the repeats in order to use the methods to score
MultipleAlignments.
@throws StructureException
@throws RefinerFailedException | [
"This",
"method",
"translates",
"the",
"internal",
"data",
"structures",
"to",
"a",
"MultipleAlignment",
"of",
"the",
"repeats",
"in",
"order",
"to",
"use",
"the",
"methods",
"to",
"score",
"MultipleAlignments",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java#L341-L355 |
32,044 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java | SymmOptimizer.shrinkBlock | private boolean shrinkBlock() throws StructureException,
RefinerFailedException {
// Let shrink moves only if the repeat is larger enough
if (repeatCore <= Lmin)
return false;
// Select column by maximum distance
updateMultipleAlignment();
Matrix residueDistances = MultipleAlignmentTools
.getAvera... | java | private boolean shrinkBlock() throws StructureException,
RefinerFailedException {
// Let shrink moves only if the repeat is larger enough
if (repeatCore <= Lmin)
return false;
// Select column by maximum distance
updateMultipleAlignment();
Matrix residueDistances = MultipleAlignmentTools
.getAvera... | [
"private",
"boolean",
"shrinkBlock",
"(",
")",
"throws",
"StructureException",
",",
"RefinerFailedException",
"{",
"// Let shrink moves only if the repeat is larger enough",
"if",
"(",
"repeatCore",
"<=",
"Lmin",
")",
"return",
"false",
";",
"// Select column by maximum dista... | Deletes an alignment column at a randomly selected position.
@throws StructureException
@throws RefinerFailedException | [
"Deletes",
"an",
"alignment",
"column",
"at",
"a",
"randomly",
"selected",
"position",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java#L775-L818 |
32,045 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java | SymmOptimizer.saveHistory | private void saveHistory(String folder) throws IOException {
String name = msa.getStructureIdentifier(0).getIdentifier();
FileWriter writer = new FileWriter(folder + name
+ "-symm_opt.csv");
writer.append("Step,Time,RepeatLength,RMSD,TMscore,MCscore\n");
for (int i = 0; i < lengthHistory.size(); i++) {
... | java | private void saveHistory(String folder) throws IOException {
String name = msa.getStructureIdentifier(0).getIdentifier();
FileWriter writer = new FileWriter(folder + name
+ "-symm_opt.csv");
writer.append("Step,Time,RepeatLength,RMSD,TMscore,MCscore\n");
for (int i = 0; i < lengthHistory.size(); i++) {
... | [
"private",
"void",
"saveHistory",
"(",
"String",
"folder",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"msa",
".",
"getStructureIdentifier",
"(",
"0",
")",
".",
"getIdentifier",
"(",
")",
";",
"FileWriter",
"writer",
"=",
"new",
"FileWriter",
"... | Save the evolution of the optimization process as a csv file. | [
"Save",
"the",
"evolution",
"of",
"the",
"optimization",
"process",
"as",
"a",
"csv",
"file",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java#L837-L855 |
32,046 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java | MmtfStructureWriter.addBonds | private void addBonds(Atom atom, List<Atom> atomsInGroup, List<Atom> allAtoms) {
if(atom.getBonds()==null){
return;
}
for(Bond bond : atom.getBonds()) {
// Now set the bonding information.
Atom other = bond.getOther(atom);
// If both atoms are in the group
if (atomsInGroup.indexOf(other)!=-1){
... | java | private void addBonds(Atom atom, List<Atom> atomsInGroup, List<Atom> allAtoms) {
if(atom.getBonds()==null){
return;
}
for(Bond bond : atom.getBonds()) {
// Now set the bonding information.
Atom other = bond.getOther(atom);
// If both atoms are in the group
if (atomsInGroup.indexOf(other)!=-1){
... | [
"private",
"void",
"addBonds",
"(",
"Atom",
"atom",
",",
"List",
"<",
"Atom",
">",
"atomsInGroup",
",",
"List",
"<",
"Atom",
">",
"allAtoms",
")",
"{",
"if",
"(",
"atom",
".",
"getBonds",
"(",
")",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",... | Add the bonds for a given atom.
@param atom the atom for which bonds are to be formed
@param atomsInGroup the list of atoms in the group
@param allAtoms the list of atoms in the whole structure | [
"Add",
"the",
"bonds",
"for",
"a",
"given",
"atom",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java#L132-L160 |
32,047 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java | MmtfStructureWriter.storeEntityInformation | private void storeEntityInformation(List<Chain> allChains, List<EntityInfo> entityInfos) {
for (EntityInfo entityInfo : entityInfos) {
String description = entityInfo.getDescription();
String type;
if (entityInfo.getType()==null){
type = null;
}
else{
type = entityInfo.getType().getEntityType()... | java | private void storeEntityInformation(List<Chain> allChains, List<EntityInfo> entityInfos) {
for (EntityInfo entityInfo : entityInfos) {
String description = entityInfo.getDescription();
String type;
if (entityInfo.getType()==null){
type = null;
}
else{
type = entityInfo.getType().getEntityType()... | [
"private",
"void",
"storeEntityInformation",
"(",
"List",
"<",
"Chain",
">",
"allChains",
",",
"List",
"<",
"EntityInfo",
">",
"entityInfos",
")",
"{",
"for",
"(",
"EntityInfo",
"entityInfo",
":",
"entityInfos",
")",
"{",
"String",
"description",
"=",
"entityI... | Store the entity information for a given structure.
@param allChains a list of all the chains in a structure
@param entityInfos a list of the entity information | [
"Store",
"the",
"entity",
"information",
"for",
"a",
"given",
"structure",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java#L168-L202 |
32,048 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java | MmtfStructureWriter.storeBioassemblyInformation | private void storeBioassemblyInformation(Map<String, Integer> chainIdToIndexMap, Map<Integer, BioAssemblyInfo> inputBioAss) {
int bioAssemblyIndex = 0;
for (Entry<Integer, BioAssemblyInfo> entry : inputBioAss.entrySet()) {
Map<double[], int[]> transformMap = MmtfUtils.getTransformMap(entry.getValue(), chainIdToI... | java | private void storeBioassemblyInformation(Map<String, Integer> chainIdToIndexMap, Map<Integer, BioAssemblyInfo> inputBioAss) {
int bioAssemblyIndex = 0;
for (Entry<Integer, BioAssemblyInfo> entry : inputBioAss.entrySet()) {
Map<double[], int[]> transformMap = MmtfUtils.getTransformMap(entry.getValue(), chainIdToI... | [
"private",
"void",
"storeBioassemblyInformation",
"(",
"Map",
"<",
"String",
",",
"Integer",
">",
"chainIdToIndexMap",
",",
"Map",
"<",
"Integer",
",",
"BioAssemblyInfo",
">",
"inputBioAss",
")",
"{",
"int",
"bioAssemblyIndex",
"=",
"0",
";",
"for",
"(",
"Entr... | Generate the bioassembly information on in the desired form.
@param bioJavaStruct the Biojava structure
@param header the header | [
"Generate",
"the",
"bioassembly",
"information",
"on",
"in",
"the",
"desired",
"form",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java#L210-L219 |
32,049 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java | TranscriptSequence.removeCDS | public CDSSequence removeCDS(String accession) {
for (CDSSequence cdsSequence : cdsSequenceList) {
if (cdsSequence.getAccession().getID().equals(accession)) {
cdsSequenceList.remove(cdsSequence);
cdsSequenceHashMap.remove(accession);
return cdsSequence;
}
}
return null;
} | java | public CDSSequence removeCDS(String accession) {
for (CDSSequence cdsSequence : cdsSequenceList) {
if (cdsSequence.getAccession().getID().equals(accession)) {
cdsSequenceList.remove(cdsSequence);
cdsSequenceHashMap.remove(accession);
return cdsSequence;
}
}
return null;
} | [
"public",
"CDSSequence",
"removeCDS",
"(",
"String",
"accession",
")",
"{",
"for",
"(",
"CDSSequence",
"cdsSequence",
":",
"cdsSequenceList",
")",
"{",
"if",
"(",
"cdsSequence",
".",
"getAccession",
"(",
")",
".",
"getID",
"(",
")",
".",
"equals",
"(",
"ac... | Remove a CDS or coding sequence from the transcript sequence
@param accession
@return | [
"Remove",
"a",
"CDS",
"or",
"coding",
"sequence",
"from",
"the",
"transcript",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java#L82-L91 |
32,050 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java | TranscriptSequence.addCDS | public CDSSequence addCDS(AccessionID accession, int begin, int end, int phase) throws Exception {
if (cdsSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
CDSSequence cdsSequence = new CDSSequence(this, begin, end, phase); //sense should be ... | java | public CDSSequence addCDS(AccessionID accession, int begin, int end, int phase) throws Exception {
if (cdsSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
CDSSequence cdsSequence = new CDSSequence(this, begin, end, phase); //sense should be ... | [
"public",
"CDSSequence",
"addCDS",
"(",
"AccessionID",
"accession",
",",
"int",
"begin",
",",
"int",
"end",
",",
"int",
"phase",
")",
"throws",
"Exception",
"{",
"if",
"(",
"cdsSequenceHashMap",
".",
"containsKey",
"(",
"accession",
".",
"getID",
"(",
")",
... | Add a Coding Sequence region with phase to the transcript sequence
@param accession
@param begin
@param end
@param phase 0,1,2
@return | [
"Add",
"a",
"Coding",
"Sequence",
"region",
"with",
"phase",
"to",
"the",
"transcript",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java#L109-L119 |
32,051 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java | TranscriptSequence.getDNACodingSequence | public DNASequence getDNACodingSequence() {
StringBuilder sb = new StringBuilder();
for (CDSSequence cdsSequence : cdsSequenceList) {
sb.append(cdsSequence.getCodingSequence());
}
DNASequence dnaSequence = null;
try {
dnaSequence = new DNASequence(sb.toString().toUpperCase());
} catch (CompoundNotFou... | java | public DNASequence getDNACodingSequence() {
StringBuilder sb = new StringBuilder();
for (CDSSequence cdsSequence : cdsSequenceList) {
sb.append(cdsSequence.getCodingSequence());
}
DNASequence dnaSequence = null;
try {
dnaSequence = new DNASequence(sb.toString().toUpperCase());
} catch (CompoundNotFou... | [
"public",
"DNASequence",
"getDNACodingSequence",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"CDSSequence",
"cdsSequence",
":",
"cdsSequenceList",
")",
"{",
"sb",
".",
"append",
"(",
"cdsSequence",
".",
"getCod... | Get the stitched together CDS sequences then maps to the cDNA
@return | [
"Get",
"the",
"stitched",
"together",
"CDS",
"sequences",
"then",
"maps",
"to",
"the",
"cDNA"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java#L202-L217 |
32,052 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java | TranscriptSequence.getProteinSequence | public ProteinSequence getProteinSequence(TranscriptionEngine engine) {
DNASequence dnaCodingSequence = getDNACodingSequence();
RNASequence rnaCodingSequence = dnaCodingSequence.getRNASequence(engine);
ProteinSequence proteinSequence = rnaCodingSequence.getProteinSequence(engine);
proteinSequence.setAccession(n... | java | public ProteinSequence getProteinSequence(TranscriptionEngine engine) {
DNASequence dnaCodingSequence = getDNACodingSequence();
RNASequence rnaCodingSequence = dnaCodingSequence.getRNASequence(engine);
ProteinSequence proteinSequence = rnaCodingSequence.getProteinSequence(engine);
proteinSequence.setAccession(n... | [
"public",
"ProteinSequence",
"getProteinSequence",
"(",
"TranscriptionEngine",
"engine",
")",
"{",
"DNASequence",
"dnaCodingSequence",
"=",
"getDNACodingSequence",
"(",
")",
";",
"RNASequence",
"rnaCodingSequence",
"=",
"dnaCodingSequence",
".",
"getRNASequence",
"(",
"en... | Get the protein sequence with user defined TranscriptEngine
@param engine
@return | [
"Get",
"the",
"protein",
"sequence",
"with",
"user",
"defined",
"TranscriptEngine"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java#L232-L239 |
32,053 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java | SequenceScalePanel.setPaintDefaults | protected void setPaintDefaults(Graphics2D g2D){
g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2D.setFont(seqFont);
} | java | protected void setPaintDefaults(Graphics2D g2D){
g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2D.setFont(seqFont);
} | [
"protected",
"void",
"setPaintDefaults",
"(",
"Graphics2D",
"g2D",
")",
"{",
"g2D",
".",
"setRenderingHint",
"(",
"RenderingHints",
".",
"KEY_TEXT_ANTIALIASING",
",",
"RenderingHints",
".",
"VALUE_TEXT_ANTIALIAS_ON",
")",
";",
"g2D",
".",
"setRenderingHint",
"(",
"R... | set some default rendering hints, like text antialiasing on
@param g2D the graphics object to set the defaults on | [
"set",
"some",
"default",
"rendering",
"hints",
"like",
"text",
"antialiasing",
"on"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java#L200-L207 |
32,054 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java | SequenceScalePanel.drawSequence | protected int drawSequence(Graphics2D g2D, int y){
//g2D.drawString(panelName,10,10);
g2D.setColor(SEQUENCE_COLOR);
int aminosize = Math.round(1*scale);
if ( aminosize < 1)
aminosize = 1;
// only draw within the ranges of the Clip
Rectangle drawHere = g2D.getClipBounds();
int startpos = coordManager... | java | protected int drawSequence(Graphics2D g2D, int y){
//g2D.drawString(panelName,10,10);
g2D.setColor(SEQUENCE_COLOR);
int aminosize = Math.round(1*scale);
if ( aminosize < 1)
aminosize = 1;
// only draw within the ranges of the Clip
Rectangle drawHere = g2D.getClipBounds();
int startpos = coordManager... | [
"protected",
"int",
"drawSequence",
"(",
"Graphics2D",
"g2D",
",",
"int",
"y",
")",
"{",
"//g2D.drawString(panelName,10,10);",
"g2D",
".",
"setColor",
"(",
"SEQUENCE_COLOR",
")",
";",
"int",
"aminosize",
"=",
"Math",
".",
"round",
"(",
"1",
"*",
"scale",
")"... | draw the Amino acid sequence
@param g2D
@param y .. height of line to draw the sequence onto
@return the new y value | [
"draw",
"the",
"Amino",
"acid",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java#L422-L477 |
32,055 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java | CalcPoint.centroid | public static Point3d centroid(Point3d[] x) {
Point3d center = new Point3d();
for (Point3d p : x) {
center.add(p);
}
center.scale(1.0 / x.length);
return center;
} | java | public static Point3d centroid(Point3d[] x) {
Point3d center = new Point3d();
for (Point3d p : x) {
center.add(p);
}
center.scale(1.0 / x.length);
return center;
} | [
"public",
"static",
"Point3d",
"centroid",
"(",
"Point3d",
"[",
"]",
"x",
")",
"{",
"Point3d",
"center",
"=",
"new",
"Point3d",
"(",
")",
";",
"for",
"(",
"Point3d",
"p",
":",
"x",
")",
"{",
"center",
".",
"add",
"(",
"p",
")",
";",
"}",
"center"... | Calculate the centroid of the point cloud.
@param x
array of points. Point objects will not be modified
@return centroid as Point3d | [
"Calculate",
"the",
"centroid",
"of",
"the",
"point",
"cloud",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java#L62-L69 |
32,056 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java | CalcPoint.transform | public static void transform(Matrix4d rotTrans, Point3d[] x) {
for (Point3d p : x) {
rotTrans.transform(p);
}
} | java | public static void transform(Matrix4d rotTrans, Point3d[] x) {
for (Point3d p : x) {
rotTrans.transform(p);
}
} | [
"public",
"static",
"void",
"transform",
"(",
"Matrix4d",
"rotTrans",
",",
"Point3d",
"[",
"]",
"x",
")",
"{",
"for",
"(",
"Point3d",
"p",
":",
"x",
")",
"{",
"rotTrans",
".",
"transform",
"(",
"p",
")",
";",
"}",
"}"
] | Transform all points with a 4x4 transformation matrix.
@param rotTrans
4x4 transformation matrix
@param x
array of points. Point objects will be modified | [
"Transform",
"all",
"points",
"with",
"a",
"4x4",
"transformation",
"matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java#L79-L83 |
32,057 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java | CalcPoint.translate | public static void translate(Vector3d trans, Point3d[] x) {
for (Point3d p : x) {
p.add(trans);
}
} | java | public static void translate(Vector3d trans, Point3d[] x) {
for (Point3d p : x) {
p.add(trans);
}
} | [
"public",
"static",
"void",
"translate",
"(",
"Vector3d",
"trans",
",",
"Point3d",
"[",
"]",
"x",
")",
"{",
"for",
"(",
"Point3d",
"p",
":",
"x",
")",
"{",
"p",
".",
"add",
"(",
"trans",
")",
";",
"}",
"}"
] | Translate all points with a translation vector.
@param trans
the translation vector to apply
@param x
array of points. Point objects will be modified | [
"Translate",
"all",
"points",
"with",
"a",
"translation",
"vector",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java#L93-L97 |
32,058 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java | CalcPoint.clonePoint3dArray | public static Point3d[] clonePoint3dArray(Point3d[] x) {
Point3d[] clone = new Point3d[x.length];
for (int i = 0; i < x.length; i++) {
clone[i] = new Point3d(x[i]);
}
return clone;
} | java | public static Point3d[] clonePoint3dArray(Point3d[] x) {
Point3d[] clone = new Point3d[x.length];
for (int i = 0; i < x.length; i++) {
clone[i] = new Point3d(x[i]);
}
return clone;
} | [
"public",
"static",
"Point3d",
"[",
"]",
"clonePoint3dArray",
"(",
"Point3d",
"[",
"]",
"x",
")",
"{",
"Point3d",
"[",
"]",
"clone",
"=",
"new",
"Point3d",
"[",
"x",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"x",
... | Clone an array of points.
@param x
original array of points. Point objects will not be modified
@return new array of points, identical clone of x | [
"Clone",
"an",
"array",
"of",
"points",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java#L106-L112 |
32,059 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java | CalcPoint.rmsd | public static double rmsd(Point3d[] x, Point3d[] y) {
if (x.length != y.length) {
throw new IllegalArgumentException(
"Point arrays are not of the same length.");
}
double sum = 0.0;
for (int i = 0; i < x.length; i++) {
sum += x[i].distanceSquared(y[i]);
}
return Math.sqrt(sum / x.length);
} | java | public static double rmsd(Point3d[] x, Point3d[] y) {
if (x.length != y.length) {
throw new IllegalArgumentException(
"Point arrays are not of the same length.");
}
double sum = 0.0;
for (int i = 0; i < x.length; i++) {
sum += x[i].distanceSquared(y[i]);
}
return Math.sqrt(sum / x.length);
} | [
"public",
"static",
"double",
"rmsd",
"(",
"Point3d",
"[",
"]",
"x",
",",
"Point3d",
"[",
"]",
"y",
")",
"{",
"if",
"(",
"x",
".",
"length",
"!=",
"y",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Point arrays are not of t... | Calculate the RMSD of two point arrays, already superposed.
@param x
array of points superposed to y
@param y
array of points superposed to x
@return RMSD | [
"Calculate",
"the",
"RMSD",
"of",
"two",
"point",
"arrays",
"already",
"superposed",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/CalcPoint.java#L244-L256 |
32,060 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/MenuCreator.java | MenuCreator.initMenu | public static JMenuBar initMenu(){
// show a menu
JMenuBar menu = new JMenuBar();
JMenu file= new JMenu("File");
file.getAccessibleContext().setAccessibleDescription("File Menu");
JMenuItem openI = new JMenuItem("Open");
openI.setMnemonic(KeyEvent.VK_O);
openI.addActionListener(new ActionListener(){
... | java | public static JMenuBar initMenu(){
// show a menu
JMenuBar menu = new JMenuBar();
JMenu file= new JMenu("File");
file.getAccessibleContext().setAccessibleDescription("File Menu");
JMenuItem openI = new JMenuItem("Open");
openI.setMnemonic(KeyEvent.VK_O);
openI.addActionListener(new ActionListener(){
... | [
"public",
"static",
"JMenuBar",
"initMenu",
"(",
")",
"{",
"// show a menu",
"JMenuBar",
"menu",
"=",
"new",
"JMenuBar",
"(",
")",
";",
"JMenu",
"file",
"=",
"new",
"JMenu",
"(",
"\"File\"",
")",
";",
"file",
".",
"getAccessibleContext",
"(",
")",
".",
"... | provide a JMenuBar that can be added to a JFrame
@return a JMenuBar | [
"provide",
"a",
"JMenuBar",
"that",
"can",
"be",
"added",
"to",
"a",
"JFrame"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/MenuCreator.java#L48-L145 |
32,061 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/MenuCreator.java | MenuCreator.showAboutDialog | private static void showAboutDialog(){
JDialog dialog = new JDialog();
dialog.setSize(new Dimension(300,300));
String msg = "This viewer is based on <b>BioJava</b> and <b>Jmol</>. <br>Author: Andreas Prlic <br> ";
msg += "Structure Alignment algorithm based on a variation of the PSC++ algorithm by Peter Lack... | java | private static void showAboutDialog(){
JDialog dialog = new JDialog();
dialog.setSize(new Dimension(300,300));
String msg = "This viewer is based on <b>BioJava</b> and <b>Jmol</>. <br>Author: Andreas Prlic <br> ";
msg += "Structure Alignment algorithm based on a variation of the PSC++ algorithm by Peter Lack... | [
"private",
"static",
"void",
"showAboutDialog",
"(",
")",
"{",
"JDialog",
"dialog",
"=",
"new",
"JDialog",
"(",
")",
";",
"dialog",
".",
"setSize",
"(",
"new",
"Dimension",
"(",
"300",
",",
"300",
")",
")",
";",
"String",
"msg",
"=",
"\"This viewer is ba... | show some info about this gui | [
"show",
"some",
"info",
"about",
"this",
"gui"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/MenuCreator.java#L159-L203 |
32,062 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AnchoredPairwiseSequenceAligner.java | AnchoredPairwiseSequenceAligner.getAnchors | public int[] getAnchors() {
int[] anchor = new int[getScoreMatrixDimensions()[0] - 1];
for (int i = 0; i < anchor.length; i++) {
anchor[i] = -1;
}
for (int i = 0; i < anchors.size(); i++) {
anchor[anchors.get(i).getQueryIndex()] = anchors.get(i).getTargetIndex();
}
return anchor;
} | java | public int[] getAnchors() {
int[] anchor = new int[getScoreMatrixDimensions()[0] - 1];
for (int i = 0; i < anchor.length; i++) {
anchor[i] = -1;
}
for (int i = 0; i < anchors.size(); i++) {
anchor[anchors.get(i).getQueryIndex()] = anchors.get(i).getTargetIndex();
}
return anchor;
} | [
"public",
"int",
"[",
"]",
"getAnchors",
"(",
")",
"{",
"int",
"[",
"]",
"anchor",
"=",
"new",
"int",
"[",
"getScoreMatrixDimensions",
"(",
")",
"[",
"0",
"]",
"-",
"1",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"anchor",
".",
... | Returns the list of anchors. The populated elements correspond to query compounds with a connection established
to a target compound.
@return the list of anchors | [
"Returns",
"the",
"list",
"of",
"anchors",
".",
"The",
"populated",
"elements",
"correspond",
"to",
"query",
"compounds",
"with",
"a",
"connection",
"established",
"to",
"a",
"target",
"compound",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AnchoredPairwiseSequenceAligner.java#L97-L106 |
32,063 | biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AnchoredPairwiseSequenceAligner.java | AnchoredPairwiseSequenceAligner.setAnchors | public void setAnchors(int[] anchors) {
super.anchors = new ArrayList<Anchor>();
if (anchors != null) {
for (int i = 0; i < anchors.length; i++) {
if (anchors[i] >= 0) {
addAnchor(i, anchors[i]);
}
}
}
} | java | public void setAnchors(int[] anchors) {
super.anchors = new ArrayList<Anchor>();
if (anchors != null) {
for (int i = 0; i < anchors.length; i++) {
if (anchors[i] >= 0) {
addAnchor(i, anchors[i]);
}
}
}
} | [
"public",
"void",
"setAnchors",
"(",
"int",
"[",
"]",
"anchors",
")",
"{",
"super",
".",
"anchors",
"=",
"new",
"ArrayList",
"<",
"Anchor",
">",
"(",
")",
";",
"if",
"(",
"anchors",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Sets the starting list of anchors before running the alignment routine.
@param anchors list of points that are tied to the given indices in the target | [
"Sets",
"the",
"starting",
"list",
"of",
"anchors",
"before",
"running",
"the",
"alignment",
"routine",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AnchoredPairwiseSequenceAligner.java#L113-L122 |
32,064 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReaderHelper.java | GenbankReaderHelper.readGenbankProteinSequence | public static LinkedHashMap<String, ProteinSequence> readGenbankProteinSequence(
File file) throws Exception {
FileInputStream inStream = new FileInputStream(file);
LinkedHashMap<String, ProteinSequence> proteinSequences = readGenbankProteinSequence(inStream);
inStream.close();
return proteinSequences;
} | java | public static LinkedHashMap<String, ProteinSequence> readGenbankProteinSequence(
File file) throws Exception {
FileInputStream inStream = new FileInputStream(file);
LinkedHashMap<String, ProteinSequence> proteinSequences = readGenbankProteinSequence(inStream);
inStream.close();
return proteinSequences;
} | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"ProteinSequence",
">",
"readGenbankProteinSequence",
"(",
"File",
"file",
")",
"throws",
"Exception",
"{",
"FileInputStream",
"inStream",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"LinkedHashMap",... | Read a Genbank file containing amino acids with setup that would handle most
cases.
@param file
@return
@throws Exception | [
"Read",
"a",
"Genbank",
"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/GenbankReaderHelper.java#L141-L147 |
32,065 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReaderHelper.java | GenbankReaderHelper.readGenbankProteinSequence | public static LinkedHashMap<String, ProteinSequence> readGenbankProteinSequence(
InputStream inStream) throws Exception {
GenbankReader<ProteinSequence, AminoAcidCompound> GenbankReader = new GenbankReader<ProteinSequence, AminoAcidCompound>(
inStream,
new GenericGenbankHeaderParser<ProteinSequence, AminoA... | java | public static LinkedHashMap<String, ProteinSequence> readGenbankProteinSequence(
InputStream inStream) throws Exception {
GenbankReader<ProteinSequence, AminoAcidCompound> GenbankReader = new GenbankReader<ProteinSequence, AminoAcidCompound>(
inStream,
new GenericGenbankHeaderParser<ProteinSequence, AminoA... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"ProteinSequence",
">",
"readGenbankProteinSequence",
"(",
"InputStream",
"inStream",
")",
"throws",
"Exception",
"{",
"GenbankReader",
"<",
"ProteinSequence",
",",
"AminoAcidCompound",
">",
"GenbankReader",
"=",
... | Read a Genbank 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 Exception | [
"Read",
"a",
"Genbank",
"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/GenbankReaderHelper.java#L157-L164 |
32,066 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReaderHelper.java | GenbankReaderHelper.readGenbankDNASequence | public static LinkedHashMap<String, DNASequence> readGenbankDNASequence(
InputStream inStream) throws Exception {
GenbankReader<DNASequence, NucleotideCompound> GenbankReader = new GenbankReader<DNASequence, NucleotideCompound>(
inStream,
new GenericGenbankHeaderParser<DNASequence, NucleotideCompound>(),
... | java | public static LinkedHashMap<String, DNASequence> readGenbankDNASequence(
InputStream inStream) throws Exception {
GenbankReader<DNASequence, NucleotideCompound> GenbankReader = new GenbankReader<DNASequence, NucleotideCompound>(
inStream,
new GenericGenbankHeaderParser<DNASequence, NucleotideCompound>(),
... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"DNASequence",
">",
"readGenbankDNASequence",
"(",
"InputStream",
"inStream",
")",
"throws",
"Exception",
"{",
"GenbankReader",
"<",
"DNASequence",
",",
"NucleotideCompound",
">",
"GenbankReader",
"=",
"new",
... | Read a Genbank DNA sequence
@param inStream
@return
@throws Exception | [
"Read",
"a",
"Genbank",
"DNA",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReaderHelper.java#L172-L179 |
32,067 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReaderHelper.java | GenbankReaderHelper.readGenbankRNASequence | public static LinkedHashMap<String, RNASequence> readGenbankRNASequence(
InputStream inStream) throws Exception {
GenbankReader<RNASequence, NucleotideCompound> GenbankReader = new GenbankReader<RNASequence, NucleotideCompound>(
inStream,
new GenericGenbankHeaderParser<RNASequence, NucleotideCompound>(),
... | java | public static LinkedHashMap<String, RNASequence> readGenbankRNASequence(
InputStream inStream) throws Exception {
GenbankReader<RNASequence, NucleotideCompound> GenbankReader = new GenbankReader<RNASequence, NucleotideCompound>(
inStream,
new GenericGenbankHeaderParser<RNASequence, NucleotideCompound>(),
... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"RNASequence",
">",
"readGenbankRNASequence",
"(",
"InputStream",
"inStream",
")",
"throws",
"Exception",
"{",
"GenbankReader",
"<",
"RNASequence",
",",
"NucleotideCompound",
">",
"GenbankReader",
"=",
"new",
... | Read a Genbank RNA sequence
@param inStream
@return
@throws Exception | [
"Read",
"a",
"Genbank",
"RNA",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReaderHelper.java#L200-L207 |
32,068 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/scop/CachedRemoteScopInstallation.java | CachedRemoteScopInstallation.loadRepresentativeDomains | private void loadRepresentativeDomains() throws IOException {
URL u = null;
try {
u = new URL(RemoteScopInstallation.DEFAULT_SERVER + "getRepresentativeScopDomains");
} catch (MalformedURLException e) {
throw new IOException("URL " + RemoteScopInstallation.DEFAULT_SERVER + "getRepresentativeScopDomains" + ... | java | private void loadRepresentativeDomains() throws IOException {
URL u = null;
try {
u = new URL(RemoteScopInstallation.DEFAULT_SERVER + "getRepresentativeScopDomains");
} catch (MalformedURLException e) {
throw new IOException("URL " + RemoteScopInstallation.DEFAULT_SERVER + "getRepresentativeScopDomains" + ... | [
"private",
"void",
"loadRepresentativeDomains",
"(",
")",
"throws",
"IOException",
"{",
"URL",
"u",
"=",
"null",
";",
"try",
"{",
"u",
"=",
"new",
"URL",
"(",
"RemoteScopInstallation",
".",
"DEFAULT_SERVER",
"+",
"\"getRepresentativeScopDomains\"",
")",
";",
"}"... | get the ranges of representative domains from the centralized server | [
"get",
"the",
"ranges",
"of",
"representative",
"domains",
"from",
"the",
"centralized",
"server"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/CachedRemoteScopInstallation.java#L86-L105 |
32,069 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getDistance | public static final double getDistance(Atom a, Atom b) {
double x = a.getX() - b.getX();
double y = a.getY() - b.getY();
double z = a.getZ() - b.getZ();
double s = x * x + y * y + z * z;
return Math.sqrt(s);
} | java | public static final double getDistance(Atom a, Atom b) {
double x = a.getX() - b.getX();
double y = a.getY() - b.getY();
double z = a.getZ() - b.getZ();
double s = x * x + y * y + z * z;
return Math.sqrt(s);
} | [
"public",
"static",
"final",
"double",
"getDistance",
"(",
"Atom",
"a",
",",
"Atom",
"b",
")",
"{",
"double",
"x",
"=",
"a",
".",
"getX",
"(",
")",
"-",
"b",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"a",
".",
"getY",
"(",
")",
"-",
"b"... | calculate distance between two atoms.
@param a
an Atom object
@param b
an Atom object
@return a double | [
"calculate",
"distance",
"between",
"two",
"atoms",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L68-L76 |
32,070 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.angle | public static final double angle(Atom a, Atom b){
Vector3d va = new Vector3d(a.getCoordsAsPoint3d());
Vector3d vb = new Vector3d(b.getCoordsAsPoint3d());
return Math.toDegrees(va.angle(vb));
} | java | public static final double angle(Atom a, Atom b){
Vector3d va = new Vector3d(a.getCoordsAsPoint3d());
Vector3d vb = new Vector3d(b.getCoordsAsPoint3d());
return Math.toDegrees(va.angle(vb));
} | [
"public",
"static",
"final",
"double",
"angle",
"(",
"Atom",
"a",
",",
"Atom",
"b",
")",
"{",
"Vector3d",
"va",
"=",
"new",
"Vector3d",
"(",
"a",
".",
"getCoordsAsPoint3d",
"(",
")",
")",
";",
"Vector3d",
"vb",
"=",
"new",
"Vector3d",
"(",
"b",
".",
... | Gets the angle between two vectors
@param a
an Atom object
@param b
an Atom object
@return Angle between a and b in degrees, in range [0,180]. If either
vector has length 0 then angle is not defined and NaN is returned | [
"Gets",
"the",
"angle",
"between",
"two",
"vectors"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L195-L202 |
32,071 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.unitVector | public static final Atom unitVector(Atom a) {
double amount = amount(a) ;
double[] coords = new double[3];
coords[0] = a.getX() / amount ;
coords[1] = a.getY() / amount ;
coords[2] = a.getZ() / amount ;
a.setCoords(coords);
return a;
} | java | public static final Atom unitVector(Atom a) {
double amount = amount(a) ;
double[] coords = new double[3];
coords[0] = a.getX() / amount ;
coords[1] = a.getY() / amount ;
coords[2] = a.getZ() / amount ;
a.setCoords(coords);
return a;
} | [
"public",
"static",
"final",
"Atom",
"unitVector",
"(",
"Atom",
"a",
")",
"{",
"double",
"amount",
"=",
"amount",
"(",
"a",
")",
";",
"double",
"[",
"]",
"coords",
"=",
"new",
"double",
"[",
"3",
"]",
";",
"coords",
"[",
"0",
"]",
"=",
"a",
".",
... | Returns the unit vector of vector a .
@param a
an Atom object
@return an Atom object | [
"Returns",
"the",
"unit",
"vector",
"of",
"vector",
"a",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L211-L223 |
32,072 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getPhi | public static final double getPhi(AminoAcid a, AminoAcid b)
throws StructureException {
if ( ! isConnected(a,b)){
throw new StructureException(
"can not calc Phi - AminoAcids are not connected!");
}
Atom a_C = a.getC();
Atom b_N = b.getN();
Atom b_CA = b.getCA();
Atom b_C = b.getC();
// C... | java | public static final double getPhi(AminoAcid a, AminoAcid b)
throws StructureException {
if ( ! isConnected(a,b)){
throw new StructureException(
"can not calc Phi - AminoAcids are not connected!");
}
Atom a_C = a.getC();
Atom b_N = b.getN();
Atom b_CA = b.getCA();
Atom b_C = b.getC();
// C... | [
"public",
"static",
"final",
"double",
"getPhi",
"(",
"AminoAcid",
"a",
",",
"AminoAcid",
"b",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"!",
"isConnected",
"(",
"a",
",",
"b",
")",
")",
"{",
"throw",
"new",
"StructureException",
"(",
"\"can not... | Calculate the phi angle.
@param a
an AminoAcid object
@param b
an AminoAcid object
@return a double
@throws StructureException
if aminoacids not connected or if any of the 4 needed atoms
missing | [
"Calculate",
"the",
"phi",
"angle",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L275-L294 |
32,073 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getPsi | public static final double getPsi(AminoAcid a, AminoAcid b)
throws StructureException {
if ( ! isConnected(a,b)) {
throw new StructureException(
"can not calc Psi - AminoAcids are not connected!");
}
Atom a_N = a.getN();
Atom a_CA = a.getCA();
Atom a_C = a.getC();
Atom b_N = b.getN();
... | java | public static final double getPsi(AminoAcid a, AminoAcid b)
throws StructureException {
if ( ! isConnected(a,b)) {
throw new StructureException(
"can not calc Psi - AminoAcids are not connected!");
}
Atom a_N = a.getN();
Atom a_CA = a.getCA();
Atom a_C = a.getC();
Atom b_N = b.getN();
... | [
"public",
"static",
"final",
"double",
"getPsi",
"(",
"AminoAcid",
"a",
",",
"AminoAcid",
"b",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"!",
"isConnected",
"(",
"a",
",",
"b",
")",
")",
"{",
"throw",
"new",
"StructureException",
"(",
"\"can not... | Calculate the psi angle.
@param a
an AminoAcid object
@param b
an AminoAcid object
@return a double
@throws StructureException
if aminoacids not connected or if any of the 4 needed atoms
missing | [
"Calculate",
"the",
"psi",
"angle",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L308-L327 |
32,074 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.isConnected | public static final boolean isConnected(AminoAcid a, AminoAcid b) {
Atom C = null ;
Atom N = null;
C = a.getC();
N = b.getN();
if ( C == null || N == null)
return false;
// one could also check if the CA atoms are < 4 A...
double distance = getDistance(C,N);
return distance < 2.5;
} | java | public static final boolean isConnected(AminoAcid a, AminoAcid b) {
Atom C = null ;
Atom N = null;
C = a.getC();
N = b.getN();
if ( C == null || N == null)
return false;
// one could also check if the CA atoms are < 4 A...
double distance = getDistance(C,N);
return distance < 2.5;
} | [
"public",
"static",
"final",
"boolean",
"isConnected",
"(",
"AminoAcid",
"a",
",",
"AminoAcid",
"b",
")",
"{",
"Atom",
"C",
"=",
"null",
";",
"Atom",
"N",
"=",
"null",
";",
"C",
"=",
"a",
".",
"getC",
"(",
")",
";",
"N",
"=",
"b",
".",
"getN",
... | Test if two amino acids are connected, i.e. if the distance from C to N <
2.5 Angstrom.
If one of the AminoAcids has an atom missing, returns false.
@param a
an AminoAcid object
@param b
an AminoAcid object
@return true if ... | [
"Test",
"if",
"two",
"amino",
"acids",
"are",
"connected",
"i",
".",
"e",
".",
"if",
"the",
"distance",
"from",
"C",
"to",
"N",
"<",
"2",
".",
"5",
"Angstrom",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L341-L354 |
32,075 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.rotate | public static final void rotate(Atom atom, double[][] m){
double x = atom.getX();
double y = atom.getY() ;
double z = atom.getZ();
double nx = m[0][0] * x + m[0][1] * y + m[0][2] * z ;
double ny = m[1][0] * x + m[1][1] * y + m[1][2] * z ;
double nz = m[2][0] * x + m[2][1] * y + m[2][2] * z ;
atom.se... | java | public static final void rotate(Atom atom, double[][] m){
double x = atom.getX();
double y = atom.getY() ;
double z = atom.getZ();
double nx = m[0][0] * x + m[0][1] * y + m[0][2] * z ;
double ny = m[1][0] * x + m[1][1] * y + m[1][2] * z ;
double nz = m[2][0] * x + m[2][1] * y + m[2][2] * z ;
atom.se... | [
"public",
"static",
"final",
"void",
"rotate",
"(",
"Atom",
"atom",
",",
"double",
"[",
"]",
"[",
"]",
"m",
")",
"{",
"double",
"x",
"=",
"atom",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"atom",
".",
"getY",
"(",
")",
";",
"double",
"z",... | Rotate a single Atom aroud a rotation matrix. The rotation Matrix must be
a pre-multiplication 3x3 Matrix.
If the matrix is indexed m[row][col], then the matrix will be
pre-multiplied (y=atom*M)
@param atom
atom to be rotated
@param m
a rotation matrix represented as a double[3][3] array | [
"Rotate",
"a",
"single",
"Atom",
"aroud",
"a",
"rotation",
"matrix",
".",
"The",
"rotation",
"Matrix",
"must",
"be",
"a",
"pre",
"-",
"multiplication",
"3x3",
"Matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L368-L381 |
32,076 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.rotate | public static final void rotate(Structure structure,
double[][] rotationmatrix) throws StructureException {
if ( rotationmatrix.length != 3 ) {
throw new StructureException ("matrix does not have size 3x3 !");
}
AtomIterator iter = new AtomIterator(structure) ;
while (iter.hasNext()) {
Atom atom = ite... | java | public static final void rotate(Structure structure,
double[][] rotationmatrix) throws StructureException {
if ( rotationmatrix.length != 3 ) {
throw new StructureException ("matrix does not have size 3x3 !");
}
AtomIterator iter = new AtomIterator(structure) ;
while (iter.hasNext()) {
Atom atom = ite... | [
"public",
"static",
"final",
"void",
"rotate",
"(",
"Structure",
"structure",
",",
"double",
"[",
"]",
"[",
"]",
"rotationmatrix",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"rotationmatrix",
".",
"length",
"!=",
"3",
")",
"{",
"throw",
"new",
"S... | Rotate a structure. The rotation Matrix must be a pre-multiplication
Matrix.
@param structure
a Structure object
@param rotationmatrix
an array (3x3) of double representing the rotation matrix.
@throws StructureException
... | [
"Rotate",
"a",
"structure",
".",
"The",
"rotation",
"Matrix",
"must",
"be",
"a",
"pre",
"-",
"multiplication",
"Matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L394-L405 |
32,077 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.rotate | public static final void rotate(Group group, double[][] rotationmatrix)
throws StructureException {
if ( rotationmatrix.length != 3 ) {
throw new StructureException ("matrix does not have size 3x3 !");
}
AtomIterator iter = new AtomIterator(group) ;
while (iter.hasNext()) {
Atom atom = null ;
atom... | java | public static final void rotate(Group group, double[][] rotationmatrix)
throws StructureException {
if ( rotationmatrix.length != 3 ) {
throw new StructureException ("matrix does not have size 3x3 !");
}
AtomIterator iter = new AtomIterator(group) ;
while (iter.hasNext()) {
Atom atom = null ;
atom... | [
"public",
"static",
"final",
"void",
"rotate",
"(",
"Group",
"group",
",",
"double",
"[",
"]",
"[",
"]",
"rotationmatrix",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"rotationmatrix",
".",
"length",
"!=",
"3",
")",
"{",
"throw",
"new",
"Structure... | Rotate a Group. The rotation Matrix must be a pre-multiplication Matrix.
@param group
a group object
@param rotationmatrix
an array (3x3) of double representing the rotation matrix.
@throws StructureException
... | [
"Rotate",
"a",
"Group",
".",
"The",
"rotation",
"Matrix",
"must",
"be",
"a",
"pre",
"-",
"multiplication",
"Matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L417-L431 |
32,078 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.rotate | public static final void rotate(Atom atom, Matrix m){
double x = atom.getX();
double y = atom.getY();
double z = atom.getZ();
double[][] ad = new double[][]{{x,y,z}};
Matrix am = new Matrix(ad);
Matrix na = am.times(m);
atom.setX(na.get(0,0));
atom.setY(na.get(0,1));
atom.setZ(na.get(0,2));
} | java | public static final void rotate(Atom atom, Matrix m){
double x = atom.getX();
double y = atom.getY();
double z = atom.getZ();
double[][] ad = new double[][]{{x,y,z}};
Matrix am = new Matrix(ad);
Matrix na = am.times(m);
atom.setX(na.get(0,0));
atom.setY(na.get(0,1));
atom.setZ(na.get(0,2));
} | [
"public",
"static",
"final",
"void",
"rotate",
"(",
"Atom",
"atom",
",",
"Matrix",
"m",
")",
"{",
"double",
"x",
"=",
"atom",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"atom",
".",
"getY",
"(",
")",
";",
"double",
"z",
"=",
"atom",
".",
"... | Rotate an Atom around a Matrix object. The rotation Matrix must be a
pre-multiplication Matrix.
@param atom
atom to be rotated
@param m
rotation matrix to be applied to the atom | [
"Rotate",
"an",
"Atom",
"around",
"a",
"Matrix",
"object",
".",
"The",
"rotation",
"Matrix",
"must",
"be",
"a",
"pre",
"-",
"multiplication",
"Matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L442-L456 |
32,079 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.rotate | public static final void rotate(Group group, Matrix m){
AtomIterator iter = new AtomIterator(group) ;
while (iter.hasNext()) {
Atom atom = iter.next() ;
rotate(atom,m);
}
} | java | public static final void rotate(Group group, Matrix m){
AtomIterator iter = new AtomIterator(group) ;
while (iter.hasNext()) {
Atom atom = iter.next() ;
rotate(atom,m);
}
} | [
"public",
"static",
"final",
"void",
"rotate",
"(",
"Group",
"group",
",",
"Matrix",
"m",
")",
"{",
"AtomIterator",
"iter",
"=",
"new",
"AtomIterator",
"(",
"group",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"Atom",
"atom",
... | Rotate a group object. The rotation Matrix must be a pre-multiplication
Matrix.
@param group
a group to be rotated
@param m
a Matrix object representing the rotation matrix | [
"Rotate",
"a",
"group",
"object",
".",
"The",
"rotation",
"Matrix",
"must",
"be",
"a",
"pre",
"-",
"multiplication",
"Matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L467-L477 |
32,080 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.rotate | public static final void rotate(Structure structure, Matrix m){
AtomIterator iter = new AtomIterator(structure) ;
while (iter.hasNext()) {
Atom atom = iter.next() ;
rotate(atom,m);
}
} | java | public static final void rotate(Structure structure, Matrix m){
AtomIterator iter = new AtomIterator(structure) ;
while (iter.hasNext()) {
Atom atom = iter.next() ;
rotate(atom,m);
}
} | [
"public",
"static",
"final",
"void",
"rotate",
"(",
"Structure",
"structure",
",",
"Matrix",
"m",
")",
"{",
"AtomIterator",
"iter",
"=",
"new",
"AtomIterator",
"(",
"structure",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"Atom",
... | Rotate a structure object. The rotation Matrix must be a
pre-multiplication Matrix.
@param structure
the structure to be rotated
@param m
rotation matrix to be applied | [
"Rotate",
"a",
"structure",
"object",
".",
"The",
"rotation",
"Matrix",
"must",
"be",
"a",
"pre",
"-",
"multiplication",
"Matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L488-L498 |
32,081 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.transform | public static void transform(Atom[] ca, Matrix4d t) {
for (Atom atom : ca)
Calc.transform(atom, t);
} | java | public static void transform(Atom[] ca, Matrix4d t) {
for (Atom atom : ca)
Calc.transform(atom, t);
} | [
"public",
"static",
"void",
"transform",
"(",
"Atom",
"[",
"]",
"ca",
",",
"Matrix4d",
"t",
")",
"{",
"for",
"(",
"Atom",
"atom",
":",
"ca",
")",
"Calc",
".",
"transform",
"(",
"atom",
",",
"t",
")",
";",
"}"
] | Transform an array of atoms at once. The transformation Matrix must be a
post-multiplication Matrix.
@param ca
array of Atoms to shift
@param t
transformation Matrix4d | [
"Transform",
"an",
"array",
"of",
"atoms",
"at",
"once",
".",
"The",
"transformation",
"Matrix",
"must",
"be",
"a",
"post",
"-",
"multiplication",
"Matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L509-L512 |
32,082 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.plus | public static final void plus(Structure s, Matrix matrix){
AtomIterator iter = new AtomIterator(s) ;
Atom oldAtom = null;
Atom rotOldAtom = null;
while (iter.hasNext()) {
Atom atom = null ;
atom = iter.next() ;
try {
if ( oldAtom != null){
logger.debug("before {}", getDistance(oldAtom,atom));... | java | public static final void plus(Structure s, Matrix matrix){
AtomIterator iter = new AtomIterator(s) ;
Atom oldAtom = null;
Atom rotOldAtom = null;
while (iter.hasNext()) {
Atom atom = null ;
atom = iter.next() ;
try {
if ( oldAtom != null){
logger.debug("before {}", getDistance(oldAtom,atom));... | [
"public",
"static",
"final",
"void",
"plus",
"(",
"Structure",
"s",
",",
"Matrix",
"matrix",
")",
"{",
"AtomIterator",
"iter",
"=",
"new",
"AtomIterator",
"(",
"s",
")",
";",
"Atom",
"oldAtom",
"=",
"null",
";",
"Atom",
"rotOldAtom",
"=",
"null",
";",
... | calculate structure + Matrix coodinates ...
@param s
the structure to operate on
@param matrix
a Matrix object | [
"calculate",
"structure",
"+",
"Matrix",
"coodinates",
"..."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L649-L689 |
32,083 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.shift | public static final void shift(Structure structure, Atom a ){
AtomIterator iter = new AtomIterator(structure) ;
while (iter.hasNext() ) {
Atom atom = null ;
atom = iter.next() ;
Atom natom = add(atom,a);
double x = natom.getX();
double y = natom.getY() ;
double z = natom.getZ();
atom.setX(x... | java | public static final void shift(Structure structure, Atom a ){
AtomIterator iter = new AtomIterator(structure) ;
while (iter.hasNext() ) {
Atom atom = null ;
atom = iter.next() ;
Atom natom = add(atom,a);
double x = natom.getX();
double y = natom.getY() ;
double z = natom.getZ();
atom.setX(x... | [
"public",
"static",
"final",
"void",
"shift",
"(",
"Structure",
"structure",
",",
"Atom",
"a",
")",
"{",
"AtomIterator",
"iter",
"=",
"new",
"AtomIterator",
"(",
"structure",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"Atom",
"... | shift a structure with a vector.
@param structure
a Structure object
@param a
an Atom object representing a shift vector | [
"shift",
"a",
"structure",
"with",
"a",
"vector",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L699-L716 |
32,084 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.shift | public static final void shift(Atom a, Atom b){
Atom natom = add(a,b);
double x = natom.getX();
double y = natom.getY() ;
double z = natom.getZ();
a.setX(x);
a.setY(y);
a.setZ(z);
} | java | public static final void shift(Atom a, Atom b){
Atom natom = add(a,b);
double x = natom.getX();
double y = natom.getY() ;
double z = natom.getZ();
a.setX(x);
a.setY(y);
a.setZ(z);
} | [
"public",
"static",
"final",
"void",
"shift",
"(",
"Atom",
"a",
",",
"Atom",
"b",
")",
"{",
"Atom",
"natom",
"=",
"add",
"(",
"a",
",",
"b",
")",
";",
"double",
"x",
"=",
"natom",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"natom",
".",
... | Shift a vector.
@param a
vector a
@param b
vector b | [
"Shift",
"a",
"vector",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L726-L735 |
32,085 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getCentroid | public static final Atom getCentroid(Atom[] atomSet){
// if we don't catch this case, the centroid returned is (NaN,NaN,NaN), which can cause lots of problems down the line
if (atomSet.length==0)
throw new IllegalArgumentException("Atom array has length 0, can't calculate centroid!");
double[] coords = new ... | java | public static final Atom getCentroid(Atom[] atomSet){
// if we don't catch this case, the centroid returned is (NaN,NaN,NaN), which can cause lots of problems down the line
if (atomSet.length==0)
throw new IllegalArgumentException("Atom array has length 0, can't calculate centroid!");
double[] coords = new ... | [
"public",
"static",
"final",
"Atom",
"getCentroid",
"(",
"Atom",
"[",
"]",
"atomSet",
")",
"{",
"// if we don't catch this case, the centroid returned is (NaN,NaN,NaN), which can cause lots of problems down the line",
"if",
"(",
"atomSet",
".",
"length",
"==",
"0",
")",
"th... | Returns the centroid of the set of atoms.
@param atomSet
a set of Atoms
@return an Atom representing the Centroid of the set of atoms | [
"Returns",
"the",
"centroid",
"of",
"the",
"set",
"of",
"atoms",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L771-L799 |
32,086 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.centerOfMass | public static Atom centerOfMass(Atom[] points) {
Atom center = new AtomImpl();
float totalMass = 0.0f;
for (Atom a : points) {
float mass = a.getElement().getAtomicMass();
totalMass += mass;
center = scaleAdd(mass, a, center);
}
center = scaleEquals(center, 1.0f/totalMass);
return center;
} | java | public static Atom centerOfMass(Atom[] points) {
Atom center = new AtomImpl();
float totalMass = 0.0f;
for (Atom a : points) {
float mass = a.getElement().getAtomicMass();
totalMass += mass;
center = scaleAdd(mass, a, center);
}
center = scaleEquals(center, 1.0f/totalMass);
return center;
} | [
"public",
"static",
"Atom",
"centerOfMass",
"(",
"Atom",
"[",
"]",
"points",
")",
"{",
"Atom",
"center",
"=",
"new",
"AtomImpl",
"(",
")",
";",
"float",
"totalMass",
"=",
"0.0f",
";",
"for",
"(",
"Atom",
"a",
":",
"points",
")",
"{",
"float",
"mass",... | Returns the center of mass of the set of atoms. Atomic masses of the
Atoms are used.
@param points
a set of Atoms
@return an Atom representing the center of mass | [
"Returns",
"the",
"center",
"of",
"mass",
"of",
"the",
"set",
"of",
"atoms",
".",
"Atomic",
"masses",
"of",
"the",
"Atoms",
"are",
"used",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L809-L821 |
32,087 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.scale | public static Atom scale(Atom a, double s) {
double x = a.getX();
double y = a.getY();
double z = a.getZ();
Atom b = new AtomImpl();
b.setX(x*s);
b.setY(y*s);
b.setZ(z*s);
return b;
} | java | public static Atom scale(Atom a, double s) {
double x = a.getX();
double y = a.getY();
double z = a.getZ();
Atom b = new AtomImpl();
b.setX(x*s);
b.setY(y*s);
b.setZ(z*s);
return b;
} | [
"public",
"static",
"Atom",
"scale",
"(",
"Atom",
"a",
",",
"double",
"s",
")",
"{",
"double",
"x",
"=",
"a",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"a",
".",
"getY",
"(",
")",
";",
"double",
"z",
"=",
"a",
".",
"getZ",
"(",
")",
"... | Multiply elements of a by s
@param a
@param s
@return A new Atom with s*a | [
"Multiply",
"elements",
"of",
"a",
"by",
"s"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L854-L865 |
32,088 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getCenterVector | public static final Atom getCenterVector(Atom[] atomSet){
Atom centroid = getCentroid(atomSet);
return getCenterVector(atomSet,centroid);
} | java | public static final Atom getCenterVector(Atom[] atomSet){
Atom centroid = getCentroid(atomSet);
return getCenterVector(atomSet,centroid);
} | [
"public",
"static",
"final",
"Atom",
"getCenterVector",
"(",
"Atom",
"[",
"]",
"atomSet",
")",
"{",
"Atom",
"centroid",
"=",
"getCentroid",
"(",
"atomSet",
")",
";",
"return",
"getCenterVector",
"(",
"atomSet",
",",
"centroid",
")",
";",
"}"
] | Returns the Vector that needs to be applied to shift a set of atoms to
the Centroid.
@param atomSet
array of Atoms
@return the vector needed to shift the set of atoms to its geometric
center | [
"Returns",
"the",
"Vector",
"that",
"needs",
"to",
"be",
"applied",
"to",
"shift",
"a",
"set",
"of",
"atoms",
"to",
"the",
"Centroid",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L901-L906 |
32,089 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getCenterVector | public static final Atom getCenterVector(Atom[] atomSet, Atom centroid){
double[] coords = new double[3];
coords[0] = 0 - centroid.getX();
coords[1] = 0 - centroid.getY();
coords[2] = 0 - centroid.getZ();
Atom shiftVec = new AtomImpl();
shiftVec.setCoords(coords);
return shiftVec;
} | java | public static final Atom getCenterVector(Atom[] atomSet, Atom centroid){
double[] coords = new double[3];
coords[0] = 0 - centroid.getX();
coords[1] = 0 - centroid.getY();
coords[2] = 0 - centroid.getZ();
Atom shiftVec = new AtomImpl();
shiftVec.setCoords(coords);
return shiftVec;
} | [
"public",
"static",
"final",
"Atom",
"getCenterVector",
"(",
"Atom",
"[",
"]",
"atomSet",
",",
"Atom",
"centroid",
")",
"{",
"double",
"[",
"]",
"coords",
"=",
"new",
"double",
"[",
"3",
"]",
";",
"coords",
"[",
"0",
"]",
"=",
"0",
"-",
"centroid",
... | Returns the Vector that needs to be applied to shift a set of atoms to
the Centroid, if the centroid is already known
@param atomSet
array of Atoms
@return the vector needed to shift the set of atoms to its geometric
center | [
"Returns",
"the",
"Vector",
"that",
"needs",
"to",
"be",
"applied",
"to",
"shift",
"a",
"set",
"of",
"atoms",
"to",
"the",
"Centroid",
"if",
"the",
"centroid",
"is",
"already",
"known"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L917-L928 |
32,090 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.centerAtoms | public static final Atom[] centerAtoms(Atom[] atomSet)
throws StructureException {
Atom centroid = getCentroid(atomSet);
return centerAtoms(atomSet, centroid);
} | java | public static final Atom[] centerAtoms(Atom[] atomSet)
throws StructureException {
Atom centroid = getCentroid(atomSet);
return centerAtoms(atomSet, centroid);
} | [
"public",
"static",
"final",
"Atom",
"[",
"]",
"centerAtoms",
"(",
"Atom",
"[",
"]",
"atomSet",
")",
"throws",
"StructureException",
"{",
"Atom",
"centroid",
"=",
"getCentroid",
"(",
"atomSet",
")",
";",
"return",
"centerAtoms",
"(",
"atomSet",
",",
"centroi... | Center the atoms at the Centroid.
@param atomSet
a set of Atoms
@return an Atom representing the Centroid of the set of atoms
@throws StructureException | [
"Center",
"the",
"atoms",
"at",
"the",
"Centroid",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L938-L943 |
32,091 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.centerAtoms | public static final Atom[] centerAtoms(Atom[] atomSet, Atom centroid)
throws StructureException {
Atom shiftVector = getCenterVector(atomSet, centroid);
Atom[] newAtoms = new AtomImpl[atomSet.length];
for (int i =0 ; i < atomSet.length; i++){
Atom a = atomSet[i];
Atom n = add(a,shiftVector);
newAto... | java | public static final Atom[] centerAtoms(Atom[] atomSet, Atom centroid)
throws StructureException {
Atom shiftVector = getCenterVector(atomSet, centroid);
Atom[] newAtoms = new AtomImpl[atomSet.length];
for (int i =0 ; i < atomSet.length; i++){
Atom a = atomSet[i];
Atom n = add(a,shiftVector);
newAto... | [
"public",
"static",
"final",
"Atom",
"[",
"]",
"centerAtoms",
"(",
"Atom",
"[",
"]",
"atomSet",
",",
"Atom",
"centroid",
")",
"throws",
"StructureException",
"{",
"Atom",
"shiftVector",
"=",
"getCenterVector",
"(",
"atomSet",
",",
"centroid",
")",
";",
"Atom... | Center the atoms at the Centroid, if the centroid is already know.
@param atomSet
a set of Atoms
@return an Atom representing the Centroid of the set of atoms
@throws StructureException | [
"Center",
"the",
"atoms",
"at",
"the",
"Centroid",
"if",
"the",
"centroid",
"is",
"already",
"know",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L953-L966 |
32,092 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.createVirtualCBAtom | public static final Atom createVirtualCBAtom(AminoAcid amino)
throws StructureException{
AminoAcid ala = StandardAminoAcid.getAminoAcid("ALA");
Atom aN = ala.getN();
Atom aCA = ala.getCA();
Atom aC = ala.getC();
Atom aCB = ala.getCB();
Atom[] arr1 = new Atom[3];
arr1[0] = aN;
arr1[1] = aCA;
ar... | java | public static final Atom createVirtualCBAtom(AminoAcid amino)
throws StructureException{
AminoAcid ala = StandardAminoAcid.getAminoAcid("ALA");
Atom aN = ala.getN();
Atom aCA = ala.getCA();
Atom aC = ala.getC();
Atom aCB = ala.getCB();
Atom[] arr1 = new Atom[3];
arr1[0] = aN;
arr1[1] = aCA;
ar... | [
"public",
"static",
"final",
"Atom",
"createVirtualCBAtom",
"(",
"AminoAcid",
"amino",
")",
"throws",
"StructureException",
"{",
"AminoAcid",
"ala",
"=",
"StandardAminoAcid",
".",
"getAminoAcid",
"(",
"\"ALA\"",
")",
";",
"Atom",
"aN",
"=",
"ala",
".",
"getN",
... | creates a virtual C-beta atom. this might be needed when working with GLY
thanks to Peter Lackner for a python template of this method.
@param amino
the amino acid for which a "virtual" CB atom should be
calculated
@return a "virtual" CB atom
@throws StructureException | [
"creates",
"a",
"virtual",
"C",
"-",
"beta",
"atom",
".",
"this",
"might",
"be",
"needed",
"when",
"working",
"with",
"GLY"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L979-L1012 |
32,093 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.calcRotationAngleInDegrees | public static double calcRotationAngleInDegrees(Atom centerPt, Atom targetPt) {
// calculate the angle theta from the deltaY and deltaX values
// (atan2 returns radians values from [-PI,PI])
// 0 currently points EAST.
// NOTE: By preserving Y and X param order to atan2, we are expecting
// a CLOCKWISE angle... | java | public static double calcRotationAngleInDegrees(Atom centerPt, Atom targetPt) {
// calculate the angle theta from the deltaY and deltaX values
// (atan2 returns radians values from [-PI,PI])
// 0 currently points EAST.
// NOTE: By preserving Y and X param order to atan2, we are expecting
// a CLOCKWISE angle... | [
"public",
"static",
"double",
"calcRotationAngleInDegrees",
"(",
"Atom",
"centerPt",
",",
"Atom",
"targetPt",
")",
"{",
"// calculate the angle theta from the deltaY and deltaX values",
"// (atan2 returns radians values from [-PI,PI])",
"// 0 currently points EAST.",
"// NOTE: By prese... | Calculates the angle from centerPt to targetPt in degrees. The return
should range from [0,360), rotating CLOCKWISE, 0 and 360 degrees
represents NORTH, 90 degrees represents EAST, etc...
Assumes all points are in the same coordinate space. If they are not, you
will need to call SwingUtilities.convertPointToScreen or ... | [
"Calculates",
"the",
"angle",
"from",
"centerPt",
"to",
"targetPt",
"in",
"degrees",
".",
"The",
"return",
"should",
"range",
"from",
"[",
"0",
"360",
")",
"rotating",
"CLOCKWISE",
"0",
"and",
"360",
"degrees",
"represents",
"NORTH",
"90",
"degrees",
"repres... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1125-L1153 |
32,094 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.shift | public static void shift(Atom[] ca, Atom b) {
for (Atom atom : ca)
Calc.shift(atom, b);
} | java | public static void shift(Atom[] ca, Atom b) {
for (Atom atom : ca)
Calc.shift(atom, b);
} | [
"public",
"static",
"void",
"shift",
"(",
"Atom",
"[",
"]",
"ca",
",",
"Atom",
"b",
")",
"{",
"for",
"(",
"Atom",
"atom",
":",
"ca",
")",
"Calc",
".",
"shift",
"(",
"atom",
",",
")",
";",
"}"
] | Shift an array of atoms at once.
@param ca
array of Atoms to shift
@param b
reference Atom vector | [
"Shift",
"an",
"array",
"of",
"atoms",
"at",
"once",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1182-L1185 |
32,095 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getTransformation | public static Matrix4d getTransformation(Matrix rot, Atom trans) {
return new Matrix4d(new Matrix3d(rot.getColumnPackedCopy()),
new Vector3d(trans.getCoordsAsPoint3d()), 1.0);
} | java | public static Matrix4d getTransformation(Matrix rot, Atom trans) {
return new Matrix4d(new Matrix3d(rot.getColumnPackedCopy()),
new Vector3d(trans.getCoordsAsPoint3d()), 1.0);
} | [
"public",
"static",
"Matrix4d",
"getTransformation",
"(",
"Matrix",
"rot",
",",
"Atom",
"trans",
")",
"{",
"return",
"new",
"Matrix4d",
"(",
"new",
"Matrix3d",
"(",
"rot",
".",
"getColumnPackedCopy",
"(",
")",
")",
",",
"new",
"Vector3d",
"(",
"trans",
"."... | Convert JAMA rotation and translation to a Vecmath transformation matrix.
Because the JAMA matrix is a pre-multiplication matrix and the Vecmath
matrix is a post-multiplication one, the rotation matrix is transposed to
ensure that the transformation they produce is the same.
@param rot
3x3 Rotation matrix
@param trans... | [
"Convert",
"JAMA",
"rotation",
"and",
"translation",
"to",
"a",
"Vecmath",
"transformation",
"matrix",
".",
"Because",
"the",
"JAMA",
"matrix",
"is",
"a",
"pre",
"-",
"multiplication",
"matrix",
"and",
"the",
"Vecmath",
"matrix",
"is",
"a",
"post",
"-",
"mul... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1199-L1202 |
32,096 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getTranslationVector | public static Atom getTranslationVector(Matrix4d transform){
Atom transl = new AtomImpl();
double[] coords = {transform.m03, transform.m13, transform.m23};
transl.setCoords(coords);
return transl;
} | java | public static Atom getTranslationVector(Matrix4d transform){
Atom transl = new AtomImpl();
double[] coords = {transform.m03, transform.m13, transform.m23};
transl.setCoords(coords);
return transl;
} | [
"public",
"static",
"Atom",
"getTranslationVector",
"(",
"Matrix4d",
"transform",
")",
"{",
"Atom",
"transl",
"=",
"new",
"AtomImpl",
"(",
")",
";",
"double",
"[",
"]",
"coords",
"=",
"{",
"transform",
".",
"m03",
",",
"transform",
".",
"m13",
",",
"tran... | Extract the translational vector as an Atom of a transformation matrix.
@param transform
Matrix4d
@return Atom shift vector | [
"Extract",
"the",
"translational",
"vector",
"as",
"an",
"Atom",
"of",
"a",
"transformation",
"matrix",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1211-L1217 |
32,097 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.rmsd | public static double rmsd(Atom[] x, Atom[] y) {
return CalcPoint.rmsd(atomsToPoints(x), atomsToPoints(y));
} | java | public static double rmsd(Atom[] x, Atom[] y) {
return CalcPoint.rmsd(atomsToPoints(x), atomsToPoints(y));
} | [
"public",
"static",
"double",
"rmsd",
"(",
"Atom",
"[",
"]",
"x",
",",
"Atom",
"[",
"]",
"y",
")",
"{",
"return",
"CalcPoint",
".",
"rmsd",
"(",
"atomsToPoints",
"(",
"x",
")",
",",
"atomsToPoints",
"(",
"y",
")",
")",
";",
"}"
] | Calculate the RMSD of two Atom arrays, already superposed.
@param x
array of Atoms superposed to y
@param y
array of Atoms superposed to x
@return RMSD | [
"Calculate",
"the",
"RMSD",
"of",
"two",
"Atom",
"arrays",
"already",
"superposed",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1257-L1259 |
32,098 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/CliTools.java | CliTools.getEnumValuesAsString | public static <T extends Enum<?>> String getEnumValuesAsString(Class<T> enumClass) {
//ScoringStrategy[] vals = ScoringStrategy.values();
T[] vals = enumClass.getEnumConstants();
StringBuilder str = new StringBuilder();
if(vals.length == 1) {
str.append(vals[0].name());
} else if(vals.length > 1 ) {
fo... | java | public static <T extends Enum<?>> String getEnumValuesAsString(Class<T> enumClass) {
//ScoringStrategy[] vals = ScoringStrategy.values();
T[] vals = enumClass.getEnumConstants();
StringBuilder str = new StringBuilder();
if(vals.length == 1) {
str.append(vals[0].name());
} else if(vals.length > 1 ) {
fo... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"?",
">",
">",
"String",
"getEnumValuesAsString",
"(",
"Class",
"<",
"T",
">",
"enumClass",
")",
"{",
"//ScoringStrategy[] vals = ScoringStrategy.values();",
"T",
"[",
"]",
"vals",
"=",
"enumClass",
".",
"g... | Constructs a comma-separated list of values for an enum.
Example:
> getEnumValues(ScoringStrategy.class)
"CA_SCORING, SIDE_CHAIN_SCORING, SIDE_CHAIN_ANGLE_SCORING, CA_AND_SIDE_CHAIN_ANGLE_SCORING, or SEQUENCE_CONSERVATION"
@param enumClass
@return | [
"Constructs",
"a",
"comma",
"-",
"separated",
"list",
"of",
"values",
"for",
"an",
"enum",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/CliTools.java#L340-L357 |
32,099 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/UnitCellBoundingBox.java | UnitCellBoundingBox.getTranslatedBbs | public UnitCellBoundingBox getTranslatedBbs(Vector3d translation) {
UnitCellBoundingBox translatedBbs = new UnitCellBoundingBox(numOperatorsSg, numPolyChainsAu);
for (int i=0; i<numOperatorsSg; i++) {
for (int j = 0;j<numPolyChainsAu; j++) {
translatedBbs.chainBbs[i][j] = new BoundingBox(this.chainBbs[i][j]... | java | public UnitCellBoundingBox getTranslatedBbs(Vector3d translation) {
UnitCellBoundingBox translatedBbs = new UnitCellBoundingBox(numOperatorsSg, numPolyChainsAu);
for (int i=0; i<numOperatorsSg; i++) {
for (int j = 0;j<numPolyChainsAu; j++) {
translatedBbs.chainBbs[i][j] = new BoundingBox(this.chainBbs[i][j]... | [
"public",
"UnitCellBoundingBox",
"getTranslatedBbs",
"(",
"Vector3d",
"translation",
")",
"{",
"UnitCellBoundingBox",
"translatedBbs",
"=",
"new",
"UnitCellBoundingBox",
"(",
"numOperatorsSg",
",",
"numPolyChainsAu",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Returns a new BoundingBoxes object containing the same bounds as this
BoundingBoxes object translated by the given translation
@param translation
@return | [
"Returns",
"a",
"new",
"BoundingBoxes",
"object",
"containing",
"the",
"same",
"bounds",
"as",
"this",
"BoundingBoxes",
"object",
"translated",
"by",
"the",
"given",
"translation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/UnitCellBoundingBox.java#L114-L126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.