X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src2%2Ffr%2Forsay%2Flri%2Fvarna%2Fmodels%2Ftemplates%2FBatchBenchmarkPrepare.java;fp=src2%2Ffr%2Forsay%2Flri%2Fvarna%2Fmodels%2Ftemplates%2FBatchBenchmarkPrepare.java;h=0000000000000000000000000000000000000000;hb=a1225b9392dc7657d5cef12907385b07527d6122;hp=c3ab8ac55c27bffbea718f63665a54eefed7282d;hpb=b513684c725997c77341f30ce4e584cf9f7cdfed;p=jalview.git diff --git a/src2/fr/orsay/lri/varna/models/templates/BatchBenchmarkPrepare.java b/src2/fr/orsay/lri/varna/models/templates/BatchBenchmarkPrepare.java deleted file mode 100644 index c3ab8ac..0000000 --- a/src2/fr/orsay/lri/varna/models/templates/BatchBenchmarkPrepare.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * File written by Raphael Champeimont - * UMR 7238 Genomique des Microorganismes - */ -package fr.orsay.lri.varna.models.templates; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.util.ArrayList; -import java.util.List; - -import fr.orsay.lri.varna.factories.RNAFactory; - -public class BatchBenchmarkPrepare { - - /** - * We assume given directory contains a alignemnt.fasta file, - * of which the first sequence is the consensus structure, - * and the other sequences are aligned nucleotides. - * The principle is to convert it to a set of secondary structure, - * using the following rule: - * - keep the same nucleotides as in original sequence - * - keep base pairs where both bases of the pair are non-gaps in our sequence - */ - public void benchmarkAllDir(File rootdir) throws Exception { - File seqdir = new File(rootdir, "sequences"); - if (!seqdir.exists()) { - seqdir.mkdir(); - } - - File templateFile = new File(rootdir, "template.xml"); - - ArrayList seqnames = new ArrayList(); - ArrayList sequences = new ArrayList(); - BatchBenchmark.readFASTA(new File(rootdir, "alignment.fasta"), seqnames, sequences); - - BufferedWriter outbufASS = new BufferedWriter(new FileWriter(new File(rootdir, "all_secondary_structures.fasta"))); - - String consensusSecStr = sequences.get(0); - int[] consensusSecStrInt = RNAFactory.parseSecStr(consensusSecStr); - - List templates = new ArrayList(); - for (int i=1; i" + seqname + "\n"); - outbuf.write(nt + "\n"); - outbuf.write(ss + "\n"); - outbuf.close(); - - outbufASS.write(">" + seqname + "\n"); - outbufASS.write(ss + "\n"); - - templates.add(templateFile); - } - - outbufASS.close(); - - } - - public static void main(String[] args) throws Exception { - new BatchBenchmarkPrepare().benchmarkAllDir(new File(new File("templates"), "RNaseP_bact_a")); - } - -}