/* import java.util.Set; import java.util.Arrays; import java.util.TreeSet; static Set start_codon_set = new TreeSet(); String p = params.toString().substring(1, 4) if (ORF_start_codons.trim().equals("")) { start_codon_set.add("atg"); start_codon_set.add("gtg"); start_codon_set.add("ttg"); start_codon_set.add("ctg"); start_codon_set.add("att"); ORF_start_codons = "" + start_codon_set.toArray()[0]; for (int i=1; i < start_codon_set.size(); i++) { ORF_start_codons += "," + start_codon_set.toArray()[i]; } } else { String[] codons = ORF_start_codons.split(","); if (!start_codon_set.addAll(Arrays.asList(codons))) { System.out.println("Adding Array to Set fails."); } } //if (InputFile.OpenOkay("/home/u11/rli/NetBeansProjects/OliGo3", parameters_file)) { ORF_start_codons.split(",").length*3==ORF_start_codons.replace(",","").length() for (String file : files) { System.out.println(file); } boolean b = m.matches(); System.out.println(b); String s, line = null; s = System.getProperty("line.separator"); System.out.println(s); s = System.setProperty("line.separator", ">"); s = System.getProperty("line.separator"); System.out.println(s); System.out.println(InputFile.br.readLine()); System.out.println(InputFile.br.readLine()); System.out.println(s); InputFile.br.close(); Params.input_genes_file = Params.workdir + File.separator + Params.input_genes_file; Params.output_genes_file = Params.workdir + File.separator + Params.output_genes_file; Params.out_overlaps_file = Params.workdir + File.separator + Params.out_overlaps_file; Params.ORF_stats_file = Params.workdir + File.separator + Params.ORF_stats_file; Params.ORF_tags_file = Params.workdir + File.separator + Params.ORF_tags_file; */ package oligo3; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * * @author rli */ public class Test { static boolean retVal = false; static Pattern p = Pattern.compile("^(\\s*\\w+)"); static Pattern p1 = Pattern.compile("[\\.\\s_-]([^\\.\\s_-]+)\\.\\w{2,5}$"); static Pattern p2 = Pattern.compile("[\\.\\s_-]([^\\.\\s_-]+)$"); static Pattern p3 = Pattern.compile("(.{4})$"); static Pattern h = Pattern.compile("^\\s*>\\s*\\S+.*"); static Matcher m; public static void TestInput() throws IOException { //InputFile infile = new InputFile(); //retVal = InputFile.OpenOkay("/home/u11/rli/dic.pl"); //System.out.println(retVal); if (InputFile.OpenOkay(System.getProperty("user.home"),"dic.pl")) { try { System.out.println(InputFile.br.readLine()); } catch (IOException e) { System.err.println("I/O error: " + e.getMessage()); } finally { if (InputFile.br != null) InputFile.br.close(); } } else { System.exit(1); } } /* // Check if ORF oligos exist across all genes and eliminate oligo-free ORFs public static void purgeOligoFreeORF() { int len = 0, k = 0, e = seq.size()-1; seq_count = orf_count = 0; String oligo = ""; for (i = e; i >= 0; i--) { System.out.println("Checking if ORF# " + i+1 + " has an oligo..."); len = seq.get(i).length()-Params.oligo_probe_length; for (j = 0; j <= len; j++) { oligo = seq.get(i).substring(j, j+Params.oligo_probe_length); for (k = e; k >= 0; k--) { if (k != i) { if (seq.get(k).contains(oligo)) break; } } if (k < 0) { System.out.println("ORF "+gid.get(i)+" has oligo."); orf_count++; break; } } if (j > len) { System.out.println("ORF "+gid.get(i)+" has no oligo."); BioSeq.deleteSeq(i); e--; seq_count++; } } OutputFile.stats.println("Number of genes w/o oligos available = "+seq_count); OutputFile.stats.println("Number of genes w/ oligos available = "+orf_count+"\n"); } public static void OutputQualityORF() { int len = 0, k = 0, e = seq.size()-1; orf_count = 0; for (i = 0; i <= e; i++) { OutputFile.genes.println(">"+gid.get(i)+" "+acn.get(i) +" "+gsb.get(i)+" "+loc.get(i)+" "+prd.get(i)); len = seq.get(i).length(); // Print sequence in lines of 60 bp for (j = 0; j < len; j += 60) { k = ((k=j+60)>len)?len:k; OutputFile.genes.println(seq.get(i).substring(j, k)); } orf_count++; } OutputFile.stats.println("Number of output unique genes = "+orf_count); System.out.println("\nNumber of output unique genes = "+orf_count+"\n"); } */ }