2009-09-09 23:36:12 +08:00
|
|
|
package org.broadinstitute.sting.gatk.walkers;
|
|
|
|
|
|
|
|
|
|
import org.broadinstitute.sting.WalkerTest;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
2010-04-02 00:27:23 +08:00
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.ArrayList;
|
2009-09-09 23:36:12 +08:00
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
2010-04-02 00:27:23 +08:00
|
|
|
/**
|
|
|
|
|
* IF THERE IS NO JAVADOC RIGHT HERE, YELL AT chartl
|
|
|
|
|
*
|
|
|
|
|
* @Author chartl
|
|
|
|
|
* @Date Feb 25, 2010
|
|
|
|
|
*/
|
2009-09-09 23:36:12 +08:00
|
|
|
public class DepthOfCoverageIntegrationTest extends WalkerTest {
|
|
|
|
|
|
2010-04-02 00:27:23 +08:00
|
|
|
private boolean RUN_TESTS = true;
|
|
|
|
|
private String root = "-T DepthOfCoverage ";
|
|
|
|
|
private String hg18 = "/seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta";
|
|
|
|
|
private String b36 = "/broad/1KG/reference/human_b36_both.fasta";
|
2009-09-09 23:36:12 +08:00
|
|
|
|
2010-04-02 00:27:23 +08:00
|
|
|
private String buildRootCmd(String ref, List<String> bams, List<String> intervals) {
|
|
|
|
|
StringBuilder bamBuilder = new StringBuilder();
|
|
|
|
|
do {
|
|
|
|
|
bamBuilder.append(" -I ");
|
|
|
|
|
bamBuilder.append(bams.remove(0));
|
|
|
|
|
} while ( bams.size() > 0 );
|
|
|
|
|
|
|
|
|
|
StringBuilder intervalBuilder = new StringBuilder();
|
|
|
|
|
do {
|
|
|
|
|
intervalBuilder.append(" -L ");
|
|
|
|
|
intervalBuilder.append(intervals.remove(0));
|
|
|
|
|
} while ( intervals.size() > 0 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return root + "-R "+ref+bamBuilder.toString()+intervalBuilder.toString();
|
|
|
|
|
}
|
2009-09-09 23:36:12 +08:00
|
|
|
|
2010-04-02 00:27:23 +08:00
|
|
|
private void execute(String name, WalkerTestSpec spec) {
|
|
|
|
|
if ( RUN_TESTS ) {
|
|
|
|
|
executeTest(name,spec);
|
2009-09-09 23:36:12 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
2010-04-02 00:27:23 +08:00
|
|
|
public void testBaseOutputNoFiltering() {
|
|
|
|
|
// our base file
|
|
|
|
|
File baseOutputFile = this.createTempFile("depthofcoveragenofiltering",".tmp");
|
|
|
|
|
this.setOutputFileLocation(baseOutputFile);
|
|
|
|
|
|
2010-05-18 01:23:00 +08:00
|
|
|
String[] intervals = {"/humgen/gsa-hpprojects/GATK/data/Validation_Data/fhs_jhs_30_targts.interval_list"};
|
|
|
|
|
String[] bams = {"/humgen/gsa-hpprojects/GATK/data/Validation_Data/FHS_indexed_subset.bam"};
|
2010-04-02 00:27:23 +08:00
|
|
|
|
2010-05-18 01:23:00 +08:00
|
|
|
String cmd = buildRootCmd(hg18,new ArrayList<String>(Arrays.asList(bams)),new ArrayList<String>(Arrays.asList(intervals))) + " -mmq 0 -mbq 0 -dels -baseCounts -both --outputFormat csv";
|
2010-04-02 00:27:23 +08:00
|
|
|
WalkerTestSpec spec = new WalkerTestSpec(cmd,0, new ArrayList<String>());
|
|
|
|
|
|
|
|
|
|
// now add the expected files that get generated
|
2010-05-18 01:23:00 +08:00
|
|
|
spec.addAuxFile("f53ddf25c2b71e46381f9c434402d88d", baseOutputFile);
|
|
|
|
|
spec.addAuxFile("925cc5b49286e0222bce6251d1baafc7", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".sample_interval_statistics"));
|
|
|
|
|
spec.addAuxFile("d9e812398d778f28ed12d7f3d18628e2", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".sample_interval_summary"));
|
|
|
|
|
spec.addAuxFile("80577bf378de570f84d91b0ef6004102", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".sample_locus_statistics"));
|
|
|
|
|
spec.addAuxFile("3a059ad82d945643dc4e03239c4041f5", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".sample_summary_statistics"));
|
|
|
|
|
spec.addAuxFile("f3315551081331bc322c53b11412d707", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".sample_statistics"));
|
|
|
|
|
spec.addAuxFile("7b9d0e93bf5b5313995be7010ef1f528", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".read_group_interval_statistics"));
|
|
|
|
|
spec.addAuxFile("fd29fe0c14351e934a6fef9df1f38f7b", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".read_group_interval_summary"));
|
|
|
|
|
spec.addAuxFile("111261f0e8ccf8c456d0b2a9482bc32c", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".read_group_locus_statistics"));
|
|
|
|
|
spec.addAuxFile("cc7ee5075a932dba486e78824ca34202", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".read_group_statistics"));
|
|
|
|
|
spec.addAuxFile("e1653480daa2d96f7c584ed4cd20c147", createTempFileFromBase(baseOutputFile.getAbsolutePath()+".read_group_summary"));
|
2010-04-02 00:27:23 +08:00
|
|
|
|
2010-05-18 01:23:00 +08:00
|
|
|
execute("testBaseOutputNoFiltering",spec);
|
2010-04-02 00:27:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public File createTempFileFromBase(String name) {
|
|
|
|
|
File fl = new File(name);
|
|
|
|
|
fl.deleteOnExit();
|
|
|
|
|
return fl;
|
2010-03-05 09:04:08 +08:00
|
|
|
}
|
2010-04-02 00:27:23 +08:00
|
|
|
}
|