Skip to content

Commit dffd286

Browse files
committed
Create Test templates for MultipleAlignment
1 parent 063925a commit dffd286

File tree

4 files changed

+60
-6
lines changed

4 files changed

+60
-6
lines changed

biojava-structure-gui/src/main/java/demo/DemoCEMC.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void main(String[] args) throws IOException, StructureException, I
3838
//Calcium Binding (MUSTA paper)
3939
//List<String> names = Arrays.asList("4cpv", "2scp.A", "2sas", "1top", "1scm.B", "3icb");
4040
//Serine Rich Proteins SERP (MUSTA paper)
41-
List<String> names = Arrays.asList("7api.A", "8api.A", "1hle.A", "1ova.A", "2ach.A", "9api.A", "1psi", "1atu", "1kct", "1ath.A", "1att.A");
41+
//List<String> names = Arrays.asList("7api.A", "8api.A", "1hle.A", "1ova.A", "2ach.A", "9api.A", "1psi", "1atu", "1kct", "1ath.A", "1att.A");
4242
//Serine Proteases (MUSTA paper)
4343
//List<String> names = Arrays.asList("1cse.E", "1sbn.E", "1pek.E", "3prk", "3tec.E");
4444
//GPCRs
@@ -48,11 +48,13 @@ public static void main(String[] args) throws IOException, StructureException, I
4848
//Globins (MAMMOTH and MUSTA papers)
4949
//List<String> names = Arrays.asList("1mbc", "1hlb", "1thb.A", "1ith.A", "1idr.A", "1dlw", "1kr7.A", "1ew6.A", "1it2.A", "1eco", "3sdh.A", "1cg5.B", "1fhj.B", "1ird.A", "1mba", "2gdm", "1b0b", "1h97.A", "1ash.A", "1jl7.A");
5050
//Rossman-Fold (POSA paper)
51-
//List<String> names = Arrays.asList("d1heta2", "d1ek6a_", "d1obfo1", "2cmd", "d1np3a2", "d1bgva1", "d1id1a_", "d1id1a_", "d1oi7a1");
51+
List<String> names = Arrays.asList("d1heta2", "d1ek6a_", "d1obfo1", "2cmd", "d1np3a2", "d1bgva1", "d1id1a_", "d1id1a_", "d1oi7a1");
5252
//Circular Permutations (Bliven CECP paper) - dynamin GTP-ase with CP G-domain
5353
//List<String> names = Arrays.asList("d1u0la2", "d1jwyb_");
5454
//Circular Permutations: SAND and MFPT domains
5555
//List<String> names = Arrays.asList("d2bjqa1", "d1h5pa_", "d1ufna_"); //"d1oqja"
56+
//Flexible domain family of proteins (FatCat paper?)
57+
5658
//Ankyrin Repeats
5759
//List<String> names = Arrays.asList("d1n0ra_", "3ehq.A", "1awc.B"); //ankyrin
5860

biojava-structure/src/main/java/org/biojava/nbio/structure/align/cemc/CeMcOptimizer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.biojava.nbio.structure.align.cemc;
22

3+
import java.io.FileNotFoundException;
34
import java.io.FileWriter;
45
import java.io.IOException;
56
import java.util.ArrayList;
@@ -36,10 +37,10 @@ public class CeMcOptimizer implements Callable<MultipleAlignment> {
3637

3738
private static final boolean debug = true; //Prints the optimization moves and saves a file of the history
3839
private Random rnd;
39-
private MultipleSuperimposer imposer;;
40+
private MultipleSuperimposer imposer;
4041

4142
//Optimization parameters
42-
private static int Rmin = 2; //Minimum number of aligned structures without a gap (33% of initial)
43+
private int Rmin = 2; //Minimum number of aligned structures without a gap (33% of initial)
4344
private static final int Lmin = 15; //Minimum alignment length of a Block
4445
private static final int iterFactor = 100; //Factor to control the max number of iterations of optimization
4546
private static final double C = 20; //Probability function constant (probability of acceptance for bad moves)
@@ -82,7 +83,10 @@ public CeMcOptimizer(MultipleAlignment seedAln, long randomSeed, int reference)
8283
public MultipleAlignment call() throws Exception {
8384
//The maximum number of iterations depends on the maximum possible alignment length and the number of structures
8485
optimizeMC(iterFactor*Collections.min(structureLengths)*size);
85-
if (debug) saveHistory("/scratch/cemc/CeMcOptimizationHistory.csv");
86+
try {
87+
if (debug) saveHistory("/scratch/cemc/CeMcOptimizationHistory.csv");
88+
} catch(FileNotFoundException e) {}
89+
8690
return msa;
8791
}
8892

biojava-structure/src/test/java/org/biojava/nbio/structure/align/multiple/MultipleAlignmentScorerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
import static org.junit.Assert.*;
1919

2020
/**
21-
* Test the correctness of various Scores calculation for {@link MultipleAlignment}s.
21+
* Test the correctness of various Score calculations for {@link MultipleAlignment}s.
2222
* <p>
2323
* Currently tested:
2424
* <ul><li>Reference-RMSD
2525
* <li>Reference-TMscore
26+
* <li>CEMC-Score TODO
2627
* </ul>
2728
*
2829
* @author Aleix Lafita
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package org.biojava.nbio.structure.align.multiple;
2+
3+
import java.util.List;
4+
5+
import org.biojava.nbio.core.sequence.ProteinSequence;
6+
import org.biojava.nbio.structure.Structure;
7+
import org.biojava.nbio.structure.align.util.AtomCache;
8+
import org.junit.Test;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Test the correctness of various Text outputs for {@link MultipleAlignment}s.
14+
* <p>
15+
* Currently tested:
16+
* <ul><li>FASTA
17+
* <li>FatCat format
18+
* <li>Aligned Pairs
19+
* </ul>
20+
*
21+
* @author Aleix Lafita
22+
*
23+
*/
24+
public class MultipleAlignmentWriterTest {
25+
26+
@Test
27+
public void testFASTA(){
28+
29+
}
30+
31+
@Test
32+
public void testFatCat(){
33+
34+
}
35+
36+
@Test
37+
public void testAlignedPairs(){
38+
39+
}
40+
41+
private List<String> generateTestMSA(){
42+
43+
//TODO load a file structure and generate a multiple alignment with multiple blocks
44+
45+
return null;
46+
}
47+
}

0 commit comments

Comments
 (0)