Additional partition types into DepthOfCoverage:

- Sequencing Center
- Platform
- Sample by Center
- Sample by Platform
- Sample by Platform by Center <---- needed for analysis I'm doing

The fact that the latter three needed their own partition types, rather than being dictatable from the command line, combined with the new hierarchical traversal types, and new output formatting engine, suggest that DepthOfCoverageV3 is about ready to be retired in favor of a newer, sleeker version.

For now, this will do.
 


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4193 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
chartl 2010-09-02 19:30:03 +00:00
parent 590bb50d16
commit 3a4844ebde
3 changed files with 31 additions and 1 deletions

View File

@ -45,6 +45,16 @@ public class CoverageUtils {
return String.format("%s_rg_%s",r.getSample(),r.getReadGroupId());
} else if ( type == DoCOutputType.Partition.library ) {
return r.getLibrary();
} else if ( type == DoCOutputType.Partition.center ) {
return r.getSequencingCenter();
} else if ( type == DoCOutputType.Partition.platform ) {
return r.getPlatform();
} else if ( type == DoCOutputType.Partition.sample_by_center ) {
return String.format("%s_cn_%s",r.getSample(),r.getSequencingCenter());
} else if ( type == DoCOutputType.Partition.sample_by_platform) {
return String.format("%s_pl_%s",r.getSample(),r.getPlatform());
} else if ( type == DoCOutputType.Partition.sample_by_platform_by_center ) {
return String.format("%s_pl_%s_cn_%s",r.getSample(),r.getPlatform(),r.getSequencingCenter());
} else {
throw new StingException("Invalid type ID sent to getTypeID. This is a BUG!");
}

View File

@ -205,6 +205,26 @@ public class DepthOfCoverageWalker extends LocusWalker<Map<DoCOutputType.Partiti
partition.add(l);
}
}
} else if ( type == DoCOutputType.Partition.center ) {
for ( SAMReadGroupRecord rg : getToolkit().getSAMFileHeader().getReadGroups() ) {
partition.add(rg.getSequencingCenter());
}
} else if ( type == DoCOutputType.Partition.platform ) {
for ( SAMReadGroupRecord rg : getToolkit().getSAMFileHeader().getReadGroups() ) {
partition.add(rg.getPlatform());
}
} else if ( type == DoCOutputType.Partition.sample_by_center ) {
for ( SAMReadGroupRecord rg : getToolkit().getSAMFileHeader().getReadGroups() ) {
partition.add(String.format("%s_cn_%s",rg.getSample(),rg.getSequencingCenter()));
}
} else if ( type == DoCOutputType.Partition.sample_by_platform ) {
for ( SAMReadGroupRecord rg : getToolkit().getSAMFileHeader().getReadGroups() ) {
partition.add(String.format("%s_pl_%s",rg.getSample(),rg.getPlatform()));
}
} else if ( type == DoCOutputType.Partition.sample_by_platform_by_center ) {
for ( SAMReadGroupRecord rg : getToolkit().getSAMFileHeader().getReadGroups() ) {
partition.add(String.format("%s_pl_%s_cn_%s",rg.getSample(),rg.getPlatform(),rg.getSequencingCenter()));
}
} else {
throw new StingException("Invalid aggregation type sent to getSamplesFromToolKit");
}

View File

@ -31,7 +31,7 @@ package org.broadinstitute.sting.gatk.walkers.coverage;
* @version 0.1
*/
public class DoCOutputType {
public enum Partition { readgroup, sample, library }
public enum Partition { readgroup, sample, library, platform, center, sample_by_platform, sample_by_center, sample_by_platform_by_center }
public enum Aggregation { locus, interval, gene, cumulative }
public enum FileType { summary, statistics, coverage_counts, coverage_proportions }