Move MSG - plus now obsolete classes which it depends on -- to oneoffprojects (with permission from Jared).

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2224 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-12-02 20:04:22 +00:00
parent 9c597309d3
commit 2c83f2f2bc
6 changed files with 62 additions and 15 deletions

View File

@ -1,11 +1,11 @@
package org.broadinstitute.sting.utils;
package org.broadinstitute.sting.oneoffprojects.multisamplecaller;
import org.broadinstitute.sting.utils.*;
import net.sf.samtools.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
/**
* Created by IntelliJ IDEA.
@ -14,7 +14,6 @@ import java.util.Random;
* Time: 8:54:05 AM
* To change this template use File | Settings | File Templates.
*/
@Deprecated
abstract public class BasicPileup {
public static final char DELETION_CHAR = 'D';

View File

@ -1,12 +1,9 @@
package org.broadinstitute.sting.playground.utils;
package org.broadinstitute.sting.oneoffprojects.multisamplecaller;
import org.broadinstitute.sting.utils.*;
import org.broadinstitute.sting.utils.Utils;
import org.broadinstitute.sting.utils.QualityUtils;
import static java.lang.Math.log10;
import static java.lang.Math.pow;
import java.util.HashMap;
import java.lang.Cloneable;
public class ClassicGenotypeLikelihoods implements Cloneable {

View File

@ -1,4 +1,4 @@
package org.broadinstitute.sting.playground.utils;
package org.broadinstitute.sting.oneoffprojects.multisamplecaller;
import java.lang.*;
import java.util.*;

View File

@ -1,4 +1,4 @@
package org.broadinstitute.sting.playground.utils;
package org.broadinstitute.sting.oneoffprojects.multisamplecaller;
import java.util.HashMap;

View File

@ -1,5 +1,5 @@
package org.broadinstitute.sting.playground.gatk.walkers;
package org.broadinstitute.sting.oneoffprojects.multisamplecaller;
import net.sf.samtools.SAMFileHeader;
import net.sf.samtools.SAMReadGroupRecord;
@ -9,7 +9,6 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.walkers.LocusWalker;
import org.broadinstitute.sting.playground.utils.*;
import org.broadinstitute.sting.utils.*;
import org.broadinstitute.sting.utils.cmdLine.Argument;
@ -20,7 +19,7 @@ import java.io.*;
// Beta iterative multi-sample caller
// j.maguire 6-11-2009
public class MultiSampleCaller2 extends LocusWalker<MultiSampleCaller2.MultiSampleCallResult,String>
public class MultiSampleCaller extends LocusWalker<MultiSampleCaller.MultiSampleCallResult,String>
{
@Argument(required=false, shortName="fractional_counts", doc="should we use fractional counts?") public boolean FRACTIONAL_COUNTS = false;
@Argument(required=false, shortName="max_iterations", doc="Maximum number of iterations for EM") public int MAX_ITERATIONS = 10;

View File

@ -184,10 +184,62 @@ public class DupUtils {
return l;
}
// TODO -- get rid of all this crappy, obsolete pileup code
@Deprecated
private static ArrayList<Byte> getBasesAsArrayList( List<SAMRecord> reads, List<Integer> offsets ) {
ArrayList<Byte> bases = new ArrayList<Byte>(reads.size());
for (byte value : getBasesAsArray(reads, offsets))
bases.add(value);
return bases;
}
@Deprecated
private static ArrayList<Byte> getQualsAsArrayList( List<SAMRecord> reads, List<Integer> offsets ) {
ArrayList<Byte> quals = new ArrayList<Byte>(reads.size());
for (byte value : getQualsAsArray(reads, offsets))
quals.add(value);
return quals;
}
@Deprecated
public static byte[] getBasesAsArray( List<SAMRecord> reads, List<Integer> offsets ) {
byte array[] = new byte[reads.size()];
int index = 0;
for ( int i = 0; i < reads.size(); i++ ) {
SAMRecord read = reads.get(i);
int offset = offsets.get(i);
if ( offset == -1 ) {
array[index++] = ((byte)'D');
} else {
array[index++] = read.getReadBases()[offset];
}
}
return array;
}
@Deprecated
private static byte[] getQualsAsArray( List<SAMRecord> reads, List<Integer> offsets ) {
byte array[] = new byte[reads.size()];
int index = 0;
for ( int i = 0; i < reads.size(); i++ ) {
SAMRecord read = reads.get(i);
int offset = offsets.get(i);
// skip deletion sites
if ( offset == -1 ) {
array[index++] = ((byte)0);
} else {
array[index++] = read.getBaseQualities()[offset];
}
}
return array;
}
private static Pair<Byte, Byte> combineBaseProbs(List<SAMRecord> duplicates, int readOffset, int maxQScore) {
List<Integer> offsets = constantOffset(duplicates, readOffset);
ArrayList<Byte> bases = BasicPileup.getBasesAsArrayList(duplicates, offsets);
ArrayList<Byte> quals = BasicPileup.getQualsAsArrayList(duplicates, offsets);
ArrayList<Byte> bases = getBasesAsArrayList(duplicates, offsets);
ArrayList<Byte> quals = getQualsAsArrayList(duplicates, offsets);
final boolean debug = false;
// calculate base probs