From: Nomi H. <no...@us...> - 2006-01-30 23:03:33
|
Update of /cvsroot/gmod/apollo/src/java/apollo/main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1621/apollo/main Modified Files: CommandLine.java Log Message: Added input/output type "das[2]". Index: CommandLine.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/main/CommandLine.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** CommandLine.java 22 Nov 2005 14:34:56 -0000 1.32 --- CommandLine.java 30 Jan 2006 23:03:25 -0000 1.33 *************** *** 31,34 **** --- 31,35 ---- import apollo.dataadapter.gamexml.GAMEAdapter; import apollo.dataadapter.genbank.GenbankAdapter; + import apollo.dataadapter.das2.DAS2Adapter; import apollo.datamodel.GenomicRange; *************** *** 45,48 **** --- 46,50 ---- private final static String GFF = GFFAdapter.class.getName(); private final static String GENBANK = GenbankAdapter.class.getName(); + private final static String DAS2 = DAS2Adapter.class.getName(); //private DataAdapterRegistry adapterRegistry; *************** *** 239,243 **** - /** * Return the IOOptions which has a db dataadapter. For now only test if the dataAdapter is a ChadoAdapter --- 241,244 ---- *************** *** 251,256 **** //First, get sure that the IOOptions have their dataadapter. - // - // if (!getReadOptions().hasAdapter()) getReadOptions().setAdapter(inputFmtOption.getAdapter()); --- 252,255 ---- *************** *** 265,273 **** throw new Exception("Unable to find a database (ie chadoDB) for either input or output"); - } - - private ApolloDataAdapterI getAdapterForFile(IOOptions options) --- 264,269 ---- *************** *** 305,308 **** --- 301,306 ---- if (suffix.matches("backup|ser")) return getDataAdapter(SERIALIZED); + if (suffix.matches(".*das2.*")) + return getDataAdapter(DAS2); // configuration can specify what to do with .xml suffix (game or chado) else if (suffix.equals("xml") && xmlSuffixIsConfigged()) *************** *** 333,336 **** --- 331,337 ---- return getDataAdapter(GENBANK); } + else if (adapString.toLowerCase().startsWith("das")) { + return getDataAdapter(DAS2); + } else { error("Don't recognize input format "+adapString); *************** *** 382,386 **** private final static String help = ! "Specify input format. [chadoDB|game|chadoxml|genbank|gff|backup]"; private InputFormatCommandOption() { --- 383,387 ---- private final static String help = ! "Specify input format. [chadoDB|game|chadoxml|genbank|gff|das2|backup]"; private InputFormatCommandOption() { *************** *** 406,410 **** private final static String help = ! "Specify output format. [chadoDB|game|chadoxml|genbank|gff|backup]"; private OutputFormatCommandOption() { --- 407,411 ---- private final static String help = ! "Specify output format. [chadoDB|game|chadoxml|genbank|gff|das2|backup]"; private OutputFormatCommandOption() { *************** *** 975,979 **** private BatchInputFile(String batchFilename) throws FileNotFoundException, IOException { super(batchFilename); - } --- 976,979 ---- *************** *** 1033,1119 **** } } - } - } - - - - // delete... - // class ReadOptions extends IOOptions { - // //boolean forRead() { return true; } - // ApolloDataAdapterI getAdapter() throws Exception { - // if (adapter == null) { - // adapter = inputFmtOption.getAdapter(); - // } - // return adapter; - // } - // boolean haveSequenceFilename() { - // return getSequenceFilename() != null; - // } - // String getSequenceFilename() { - // return seqFileOption.getArg(); // if not "matched" will be null - // } - // } - // class WriteOptions extends IOOptions { - // //boolean forRead() { return false; } - // ApolloDataAdapterI getAdapter() throws Exception { - // //if (adapter == null && outputFmtOption.getMatched()) - // // adapter = outputFmtOption.getWriteAdapter(); - // return adapter; - - // } - // } - - // } - - - - // // throws exception if no format - // ApolloDataAdapterI readAdapter = getAdapter(); - // setReadAdapter(readAdapter); - // DataInput di = new DataInput(DataInputType.FILE,getFilename()); - // // gff input may have seq file. - // if (haveSequenceFilename()) - // di.setSequenceFilename(getSequenceFilename()); - // readAdapter.setDataInput(di); - // setReadSpecifiedState(true); - // } - - // private ApolloDataAdapterI getAdapter() throws Exception { - // ApolloDataAdapterI adapter; // class var/cache? - // // first see if input format explicitly specified - // if (haveReadAdapter()) { - // adapter = getReadAdapter(); - // } - // // if nothing specified try to get format from file suffix - // else { - // adapter = getDataAdapterFromSuffix(); - // if (adapter != null) - // System.out.println("No input format specified. Based on suffix "+getFileSuffix() - // +", using data adapter " + adapter.getClass()); - // } - - // if (adapter == null) { - // error("\nNo input format specified and can't determine it from suffix " - // +getFileSuffix()); - // } - // return adapter; - // } - - - // } // end of InputFileCommandOption inner class - - // private void setReadAdapter(ApolloDataAdapterI readAdapter) { - // this.readAdapter = readAdapter; - // } - - - - // private ApolloDataAdapterI getAdapter(boolean forRead) throws Exception { - // if (forRead) - // return getReadAdapter(); - // return getWriteAdapter(); - // } - --- 1033,1037 ---- |