public static void main(String[] args) { try { ArrayList<String> sequences = new ArrayList<String>(); ArrayList<String> sequenceNames = new ArrayList<String>(); RNAFoldingTools.loadFastaSequences( new File( "/home/michael/Dropbox/RNA and StatAlign/Distance/Datasets2/TestRNAData1_5seqs.dat.fas"), sequences, sequenceNames); RNAalifoldResult res = RNAalifold.fold(sequences, sequenceNames, "-T 10"); System.out.println(RNAFoldingTools.getDotBracketStringFromPairedSites(res.pairedSites)); res = RNAalifold.fold(sequences, sequenceNames, "-T 60"); System.out.println(RNAFoldingTools.getDotBracketStringFromPairedSites(res.pairedSites)); // RNAalifold.saveClustalW(sequences, sequenceNames, new // File("/home/michael/Desktop/temp.clustalw")); } catch (Exception ex) { } }
public static boolean checkRNAalifold() { try { ArrayList<String> sequences = new ArrayList<String>(); ArrayList<String> sequenceNames = new ArrayList<String>(); sequences.add( "GGGUGCUUGAAGCUGUCUGCUUUAAGUGCUUGCA----UCAGGCUGAGAGUAGGCAGAGAAAAGCCCCGUAUCA-----A----------------UGUUAAUCAAUACGAGGC-CCUCUGUAAUG"); sequences.add( "GGGUGCUUGAGGCUGUCUGCCUCGGG------CAUGCC---ACCGUAAGGCAGACAGAGAAAAGCCCCAGUUAACAUUACGCGUCCUGCAAGACGCCUAACAUUAAUCUGAGGC-CAAUUU-CAUG"); sequenceNames.add("a"); sequenceNames.add("b"); useOldParams = false; String newparams = " -T " + 37 + " --cfactor " + 1 + " --nfactor " + 1 + " "; RNAalifoldResult res = null; try { res = RNAalifold.fold(sequences, sequenceNames, newparams); } catch (Exception ex) { System.err.println("The following error occured with RNAalifold: " + ex.getMessage()); } // System.out.println("HERE " + res); if (res != null) { return true; } else { String oldparams = " -T " + 37 + " -cv " + 1 + " -nc " + 1 + " "; useOldParams = true; res = RNAalifold.fold(sequences, sequenceNames, oldparams); return res != null; } } catch (Exception ex) { System.err.println("The following error occured with RNAalifold: " + ex.getMessage()); } useOldParams = false; return false; }