Search in sources :

Example 1 with CommandLineProgramTest

use of org.broadinstitute.hellbender.CommandLineProgramTest in project gatk by broadinstitute.

the class GenomicsDBTestUtils method createTempGenomicsDB.

/**
     * Create a temporary GenomicsDB containing a single interval of data from a set of gvcfs
     * this database will be deleted on jvm shutdown automatically
     * @param gvcfs, a List of a GVCFs to load from
     * @param interval the interval to load
     * @return the created workspace folder containing the new GenomicsDB
     */
public static File createTempGenomicsDB(final List<File> gvcfs, final Locatable interval) {
    final File workspaceDir = BaseTest.createTempDir("genomicsDBWorkspace");
    final CommandLineProgramTest importer = new CommandLineProgramTest() {

        @Override
        public String getTestedToolName() {
            return GenomicsDBImport.class.getSimpleName();
        }
    };
    final ArgumentsBuilder args = new ArgumentsBuilder();
    gvcfs.forEach(args::addVCF);
    final String workspace = new File(workspaceDir, "workspace").getAbsolutePath();
    args.addArgument(GenomicsDBImport.WORKSPACE_ARG_NAME, workspace);
    args.addArgument("L", IntervalUtils.locatableToString(interval));
    importer.runCommandLine(args);
    return new File(workspace);
}
Also used : File(java.io.File) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Aggregations

File (java.io.File)1 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)1