checked in a sample xml file used to store the defaults for the SomaticCoverage tool, and added it to the SomaticCoverage.jar in build.sml. Also added a inputStream marshalling method to the GATKArgumentCollection.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@979 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
aaron 2009-06-10 20:46:16 +00:00
parent 8d25f1a105
commit 94b0e46d12
4 changed files with 108 additions and 53 deletions

View File

@ -103,9 +103,12 @@
<jar jarfile="dist/SomaticCoverage.jar" whenmanifestonly="skip"> <jar jarfile="dist/SomaticCoverage.jar" whenmanifestonly="skip">
<fileset dir="build"> <fileset dir="build">
<include name="**/*.class"/> <include name="**/somaticcoverage/*.class"/>
<exclude name="**/utils/**"/> <include name="**/walkers/SomaticCoverageWalker.class"/>
<exclude name="**/gatk/**"/>
</fileset>
<fileset dir="java">
<include name="**/somaticcoverage/*.xml"/>
</fileset> </fileset>
<manifest> <manifest>
<attribute name="Main-Class" value="org.broadinstitute.sting.playground.somaticcoverage.SomaticCoverageTool" /> <attribute name="Main-Class" value="org.broadinstitute.sting.playground.somaticcoverage.SomaticCoverageTool" />

View File

@ -8,6 +8,7 @@ import org.simpleframework.xml.stream.Format;
import org.simpleframework.xml.stream.HyphenStyle; import org.simpleframework.xml.stream.HyphenStyle;
import java.io.File; import java.io.File;
import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -33,11 +34,6 @@ import java.util.Map;
/** /**
* @author aaron * @author aaron
* @version 1.0 * @version 1.0
* @date May 7, 2009
* <p/>
* Class ArgumentObject
* <p/>
* Encapsolute the massively large list of possible parameters we take in the Genome Analysis tool
*/ */
@Root @Root
public class GATKArgumentCollection { public class GATKArgumentCollection {
@ -181,10 +177,28 @@ public class GATKArgumentCollection {
} }
} }
/**
* unmashall the object from a configuration file
*
* @param file the inputstream to marshal from
*/
public static GATKArgumentCollection unmarshal( InputStream file ) {
Serializer serializer = new Persister(new Format(new HyphenStyle()));
try {
GATKArgumentCollection example = serializer.read(GATKArgumentCollection.class, file);
return example;
} catch (Exception e) {
throw new StingException("Failed to marshal the data to file " + file.toString(), e);
}
}
/** /**
* test equality between two arg collections. This function defines the statement: * test equality between two arg collections. This function defines the statement:
* "not fun to write" * "not fun to write"
*
* @param other the other collection * @param other the other collection
*
* @return true if they're equal * @return true if they're equal
*/ */
public boolean equals( GATKArgumentCollection other ) { public boolean equals( GATKArgumentCollection other ) {

View File

@ -0,0 +1,34 @@
<!--
~ Copyright (c) 2009 The Broad Institute
~
~ Permission is hereby granted, free of charge, to any person
~ obtaining a copy of this software and associated documentation
~ files (the "Software"), to deal in the Software without
~ restriction, including without limitation the rights to use,
~ copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the
~ Software is furnished to do so, subject to the following
~ conditions:
~
~ The above copyright notice and this permission notice shall be
~ included in all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
~ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
~ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
~ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
~ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
~ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
~ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
~ OTHER DEALINGS IN THE SOFTWARE.
-->
<GATK-argument-collection>
<strictness-level>strict</strictness-level>
<intervals>/seq/references/HybSelOligos/whole_exome_refseq_coding/whole_exome_refseq_coding.targets.interval_list</intervals>
<reference-file>/seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta</reference-file>
<enabled-threaded-IO>true</enabled-threaded-IO>
<unsafe>false</unsafe>
<disable-threading>false</disable-threading>
<number-of-threads>1</number-of-threads>
</GATK-argument-collection>

View File

@ -5,6 +5,7 @@ import org.broadinstitute.sting.gatk.GATKArgumentCollection;
import org.broadinstitute.sting.utils.cmdLine.Argument; import org.broadinstitute.sting.utils.cmdLine.Argument;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
@ -69,8 +70,11 @@ public class SomaticCoverageTool extends CommandLineExecutable {
/** override any arguments we see fit. */ /** override any arguments we see fit. */
protected void overrideArguments() { protected void overrideArguments() {
this.argCollection = GATKArgumentCollection.unmarshal("SomaticCoverage.xml"); try {
this.argCollection.intervals = "CancerIntervals.list"; this.argCollection = GATKArgumentCollection.unmarshal(this.getClass().getResource("/src/org/broadinstitute/sting/playground/somaticcoverage/SomaticCoverage.xml").openStream());
} catch (IOException e) {
throw new RuntimeException(e);
}
this.argCollection.samFiles = samFiles; this.argCollection.samFiles = samFiles;
} }
} }