Added argument to avoid writing 0 over all uncovered contigs, so you can just plot chrX, for example
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5609 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
de4eaa455e
commit
13c5f3322d
|
|
@ -47,6 +47,9 @@ public class CoarseCoverageWalker extends ReadWalker<Integer,Integer> {
|
||||||
@Argument(fullName="granularity", shortName="G", doc="Granularity", required=true)
|
@Argument(fullName="granularity", shortName="G", doc="Granularity", required=true)
|
||||||
public Integer N;
|
public Integer N;
|
||||||
|
|
||||||
|
@Argument(fullName="dontZeroMissingContigs", shortName="Z", doc="If provided, we won't emit 0 counts for all sites on contigs skipped", required=true)
|
||||||
|
public boolean dontZeroMissingContigs;
|
||||||
|
|
||||||
private int chunkStart = 1; // start of the current chunk we are counting reads for
|
private int chunkStart = 1; // start of the current chunk we are counting reads for
|
||||||
private int contig = 0; // current contig we are on
|
private int contig = 0; // current contig we are on
|
||||||
private int count = 0; // number of reads overlapping with the current chunk
|
private int count = 0; // number of reads overlapping with the current chunk
|
||||||
|
|
@ -74,9 +77,11 @@ public class CoarseCoverageWalker extends ReadWalker<Integer,Integer> {
|
||||||
|
|
||||||
// if we skipped one or more contigs completely, make sure we print 0 counts over all of them:
|
// if we skipped one or more contigs completely, make sure we print 0 counts over all of them:
|
||||||
for ( contig++ ; contig < read.getReferenceIndex() ; contig++) {
|
for ( contig++ ; contig < read.getReferenceIndex() ; contig++) {
|
||||||
|
if ( ! dontZeroMissingContigs ) {
|
||||||
int contigSize = read.getHeader().getSequence(contig).getSequenceLength();
|
int contigSize = read.getHeader().getSequence(contig).getSequenceLength();
|
||||||
for ( int k = 1 ; k < contigSize ; k+=N ) out.println(zeroString);
|
for ( int k = 1 ; k < contigSize ; k+=N ) out.println(zeroString);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// by now we scrolled to the right contig
|
// by now we scrolled to the right contig
|
||||||
|
|
||||||
chunkStart = 1; // reset chunk start
|
chunkStart = 1; // reset chunk start
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue