Skip to content

Commit

Permalink
migrated to new SiNGA version
Browse files Browse the repository at this point in the history
  • Loading branch information
fkaiser committed Jul 20, 2018
1 parent 5de48d2 commit a4e52ce
Show file tree
Hide file tree
Showing 31 changed files with 170 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .idea/artifacts/fit3d_web_war.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions .idea/artifacts/fit3d_web_war_exploded.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Fit3D is a software for template-based and template-free detection of substructu
## Background
The biological function of proteins and nucleic acids, such as riboswitches or ribozymes, relies on the correct arrangement of small substructural units to catalyze substrates, bind ligands, or to
preserve an ordered state. These molecular building blocks have evolved to retain similar interaction patterns and geometrical features to ensure functionality. While some of these patterns are
reflected in recurring sequence motifs, evolutionarily remote proteins may only share a small set of similar structural motifs, which are not obvious on sequence level. The Fit3D algorithm is a
reflected in recurring sequence motifs, evolutionarily remote proteins may only share a small set of similar structural motifs, which are not obvious at sequence level. The Fit3D algorithm is a
highly accurate search engine to detect substructure similarities based on a given template. Additionally, it uses the [mmm](https://github.com/fkaiserbio/mmm) framework
to discover structural motifs without the need for a template.

Expand Down
10 changes: 5 additions & 5 deletions fit3d-cli/fit3d-cli.iml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<orderEntry type="library" name="R User Library" level="project" />
<orderEntry type="library" name="R Skeletons" level="application" />
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-structure:0.3.3" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-mathematics:0.3.3" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-features:0.3.3" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-structure:0.4.0" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-mathematics:0.4.0" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-features:0.4.0" level="project" />
<orderEntry type="library" name="Maven: tec.uom:uom-se:1.0.8" level="project" />
<orderEntry type="library" name="Maven: javax.measure:unit-api:1.0" level="project" />
<orderEntry type="library" name="Maven: tec.uom.lib:uom-lib-common:1.0.2" level="project" />
Expand All @@ -29,8 +29,8 @@
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
<orderEntry type="library" name="Maven: org.rcsb:mmtf-api:1.0.7" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
<orderEntry type="library" name="Maven: bio.fkaiser.mmm:mmm-core:0.1.2" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-core:0.3.3" level="project" />
<orderEntry type="library" name="Maven: bio.fkaiser.mmm:mmm-core:0.2.0" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-core:0.4.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.7" level="project" />
Expand Down
8 changes: 4 additions & 4 deletions fit3d-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<properties>
<fit3d-cli.version>0.2.0</fit3d-cli.version>
<fit3d-cli.version>0.3.0</fit3d-cli.version>
</properties>

<groupId>bio.fkaiser.fit3d</groupId>
Expand Down Expand Up @@ -108,14 +108,14 @@
<version>1.4</version>
</dependency>
<dependency>
<groupId>de.bioforscher.singa</groupId>
<groupId>bio.singa</groupId>
<artifactId>singa-structure</artifactId>
<version>0.3.3</version>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>bio.fkaiser.mmm</groupId>
<artifactId>mmm-core</artifactId>
<version>0.1.2</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>me.tongfei</groupId>
Expand Down
57 changes: 39 additions & 18 deletions fit3d-cli/src/main/java/bio/fkaiser/fit3d/cli/Fit3DCommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
import bio.fkaiser.mmm.model.mapping.rules.ChemicalGroupsMappingRule;
import bio.fkaiser.mmm.model.mapping.rules.FunctionalGroupsMappingRule;
import bio.fkaiser.mmm.model.plip.PlipPostRequest;
import de.bioforscher.singa.core.utility.Resources;
import de.bioforscher.singa.structure.algorithms.superimposition.fit3d.representations.RepresentationSchemeType;
import de.bioforscher.singa.structure.algorithms.superimposition.fit3d.statistics.FofanovEstimation;
import de.bioforscher.singa.structure.algorithms.superimposition.fit3d.statistics.StarkEstimation;
import de.bioforscher.singa.structure.algorithms.superimposition.fit3d.statistics.StatisticalModel;
import de.bioforscher.singa.structure.model.families.AminoAcidFamily;
import de.bioforscher.singa.structure.model.identifiers.LeafIdentifier;
import de.bioforscher.singa.structure.model.interfaces.Atom;
import de.bioforscher.singa.structure.model.interfaces.LeafSubstructure;
import de.bioforscher.singa.structure.model.interfaces.Structure;
import de.bioforscher.singa.structure.model.oak.StructuralEntityFilter;
import de.bioforscher.singa.structure.model.oak.StructuralEntityFilter.AtomFilter;
import de.bioforscher.singa.structure.model.oak.StructuralMotif;
import de.bioforscher.singa.structure.parser.pdb.rest.cluster.PDBSequenceCluster;
import de.bioforscher.singa.structure.parser.pdb.rest.cluster.PDBSequenceCluster.PDBSequenceClusterIdentity;
import de.bioforscher.singa.structure.parser.pdb.structures.SourceLocation;
import de.bioforscher.singa.structure.parser.pdb.structures.StructureParser;
import de.bioforscher.singa.structure.parser.pdb.structures.StructureParserException;
import bio.singa.core.utility.Resources;
import bio.singa.structure.algorithms.superimposition.fit3d.representations.RepresentationSchemeType;
import bio.singa.structure.algorithms.superimposition.fit3d.statistics.FofanovEstimation;
import bio.singa.structure.algorithms.superimposition.fit3d.statistics.StarkEstimation;
import bio.singa.structure.algorithms.superimposition.fit3d.statistics.StatisticalModel;
import bio.singa.structure.model.families.AminoAcidFamily;
import bio.singa.structure.model.identifiers.LeafIdentifier;
import bio.singa.structure.model.interfaces.Atom;
import bio.singa.structure.model.interfaces.LeafSubstructure;
import bio.singa.structure.model.interfaces.Structure;
import bio.singa.structure.model.oak.StructuralEntityFilter;
import bio.singa.structure.model.oak.StructuralEntityFilter.AtomFilter;
import bio.singa.structure.model.oak.StructuralMotif;
import bio.singa.structure.parser.pdb.rest.cluster.PDBSequenceCluster;
import bio.singa.structure.parser.pdb.rest.cluster.PDBSequenceCluster.PDBSequenceClusterIdentity;
import bio.singa.structure.parser.pdb.structures.SourceLocation;
import bio.singa.structure.parser.pdb.structures.StructureParser;
import bio.singa.structure.parser.pdb.structures.StructureParserException;
import org.apache.commons.cli.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -78,6 +78,8 @@ public class Fit3DCommandLine {
private int numberOfThreads = DEFAULT_NUMBER_OF_THREADS;
private Path outputDirectoryPath;
private ItemsetMinerConfiguration<String> itemsetMinerConfiguration;
private boolean distanceFiltering;
private Double filterThreshold;

public Fit3DCommandLine(Fit3DMode mode, CommandLine commandLine) throws ParseException {
this.mode = mode;
Expand Down Expand Up @@ -471,6 +473,17 @@ private void initializeTemplateBasedParameters() throws Fit3DCommandLineExceptio
if (commandLine.hasOption('P')) {
createStatisticalModel();
}

// check if distance filtering is enabled
if (commandLine.hasOption('y')) {
try {
distanceFiltering = true;
filterThreshold = Double.valueOf(commandLine.getOptionValue('y'));
} catch (NumberFormatException e) {
logger.error("failed to parse distance filtering threshold", e);
throw new Fit3DCommandLineException("Initialization of parameters failed.");
}
}
}

private void createStatisticalModel() throws ParseException {
Expand Down Expand Up @@ -607,6 +620,10 @@ public Double getDistanceTolerance() {
return distanceTolerance;
}

public Double getFilterThreshold() {
return filterThreshold;
}

public ItemsetMinerConfiguration<String> getItemsetMinerConfiguration() {
return itemsetMinerConfiguration;
}
Expand Down Expand Up @@ -651,6 +668,10 @@ public Path getTargetListPath() {
return targetListPath;
}

public boolean isDistanceFiltering() {
return distanceFiltering;
}

public boolean isEcMapping() {
return ecMapping;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package bio.fkaiser.fit3d.cli;

import de.bioforscher.singa.structure.algorithms.superimposition.fit3d.Fit3D;
import de.bioforscher.singa.structure.algorithms.superimposition.fit3d.Fit3DBuilder;
import de.bioforscher.singa.structure.algorithms.superimposition.fit3d.Fit3DMatch;
import de.bioforscher.singa.structure.model.interfaces.LeafSubstructureContainer;
import de.bioforscher.singa.structure.parser.pdb.structures.StructureParser;
import de.bioforscher.singa.structure.parser.pdb.structures.StructureParserOptions;
import bio.singa.structure.algorithms.superimposition.fit3d.Fit3D;
import bio.singa.structure.algorithms.superimposition.fit3d.Fit3DBuilder;
import bio.singa.structure.algorithms.superimposition.fit3d.Fit3DMatch;
import bio.singa.structure.model.interfaces.LeafSubstructureContainer;
import bio.singa.structure.parser.pdb.structures.StructureParser;
import bio.singa.structure.parser.pdb.structures.StructureParserOptions;
import me.tongfei.progressbar.ProgressBar;
import me.tongfei.progressbar.ProgressBarStyle;
import org.slf4j.Logger;
Expand Down Expand Up @@ -151,6 +151,11 @@ private void run() throws Fit3DCommandLineException {
parameterStep.mapUniProtIdentifiers();
}

// set environment filtering
if(commandLine.isDistanceFiltering()){
parameterStep.filterEnvironments(commandLine.getFilterThreshold());
}

Timer timer = null;
ProgressTask progressTask = null;
if (multiParser != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ private void generateOptions() {
rmsd.setArgs(1);
options.addOption(rmsd);

Option distanceFiltering = new Option("y","filter local environments based on distance thresholds (default: disabled)");
distanceFiltering.setLongOpt("distance-filtering");
distanceFiltering.setArgs(1);
options.addOption(distanceFiltering);

// motif extraction
Option motifExtraction = new Option("X",
"extract motif from structure input (-m) following the syntax [chain]-[residue type][residue number]_... (e.g. A-E651_A-D649_A-T177)\n" +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package bio.fkaiser.fit3d.cli;

import de.bioforscher.singa.structure.parser.pdb.rest.cluster.PDBSequenceCluster;
import bio.singa.structure.parser.pdb.rest.cluster.PDBSequenceCluster;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionGroup;

Expand Down
4 changes: 2 additions & 2 deletions fit3d-cli/src/main/resources/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %5p [%c{1}:%M] - %m%n
log4j.category.de.bioforscher.singa=ERROR
log4j.category.de.bioforscher.singa.structure.parser.pdb.structures.StructureParser=WARN
log4j.category.bio.singa=ERROR
log4j.category.bio.singa.structure.parser.pdb.structures.StructureParser=WARN
log4j.category.bio.fkaiser.mmm=ERROR
log4j.category.bio.fkaiser.mmm.model.enrichment.IntraChainInteractionEnricher=WARN
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package bio.fkaiser.fit3d.cli;

import de.bioforscher.singa.core.utility.Resources;
import bio.singa.core.utility.Resources;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

import static org.junit.Assert.assertTrue;

/**
* @author fk
*/
Expand Down Expand Up @@ -88,6 +85,22 @@ public void runWithMotifAndChainList() throws IOException {
Fit3DCommandLine.main(commandLineArguments);
}

@Test
public void runWithMotifAndChainListAndFiltering() throws IOException {

copyResource(MOTIF_RESOURCE);
copyResource(CHAIN_LIST_RESOURCE);

String[] commandLineArguments = new String[]{"template-based",
"-m", folder.getRoot().toString() + "/" + MOTIF_RESOURCE,
"-l", folder.getRoot().toString() + "/" + CHAIN_LIST_RESOURCE,
"-r", "4.0",
"-y", "3.0",
"-f", folder.getRoot().toString() + "/summary.csv"};
Fit3DCommandLine.main(commandLineArguments);
}


@Test
public void runWithTargetFile() throws IOException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package bio.fkaiser.fit3d.cli;

import de.bioforscher.singa.core.utility.Resources;
import bio.singa.core.utility.Resources;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
Expand Down
8 changes: 4 additions & 4 deletions fit3d-web/fit3d-web.iml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: org.primefaces:primefaces:6.1" level="project" />
<orderEntry type="library" name="Maven: org.primefaces.themes:bootstrap:1.0.10" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-structure:0.3.3" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-mathematics:0.3.3" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-features:0.3.3" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-structure:0.4.0" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-mathematics:0.4.0" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-features:0.4.0" level="project" />
<orderEntry type="library" name="Maven: tec.uom:uom-se:1.0.8" level="project" />
<orderEntry type="library" name="Maven: javax.measure:unit-api:1.0" level="project" />
<orderEntry type="library" name="Maven: tec.uom.lib:uom-lib-common:1.0.2" level="project" />
Expand All @@ -59,7 +59,7 @@
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
<orderEntry type="library" name="Maven: org.rcsb:mmtf-api:1.0.7" level="project" />
<orderEntry type="library" name="Maven: de.bioforscher.singa:singa-core:0.3.3" level="project" />
<orderEntry type="library" name="Maven: bio.singa:singa-core:0.4.0" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.7" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" name="Maven: org.omnifaces:omnifaces:1.10" level="project" />
Expand Down
12 changes: 6 additions & 6 deletions fit3d-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>de.bioforscher.fit3d</groupId>
<groupId>bio.fkaiser.fit3d</groupId>
<artifactId>fit3d-web</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
<packaging>war</packaging>

<properties>
Expand Down Expand Up @@ -68,14 +68,14 @@
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>de.bioforscher.singa</groupId>
<groupId>bio.singa</groupId>
<artifactId>singa-structure</artifactId>
<version>0.3.3</version>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>de.bioforscher.singa</groupId>
<groupId>bio.singa</groupId>
<artifactId>singa-core</artifactId>
<version>0.3.3</version>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
Expand Down
Loading

0 comments on commit a4e52ce

Please sign in to comment.