a rename for consistancy of Sam to SAM, creating a genotype utils dir, and moving the GLF code into it.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@984 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
599ceeddd8
commit
195b4ea7b4
|
|
@ -0,0 +1,39 @@
|
|||
package org.broadinstitute.sting.utils.genotype;
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author aaron
|
||||
*
|
||||
* Class Genotype
|
||||
*
|
||||
* The interface for making genotype calls.
|
||||
*/
|
||||
public interface Genotype {
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.utils.glf;
|
||||
package org.broadinstitute.sting.utils.genotype.glf;
|
||||
|
||||
import net.sf.samtools.util.BinaryCodec;
|
||||
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package org.broadinstitute.sting.utils.glf;
|
||||
package org.broadinstitute.sting.utils.genotype.glf;
|
||||
|
||||
import net.sf.samtools.util.BinaryCodec;
|
||||
import net.sf.samtools.util.BlockCompressedOutputStream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.io.File;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.utils.glf;
|
||||
package org.broadinstitute.sting.utils.genotype.glf;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.utils.glf;
|
||||
package org.broadinstitute.sting.utils.genotype.glf;
|
||||
|
||||
import net.sf.samtools.util.BinaryCodec;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.utils.glf;
|
||||
package org.broadinstitute.sting.utils.genotype.glf;
|
||||
|
||||
import net.sf.samtools.util.BinaryCodec;
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ public class ArtificialPatternedSAMIterator extends ArtificialSAMIterator {
|
|||
return false;
|
||||
} else {
|
||||
++totalReadCount;
|
||||
this.next = ArtificialSamUtils.createArtificialRead(this.header, String.valueOf(totalReadCount), -1, -1, 50);
|
||||
this.next = ArtificialSAMUtils.createArtificialRead(this.header, String.valueOf(totalReadCount), -1, -1, 50);
|
||||
--uMappedReadCount;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -135,9 +135,9 @@ public class ArtificialPatternedSAMIterator extends ArtificialSAMIterator {
|
|||
*/
|
||||
private SAMRecord getNextRecord( int read ) {
|
||||
if (read > this.readCount) {
|
||||
return ArtificialSamUtils.createArtificialRead(this.header, String.valueOf(reads[readCount - 1]), currentChromo, reads[readCount - 1], 50);
|
||||
return ArtificialSAMUtils.createArtificialRead(this.header, String.valueOf(reads[readCount - 1]), currentChromo, reads[readCount - 1], 50);
|
||||
}
|
||||
return ArtificialSamUtils.createArtificialRead(this.header, String.valueOf(reads[read]), currentChromo, reads[read], 50);
|
||||
return ArtificialSAMUtils.createArtificialRead(this.header, String.valueOf(reads[read]), currentChromo, reads[read], 50);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,8 @@ import org.broadinstitute.sting.gatk.walkers.ReadWalker;
|
|||
import org.broadinstitute.sting.gatk.dataSources.shards.Shard;
|
||||
import org.broadinstitute.sting.gatk.dataSources.providers.ShardDataProvider;
|
||||
import org.broadinstitute.sting.gatk.LocusContext;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.sf.samtools.SAMRecord;
|
||||
import net.sf.samtools.SAMFileHeader;
|
||||
|
||||
|
|
@ -52,7 +49,7 @@ public class ArtificialReadsTraversal extends TraversalEngine {
|
|||
public int endingChr = 5;
|
||||
public int readsPerChr = 100;
|
||||
public int unMappedReads = 1000;
|
||||
private int DEFAULT_READ_LENGTH = ArtificialSamUtils.DEFAULT_READ_LENGTH;
|
||||
private int DEFAULT_READ_LENGTH = ArtificialSAMUtils.DEFAULT_READ_LENGTH;
|
||||
private ArtificialPatternedSAMIterator iter;
|
||||
/** our log, which we want to capture anything from this class */
|
||||
protected static Logger logger = Logger.getLogger(ArtificialReadsTraversal.class);
|
||||
|
|
@ -96,7 +93,7 @@ public class ArtificialReadsTraversal extends TraversalEngine {
|
|||
throw new IllegalArgumentException("Walker isn't a read walker!");
|
||||
|
||||
ReadWalker<M, T> readWalker = (ReadWalker<M, T>) walker;
|
||||
SAMFileHeader header = ArtificialSamUtils.createArtificialSamHeader(( endingChr - startingChr ) + 1, startingChr, readsPerChr + DEFAULT_READ_LENGTH);
|
||||
SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(( endingChr - startingChr ) + 1, startingChr, readsPerChr + DEFAULT_READ_LENGTH);
|
||||
iter = new ArtificialPatternedSAMIterator(this.startingChr,
|
||||
this.endingChr,
|
||||
this.readsPerChr,
|
||||
|
|
|
|||
|
|
@ -121,13 +121,13 @@ public class ArtificialSAMIterator implements PeekingStingIterator {
|
|||
return false;
|
||||
} else {
|
||||
++totalReadCount;
|
||||
this.next = ArtificialSamUtils.createArtificialRead(this.header, String.valueOf(totalReadCount), -1, -1, 50);
|
||||
this.next = ArtificialSAMUtils.createArtificialRead(this.header, String.valueOf(totalReadCount), -1, -1, 50);
|
||||
--uMappedReadCount;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
++totalReadCount;
|
||||
this.next = ArtificialSamUtils.createArtificialRead(this.header, String.valueOf(totalReadCount), currentChromo, currentRead, 50);
|
||||
this.next = ArtificialSAMUtils.createArtificialRead(this.header, String.valueOf(totalReadCount), currentChromo, currentRead, 50);
|
||||
++currentRead;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.broadinstitute.sting.gatk.Reads;
|
|||
* @author aaron
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ArtificialSamUtils {
|
||||
public class ArtificialSAMUtils {
|
||||
public static final int DEFAULT_READ_LENGTH = 50;
|
||||
|
||||
/**
|
||||
|
|
@ -7,7 +7,7 @@ import static org.junit.Assert.assertTrue;
|
|||
import org.broadinstitute.sting.utils.GenomeLocSortedSet;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.StingException;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSamUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import net.sf.samtools.SAMFileHeader;
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ import net.sf.samtools.SAMFileHeader;
|
|||
public class IntervalShardStrategyTest extends BaseTest {
|
||||
|
||||
private GenomeLocSortedSet mSortedSet = null;
|
||||
private SAMFileHeader header = ArtificialSamUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private static final int NUMBER_OF_CHROMOSOMES = 5;
|
||||
private static final int STARTING_CHROMOSOME = 1;
|
||||
private static final int CHROMOSOME_SIZE = 1000;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package org.broadinstitute.sting.gatk.dataSources.shards;
|
|||
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSamUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
|
@ -44,7 +44,7 @@ import net.sf.samtools.SAMFileHeader;
|
|||
public class IntervalShardTest extends BaseTest {
|
||||
|
||||
private IntervalShard intervalShard = null;
|
||||
private SAMFileHeader header = ArtificialSamUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private static final int NUMBER_OF_CHROMOSOMES = 5;
|
||||
private static final int STARTING_CHROMOSOME = 1;
|
||||
private static final int CHROMOSOME_SIZE = 1000;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@ package org.broadinstitute.sting.gatk.dataSources.shards;
|
|||
|
||||
import org.broadinstitute.sting.utils.GenomeLocSortedSet;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSamUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import net.sf.samtools.SAMFileHeader;
|
||||
import net.sf.samtools.SAMSequenceDictionary;
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -46,7 +45,7 @@ import net.sf.samtools.SAMSequenceDictionary;
|
|||
public class LinearLocusShardStrategyTest extends BaseTest {
|
||||
|
||||
private GenomeLocSortedSet mSortedSet = null;
|
||||
private SAMFileHeader header = ArtificialSamUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private static final int NUMBER_OF_CHROMOSOMES = 5;
|
||||
private static final int STARTING_CHROMOSOME = 1;
|
||||
private static final int CHROMOSOME_SIZE = 1000;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import net.sf.samtools.SAMFileHeader;
|
|||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.GenomeLocSortedSet;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSamUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ShardStrategyFactoryTest extends BaseTest {
|
||||
|
||||
private SAMFileHeader header = ArtificialSamUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private static final int NUMBER_OF_CHROMOSOMES = 5;
|
||||
private static final int STARTING_CHROMOSOME = 1;
|
||||
private static final int CHROMOSOME_SIZE = 1000;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package org.broadinstitute.sting.gatk.dataSources.simpleDataSources;
|
||||
|
||||
import static junit.framework.Assert.fail;
|
||||
import net.sf.samtools.SAMRecord;
|
||||
import net.sf.samtools.SAMFileReader;
|
||||
import net.sf.samtools.SAMFileHeader;
|
||||
import net.sf.samtools.util.CloseableIterator;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.broadinstitute.sting.gatk.dataSources.shards.ShardStrategy;
|
||||
import org.broadinstitute.sting.gatk.dataSources.shards.ShardStrategyFactory;
|
||||
|
|
@ -12,7 +10,7 @@ import org.broadinstitute.sting.gatk.iterators.BoundedReadIterator;
|
|||
import org.broadinstitute.sting.gatk.iterators.*;
|
||||
import org.broadinstitute.sting.gatk.Reads;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSamUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMQueryIterator;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
|
@ -85,7 +83,7 @@ public class SAMByReadsTest extends BaseTest {
|
|||
SAMDataSource data = new SAMDataSource(reads,true);
|
||||
for (int x = 0; x < 10; x++) {
|
||||
++iterations;
|
||||
PeekingStingIterator iter = ArtificialSamUtils.unmappedReadIterator(1, 100, 10, 1000);
|
||||
PeekingStingIterator iter = ArtificialSAMUtils.unmappedReadIterator(1, 100, 10, 1000);
|
||||
BoundedReadIterator ret = data.toUnmappedReads(100, iter);
|
||||
// count the reads we've gotten back
|
||||
if (ret == null) {
|
||||
|
|
@ -223,13 +221,13 @@ class ArtificialResourcePool extends SAMIteratorPool {
|
|||
|
||||
public ArtificialResourcePool( int startingChr, int endingChr, int readCount, int readSize) {
|
||||
super( new Reads(Collections.<File>emptyList()),true );
|
||||
header = ArtificialSamUtils.createArtificialSamHeader(( endingChr - startingChr ) + 1, startingChr, readCount + readSize);
|
||||
header = ArtificialSAMUtils.createArtificialSamHeader(( endingChr - startingChr ) + 1, startingChr, readCount + readSize);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StingSAMIterator iterator( GenomeLoc loc ) {
|
||||
ArtificialSAMQueryIterator iter = ArtificialSamUtils.queryReadIterator(1, 10, 100, 1000);
|
||||
ArtificialSAMQueryIterator iter = ArtificialSAMUtils.queryReadIterator(1, 10, 100, 1000);
|
||||
if (loc != null) {
|
||||
iter.queryContained(loc.getContig(), (int)loc.getStart(), (int)loc.getStop());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
package org.broadinstitute.sting.gatk.walkers;
|
||||
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.broadinstitute.sting.gatk.executive.Accumulator;
|
||||
import org.broadinstitute.sting.gatk.dataSources.shards.Shard;
|
||||
import org.broadinstitute.sting.gatk.dataSources.providers.ShardDataProvider;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialReadsTraversal;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMFileWriter;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSamUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
|
@ -85,8 +84,8 @@ public class PrintReadsWalkerTest extends BaseTest {
|
|||
@Test
|
||||
public void testReturnRead() {
|
||||
PrintReadsWalker walker = new PrintReadsWalker();
|
||||
SAMFileHeader head = ArtificialSamUtils.createArtificialSamHeader(3,1,1000);
|
||||
SAMRecord rec = ArtificialSamUtils.createArtificialRead(head, "FakeRead", 1, 1, 50);
|
||||
SAMFileHeader head = ArtificialSAMUtils.createArtificialSamHeader(3,1,1000);
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(head, "FakeRead", 1, 1, 50);
|
||||
SAMRecord ret = walker.map(bases, rec);
|
||||
assertTrue(ret == rec);
|
||||
assertTrue(ret.getReadName().equals(rec.getReadName()));
|
||||
|
|
@ -96,8 +95,8 @@ public class PrintReadsWalkerTest extends BaseTest {
|
|||
@Test
|
||||
public void testReducingRead() {
|
||||
PrintReadsWalker walker = new PrintReadsWalker();
|
||||
SAMFileHeader head = ArtificialSamUtils.createArtificialSamHeader(3,1,1000);
|
||||
SAMRecord rec = ArtificialSamUtils.createArtificialRead(head, "FakeRead", 1, 1, 50);
|
||||
SAMFileHeader head = ArtificialSAMUtils.createArtificialSamHeader(3,1,1000);
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(head, "FakeRead", 1, 1, 50);
|
||||
ArtificialSAMFileWriter writer = new ArtificialSAMFileWriter();
|
||||
SAMRecord ret = walker.map(bases, null);
|
||||
walker.reduce(ret,writer);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package org.broadinstitute.sting.utils;
|
|||
|
||||
import net.sf.samtools.SAMFileHeader;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSamUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
@ -37,7 +37,7 @@ import java.util.Iterator;
|
|||
public class GenomeLocSortedSetTest extends BaseTest {
|
||||
|
||||
private GenomeLocSortedSet mSortedSet = null;
|
||||
private SAMFileHeader header = ArtificialSamUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(NUMBER_OF_CHROMOSOMES, STARTING_CHROMOSOME, CHROMOSOME_SIZE);
|
||||
private static final int NUMBER_OF_CHROMOSOMES = 5;
|
||||
private static final int STARTING_CHROMOSOME = 1;
|
||||
private static final int CHROMOSOME_SIZE = 1000;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
package org.broadinstitute.sting.utils.glf;
|
||||
package org.broadinstitute.sting.utils.genotype.glf;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import net.sf.samtools.util.BinaryCodec;
|
||||
import net.sf.samtools.util.BlockCompressedOutputStream;
|
||||
import org.broadinstitute.sting.utils.genotype.glf.GLFWriter;
|
||||
import org.broadinstitute.sting.utils.genotype.glf.LikelihoodObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.utils.glf;
|
||||
package org.broadinstitute.sting.utils.genotype.glf;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
@ -51,12 +51,12 @@ public class ArtificialPatternedSAMIteratorTest extends BaseTest {
|
|||
private int startingChr = 1;
|
||||
private int endingChr = 2;
|
||||
private int readCount = 100;
|
||||
private int DEFAULT_READ_LENGTH = ArtificialSamUtils.DEFAULT_READ_LENGTH;
|
||||
private int DEFAULT_READ_LENGTH = ArtificialSAMUtils.DEFAULT_READ_LENGTH;
|
||||
SAMFileHeader header;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
header = ArtificialSamUtils.createArtificialSamHeader(( endingChr - startingChr ) + 1, startingChr, readCount + DEFAULT_READ_LENGTH);
|
||||
header = ArtificialSAMUtils.createArtificialSamHeader(( endingChr - startingChr ) + 1, startingChr, readCount + DEFAULT_READ_LENGTH);
|
||||
|
||||
}
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ public class ArtificialSAMFileWriterTest extends BaseTest {
|
|||
@Before
|
||||
public void before() {
|
||||
writer = new ArtificialSAMFileWriter();
|
||||
header = ArtificialSamUtils.createArtificialSamHeader(numChr, startChr, chrSize);
|
||||
header = ArtificialSAMUtils.createArtificialSamHeader(numChr, startChr, chrSize);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicCount() {
|
||||
for (int x = 0; x < 100; x++) {
|
||||
SAMRecord rec = ArtificialSamUtils.createArtificialRead(header, String.valueOf(x), 1, x, ArtificialSamUtils.DEFAULT_READ_LENGTH);
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(header, String.valueOf(x), 1, x, ArtificialSAMUtils.DEFAULT_READ_LENGTH);
|
||||
writer.addAlignment(rec);
|
||||
}
|
||||
assertEquals(100, writer.getRecords().size());
|
||||
|
|
@ -75,7 +75,7 @@ public class ArtificialSAMFileWriterTest extends BaseTest {
|
|||
|
||||
for (int x = 0; x < 100; x++) {
|
||||
names.add(String.valueOf(x));
|
||||
SAMRecord rec = ArtificialSamUtils.createArtificialRead(header, String.valueOf(x), 1, x, ArtificialSamUtils.DEFAULT_READ_LENGTH);
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(header, String.valueOf(x), 1, x, ArtificialSAMUtils.DEFAULT_READ_LENGTH);
|
||||
writer.addAlignment(rec);
|
||||
}
|
||||
assertEquals(100, writer.getRecords().size());
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.broadinstitute.sting.utils.sam;
|
||||
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.broadinstitute.sting.gatk.iterators.PeekingStingIterator;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import net.sf.samtools.SAMRecord;
|
||||
|
|
@ -44,7 +43,7 @@ public class ArtificialSAMQueryIteratorTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void testWholeChromosomeQuery() {
|
||||
ArtificialSAMQueryIterator iter = ArtificialSamUtils.queryReadIterator(1, 2, 100);
|
||||
ArtificialSAMQueryIterator iter = ArtificialSAMUtils.queryReadIterator(1, 2, 100);
|
||||
iter.queryContained("chr1", 1, -1);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
|
|
@ -57,7 +56,7 @@ public class ArtificialSAMQueryIteratorTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void testContainedQueryStart() {
|
||||
ArtificialSAMQueryIterator iter = ArtificialSamUtils.queryReadIterator(1, 2, 100);
|
||||
ArtificialSAMQueryIterator iter = ArtificialSAMUtils.queryReadIterator(1, 2, 100);
|
||||
iter.queryContained("chr1", 1, 50);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
|
|
@ -70,7 +69,7 @@ public class ArtificialSAMQueryIteratorTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void testOverlappingQueryStart() {
|
||||
ArtificialSAMQueryIterator iter = ArtificialSamUtils.queryReadIterator(1, 2, 100);
|
||||
ArtificialSAMQueryIterator iter = ArtificialSAMUtils.queryReadIterator(1, 2, 100);
|
||||
iter.queryOverlapping("chr1", 1, 50);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
|
|
@ -83,7 +82,7 @@ public class ArtificialSAMQueryIteratorTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void testContainedQueryMiddle() {
|
||||
ArtificialSAMQueryIterator iter = ArtificialSamUtils.queryReadIterator(1, 2, 100);
|
||||
ArtificialSAMQueryIterator iter = ArtificialSAMUtils.queryReadIterator(1, 2, 100);
|
||||
iter.queryContained("chr1", 25, 74);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
|
|
@ -96,7 +95,7 @@ public class ArtificialSAMQueryIteratorTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void testOverlappingQueryMiddle() {
|
||||
ArtificialSAMQueryIterator iter = ArtificialSamUtils.queryReadIterator(1, 2, 100);
|
||||
ArtificialSAMQueryIterator iter = ArtificialSAMUtils.queryReadIterator(1, 2, 100);
|
||||
iter.queryOverlapping("chr1", 25, 74);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
|
|
@ -109,7 +108,7 @@ public class ArtificialSAMQueryIteratorTest extends BaseTest {
|
|||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testUnknownChromosome() {
|
||||
ArtificialSAMQueryIterator iter = ArtificialSamUtils.queryReadIterator(1, 2, 100);
|
||||
ArtificialSAMQueryIterator iter = ArtificialSAMUtils.queryReadIterator(1, 2, 100);
|
||||
iter.queryOverlapping("chr621", 25, 74);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ import net.sf.samtools.SAMRecord;
|
|||
* Time: 3:09:34 AM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class ArtificialSamUtilsTest extends BaseTest {
|
||||
public class ArtificialSAMUtilsTest extends BaseTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void basicReadIteratorTest() {
|
||||
StingSAMIterator iter = ArtificialSamUtils.unmappedReadIterator(1, 100, 100);
|
||||
StingSAMIterator iter = ArtificialSAMUtils.unmappedReadIterator(1, 100, 100);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
SAMRecord rec = iter.next();
|
||||
|
|
@ -32,7 +32,7 @@ public class ArtificialSamUtilsTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void tenPerChromosome() {
|
||||
StingSAMIterator iter = ArtificialSamUtils.unmappedReadIterator(1, 100, 10);
|
||||
StingSAMIterator iter = ArtificialSAMUtils.unmappedReadIterator(1, 100, 10);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
SAMRecord rec = iter.next();
|
||||
|
|
@ -45,7 +45,7 @@ public class ArtificialSamUtilsTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void onePerChromosome() {
|
||||
StingSAMIterator iter = ArtificialSamUtils.unmappedReadIterator(1, 100, 1);
|
||||
StingSAMIterator iter = ArtificialSAMUtils.unmappedReadIterator(1, 100, 1);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
SAMRecord rec = iter.next();
|
||||
|
|
@ -58,7 +58,7 @@ public class ArtificialSamUtilsTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void basicUnmappedIteratorTest() {
|
||||
StingSAMIterator iter = ArtificialSamUtils.unmappedReadIterator(1, 100, 100, 1000);
|
||||
StingSAMIterator iter = ArtificialSAMUtils.unmappedReadIterator(1, 100, 100, 1000);
|
||||
int count = 0;
|
||||
for (int x = 0; x < (100* 100); x++ ) {
|
||||
if (!iter.hasNext()) {
|
||||
|
|
@ -82,7 +82,7 @@ public class ArtificialSamUtilsTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void testPeeking() {
|
||||
PeekingStingIterator iter = ArtificialSamUtils.unmappedReadIterator(1, 100, 100);
|
||||
PeekingStingIterator iter = ArtificialSAMUtils.unmappedReadIterator(1, 100, 100);
|
||||
int count = 0;
|
||||
while (iter.hasNext()) {
|
||||
int readCnt = ((ArtificialSAMIterator)(iter)).readsTaken();
|
||||
Loading…
Reference in New Issue