Merged bug fix from Stable into Unstable

This commit is contained in:
Khalid Shakir 2011-09-27 14:34:39 -04:00
commit 84bd355690
6 changed files with 93 additions and 3 deletions

View File

@ -46,7 +46,7 @@
<!-- Lucene core utilities -->
<dependency org="org.apache.lucene" name="lucene-core" rev="3.0.3"/>
<!-- Dependencies for LSF library -->
<!-- Dependencies for LSF, DRMAA, and other C libraries -->
<dependency org="net.java.dev.jna" name="jna" rev="3.2.7"/>
<!-- Dependencies for amazon.com S3 support -->
@ -75,6 +75,9 @@
<dependency org="org.apache.poi" name="poi" rev="3.8-beta3" />
<dependency org="org.apache.poi" name="poi-ooxml" rev="3.8-beta3" />
<!-- snpEff annotator for pipelines -->
<dependency org="net.sf.snpeff" name="snpeff" rev="2.0.2" />
<!-- Exclude dependencies on sun libraries where the downloads aren't available but included in the jvm. -->
<exclude org="javax.servlet" />
<exclude org="javax.jms" />

View File

@ -35,8 +35,10 @@ import org.reflections.scanners.SubTypesScanner;
import org.reflections.util.ConfigurationBuilder;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.*;
@ -57,8 +59,25 @@ public class PluginManager<PluginType> {
Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Reflections.class);
logger.setLevel(Level.OFF);
Set<URL> classPathUrls = new LinkedHashSet<URL>();
URL cwd;
try {
cwd = new File(".").getAbsoluteFile().toURI().toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
// NOTE: Reflections also scans directories for classes.
// Meanwhile some of the jar MANIFEST.MF Bundle-ClassPath properties contain "."
// Do NOT let reflections scan the CWD where it often picks up test classes when
// they weren't explicitly in the classpath, for example the UninstantiableWalker
for (URL url: JVMUtils.getClasspathURLs())
if (!url.equals(cwd))
classPathUrls.add(url);
defaultReflections = new Reflections( new ConfigurationBuilder()
.setUrls(JVMUtils.getClasspathURLs())
.setUrls(classPathUrls)
.setScanners(new SubTypesScanner()));
}

View File

@ -59,7 +59,12 @@
<dir name="com/sun/jna" />
<!-- Contracts for Java -->
<package name="class com.google.java.contract.**" />
<package name="com.google.java.contract.**" />
<!-- snpEff -->
<package name="ca.mcgill.mcb.pcingola.**" />
<file path="snpEff_genes.ftl" />
<file path="snpEff_summary.ftl" />
</dependencies>
<modules>
<module file="GATKEngine.xml"/>

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2011, 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.
*/
package org.broadinstitute.sting.queue.extensions.snpeff
import org.broadinstitute.sting.queue.function.JavaCommandLineFunction
import java.io.File
import org.broadinstitute.sting.commandline.{Argument, Output, Input}
/**
* Basic snpEff support.
* See: http://www.broadinstitute.org/gsa/wiki/index.php/Adding_Genomic_Annotations_Using_SnpEff_and_VariantAnnotator
*/
class SnpEff extends JavaCommandLineFunction {
javaMainClass = "ca.mcgill.mcb.pcingola.snpEffect.commandLine.SnpEff"
@Input(doc="snp vcf4 file")
var inVcf: File = _
@Input(doc="config file with path to data dir", required=false)
var config: File = _
@Argument(doc="genome version")
var genomeVersion: String = _
@Argument(doc="verbose", required=false)
var verbose = true
@Output(doc="snp eff output")
var outVcf: File = _
override def commandLine = Array(
super.commandLine,
" eff",
if (verbose) " -v" else "",
optional(" -c ", config),
" -i vcf -o vcf %s %s > %s".format(genomeVersion, inVcf, outVcf)
).mkString
}

View File

@ -0,0 +1,3 @@
<ivy-module version="1.0">
<info organisation="net.sf.snpeff" module="snpeff" revision="2.0.2" status="release" />
</ivy-module>