X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions biojava3-structure-gui/readme.txt

This file was deleted.

5 changes: 5 additions & 0 deletions biojava3-structure/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target
.project
.profile
.settings
.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Formatter;
import java.util.List;
import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,7 @@ private static boolean isHbondDonorAcceptor(Atom atom) {
* @return a structure that contains only the first model
* @since 3.0.5
*/
@SuppressWarnings("deprecation")
public static Structure removeModels(Structure s){
if ( ! s.isNmr())
return s;
Expand All @@ -1055,6 +1056,8 @@ public static Structure removeModels(Structure s){

n.setPDBCode(s.getPDBCode());
n.setName(s.getName());

// we are calling this legacy menthod for backwards compatibility
n.setHeader(s.getHeader());
//TODO: do deep copying of data!
n.setPDBHeader(s.getPDBHeader());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package org.biojava.bio.structure.align;

import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;

import org.biojava.bio.structure.StructureException;
import org.biojava.bio.structure.align.ce.CeCPMain;
import org.biojava.bio.structure.align.ce.CeMain;
import org.biojava.bio.structure.align.ce.OptimalCECPMain;
import org.biojava.bio.structure.align.fatcat.FatCatFlexible;
import org.biojava.bio.structure.align.fatcat.FatCatRigid;
import org.biojava.bio.structure.align.seq.SmithWaterman3Daligner;
Expand Down Expand Up @@ -82,6 +80,7 @@ public static void clearAlgorithms() {
algorithms.clear();
}

@SuppressWarnings("unchecked")
public static StructureAlignment getAlgorithm(String name) throws StructureException{
for ( StructureAlignment algo : algorithms){
if (algo.getAlgorithmName().equalsIgnoreCase(name)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ public void setBioAssemblyFallback(boolean bioAssemblyFallback) {
*/

private InputStream getInputStream(String pdbId)
throws IOException
{
throws IOException {

if ( pdbId.length() < 4)
throw new IOException("the provided ID does not look like a PDB ID : " + pdbId);
Expand All @@ -417,7 +416,6 @@ private InputStream getInputStream(String pdbId)
// it probably should be downloaded again...
pdbFile = null;
}

}
if ( pdbFile == null ) {
if (autoFetch){//from here we try our online search
Expand All @@ -440,7 +438,7 @@ private InputStream getInputStream(String pdbId)
}
}
return null ;
}
}

/** Returns null if local PDB file does not exist or should be downloaded again...
*
Expand Down Expand Up @@ -551,7 +549,7 @@ private InputStream getInputStreamBioAssembly(String pdbId)

String fileName = fpath + getBiologicalAsssemblyFileName(pdbId.toLowerCase(), bioAssemblyId);
File f = new File(fileName) ;

// check if bio assembly file exists in local cache
if ( f.exists()) {
InputStreamProvider isp = new InputStreamProvider();
Expand Down Expand Up @@ -733,7 +731,7 @@ private File downloadPDBBiologicalAssembly(String pdbId, String pathOnServer){
// and the fallback has been set, get the original PDB file instead (i.e. for NMR structures).

File f = null;

try {
f = downloadFileIfAvailable(url, pdbId,fileName);
} catch (IOException ioe){
Expand Down Expand Up @@ -783,7 +781,7 @@ private File downloadFileIfAvailable(URL url, String pdbId, String fileName) thr
} else {
tempFile = new File(path + LOCAL_BIO_ASSEMBLY_DIRECTORY + "/" + fileName);
}

return FileDownloadUtils.downloadFileIfAvailable(url, tempFile);
}

Expand Down Expand Up @@ -837,14 +835,14 @@ public boolean checkFileExists(String pdbId){
if ( path != null)
return true;
return false;

}

public void downloadPDB(String pdbId){
//don't overwrite existing files
if ( checkFileExists(pdbId))
return;

if (autoFetch){//from here we try our online search
if(fetchCurrent && !fetchFileEvenIfObsolete) {
String current = PDBStatus.getCurrent(pdbId);
Expand All @@ -860,9 +858,9 @@ public void downloadPDB(String pdbId){
downloadPDB(pdbId, CURRENT_FILES_PATH);
}
}

}


/** load a structure from local file system and return a PDBStructure object

Expand Down Expand Up @@ -1010,7 +1008,7 @@ private String getBiologicalAsssemblyFileName(String pdbId, int biologicalAssemb
return pdbId + ".pdb" + biologicalAssemblyId + ".gz";
}




}
86 changes: 86 additions & 0 deletions development/eclipse/biojava-checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: biojava
Description:
Checkstyle configuration that checks the biojava coding conventions.
-->
<module name="Checker">
<property name="severity" value="warning"/>
<module name="TreeWalker">
<module name="JavadocMethod">
<property name="suppressLoadErrors" value="true"/>
</module>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<module name="LineLength">
<property name="max" value="120"/>
<property name="tabWidth" value="4"/>
</module>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="AvoidInlineConditionals"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows">
<property name="suppressLoadErrors" value="true"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="DesignForExtension"/>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>
<module name="ArrayTypeStyle"/>
<module name="FinalParameters"/>
<module name="TodoComment"/>
<module name="UpperEll"/>
<module name="OperatorWrap"/>
<module name="OperatorWrap"/>
</module>
<module name="JavadocPackage"/>
<module name="NewlineAtEndOfFile"/>
<module name="Translation"/>
<module name="FileLength"/>
<module name="FileTabCharacter"/>
</module>
56 changes: 56 additions & 0 deletions development/eclipse/biojava-cleanup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="2">
<profile kind="CleanUpProfile" name="biojava" version="2">
<setting id="cleanup.remove_unused_private_fields" value="true"/>
<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.never_use_blocks" value="false"/>
<setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
<setting id="cleanup.remove_unused_private_methods" value="true"/>
<setting id="cleanup.convert_to_enhanced_for_loop" value="false"/>
<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>
<setting id="cleanup.sort_members" value="false"/>
<setting id="cleanup.remove_unused_local_variables" value="false"/>
<setting id="cleanup.remove_unused_private_members" value="false"/>
<setting id="cleanup.never_use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.remove_unnecessary_casts" value="true"/>
<setting id="cleanup.make_parameters_final" value="true"/>
<setting id="cleanup.use_this_for_non_static_field_access" value="true"/>
<setting id="cleanup.use_blocks" value="true"/>
<setting id="cleanup.remove_private_constructors" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_method_access" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces_all" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_field_access" value="false"/>
<setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="true"/>
<setting id="cleanup.add_default_serial_version_id" value="true"/>
<setting id="cleanup.make_type_abstract_if_missing_method" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/>
<setting id="cleanup.make_variable_declarations_final" value="true"/>
<setting id="cleanup.add_missing_nls_tags" value="false"/>
<setting id="cleanup.format_source_code" value="true"/>
<setting id="cleanup.add_missing_override_annotations" value="true"/>
<setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.remove_unused_private_types" value="true"/>
<setting id="cleanup.make_local_variable_final" value="true"/>
<setting id="cleanup.add_missing_methods" value="true"/>
<setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/>
<setting id="cleanup.correct_indentation" value="true"/>
<setting id="cleanup.remove_unused_imports" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/>
<setting id="cleanup.make_private_fields_final" value="true"/>
<setting id="cleanup.add_generated_serial_version_id" value="false"/>
<setting id="cleanup.organize_imports" value="true"/>
<setting id="cleanup.sort_members_all" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces" value="true"/>
<setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/>
<setting id="cleanup.use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.add_missing_annotations" value="true"/>
<setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/>
<setting id="cleanup.use_this_for_non_static_method_access" value="true"/>
<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
<setting id="cleanup.add_serial_version_id" value="true"/>
<setting id="cleanup.always_use_blocks" value="true"/>
<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
<setting id="cleanup.format_source_code_changes_only" value="false"/>
</profile>
</profiles>
Loading
X Tutup