Merge branch 'master' of ssh://gsa2.broadinstitute.org/humgen/gsa-scr1/gsa-engineering/git/unstable
This commit is contained in:
commit
d449f169d3
|
|
@ -20,11 +20,11 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts of bases from SLX, 454, and SOLiD at this site
|
* Counts of bases from Illumina, 454, and SOLiD at this site
|
||||||
*/
|
*/
|
||||||
@Hidden
|
@Hidden
|
||||||
public class TechnologyComposition extends InfoFieldAnnotation implements ExperimentalAnnotation {
|
public class TechnologyComposition extends InfoFieldAnnotation implements ExperimentalAnnotation {
|
||||||
private String nSLX = "NumSLX";
|
private String nIllumina = "NumIllumina";
|
||||||
private String n454 ="Num454";
|
private String n454 ="Num454";
|
||||||
private String nSolid = "NumSOLiD";
|
private String nSolid = "NumSOLiD";
|
||||||
private String nOther = "NumOther";
|
private String nOther = "NumOther";
|
||||||
|
|
@ -46,7 +46,7 @@ public class TechnologyComposition extends InfoFieldAnnotation implements Experi
|
||||||
reads454++;
|
reads454++;
|
||||||
else if (ReadUtils.isSOLiDRead(p.getRead()))
|
else if (ReadUtils.isSOLiDRead(p.getRead()))
|
||||||
readsSolid++;
|
readsSolid++;
|
||||||
else if (ReadUtils.isSLXRead(p.getRead()))
|
else if (ReadUtils.isIlluminaRead(p.getRead()))
|
||||||
readsIllumina++;
|
readsIllumina++;
|
||||||
else
|
else
|
||||||
readsOther++;
|
readsOther++;
|
||||||
|
|
@ -55,16 +55,16 @@ public class TechnologyComposition extends InfoFieldAnnotation implements Experi
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put(nSLX, String.format("%d", readsIllumina));
|
map.put(nIllumina, String.format("%d", readsIllumina));
|
||||||
map.put(n454, String.format("%d", reads454));
|
map.put(n454, String.format("%d", reads454));
|
||||||
map.put(nSolid, String.format("%d", readsSolid));
|
map.put(nSolid, String.format("%d", readsSolid));
|
||||||
map.put(nOther, String.format("%d", readsOther));
|
map.put(nOther, String.format("%d", readsOther));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getKeyNames() { return Arrays.asList(nSLX,n454,nSolid,nOther); }
|
public List<String> getKeyNames() { return Arrays.asList(nIllumina,n454,nSolid,nOther); }
|
||||||
|
|
||||||
public List<VCFInfoHeaderLine> getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(nSLX, 1, VCFHeaderLineType.Integer, "Number of SLX reads"),
|
public List<VCFInfoHeaderLine> getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(nIllumina, 1, VCFHeaderLineType.Integer, "Number of Illumina reads"),
|
||||||
new VCFInfoHeaderLine(n454, 1, VCFHeaderLineType.Integer, "Number of 454 reads"),
|
new VCFInfoHeaderLine(n454, 1, VCFHeaderLineType.Integer, "Number of 454 reads"),
|
||||||
new VCFInfoHeaderLine(nSolid, 1, VCFHeaderLineType.Integer, "Number of SOLiD reads"),
|
new VCFInfoHeaderLine(nSolid, 1, VCFHeaderLineType.Integer, "Number of SOLiD reads"),
|
||||||
new VCFInfoHeaderLine(nOther, 1, VCFHeaderLineType.Integer, "Number of Other technology reads")); }
|
new VCFInfoHeaderLine(nOther, 1, VCFHeaderLineType.Integer, "Number of Other technology reads")); }
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ import java.util.*;
|
||||||
* -T IndelRealigner \
|
* -T IndelRealigner \
|
||||||
* -targetIntervals intervalListFromRTC.intervals \
|
* -targetIntervals intervalListFromRTC.intervals \
|
||||||
* -o realignedBam.bam \
|
* -o realignedBam.bam \
|
||||||
* [--known /path/to/indels.vcf] \
|
* [-known /path/to/indels.vcf] \
|
||||||
* [-compress 0] (this argument recommended to speed up the process *if* this is only a temporary file; otherwise, use the default value)
|
* [-compress 0] (this argument recommended to speed up the process *if* this is only a temporary file; otherwise, use the default value)
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|
@ -532,8 +532,9 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
read.getMappingQuality() == 0 ||
|
read.getMappingQuality() == 0 ||
|
||||||
read.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START ||
|
read.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START ||
|
||||||
ConstrainedMateFixingManager.iSizeTooBigToMove(read, MAX_ISIZE_FOR_MOVEMENT) ||
|
ConstrainedMateFixingManager.iSizeTooBigToMove(read, MAX_ISIZE_FOR_MOVEMENT) ||
|
||||||
ReadUtils.is454Read(read);
|
ReadUtils.is454Read(read) ||
|
||||||
// TODO -- it would be nice if we could use indels from 454 reads as alternate consenses
|
ReadUtils.isIonRead(read);
|
||||||
|
// TODO -- it would be nice if we could use indels from 454/Ion reads as alternate consenses
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cleanAndCallMap(ReferenceContext ref, GATKSAMRecord read, ReadMetaDataTracker metaDataTracker, GenomeLoc readLoc) {
|
private void cleanAndCallMap(ReferenceContext ref, GATKSAMRecord read, ReadMetaDataTracker metaDataTracker, GenomeLoc readLoc) {
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ public enum NGSPlatform {
|
||||||
* @return an NGSPlatform object matching the PL field of the header, of UNKNOWN if there was no match
|
* @return an NGSPlatform object matching the PL field of the header, of UNKNOWN if there was no match
|
||||||
*/
|
*/
|
||||||
public static final NGSPlatform fromReadGroup(SAMReadGroupRecord rg) {
|
public static final NGSPlatform fromReadGroup(SAMReadGroupRecord rg) {
|
||||||
|
if ( rg == null ) return UNKNOWN;
|
||||||
return fromReadGroupPL(rg.getPlatform());
|
return fromReadGroupPL(rg.getPlatform());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import net.sf.samtools.*;
|
||||||
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
||||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||||
import org.broadinstitute.sting.utils.MathUtils;
|
import org.broadinstitute.sting.utils.MathUtils;
|
||||||
|
import org.broadinstitute.sting.utils.NGSPlatform;
|
||||||
import org.broadinstitute.sting.utils.collections.Pair;
|
import org.broadinstitute.sting.utils.collections.Pair;
|
||||||
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
||||||
|
|
||||||
|
|
@ -211,43 +212,55 @@ public class ReadUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* is the read a 454 read ?
|
* is the read a 454 read?
|
||||||
*
|
*
|
||||||
* @param read the read to test
|
* @param read the read to test
|
||||||
* @return checks the read group tag PL for the default 454 tag
|
* @return checks the read group tag PL for the default 454 tag
|
||||||
*/
|
*/
|
||||||
public static boolean is454Read(SAMRecord read) {
|
public static boolean is454Read(SAMRecord read) {
|
||||||
return isPlatformRead(read, "454");
|
return NGSPlatform.fromRead(read) == NGSPlatform.LS454;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* is the read a SOLiD read ?
|
* is the read an IonTorrent read?
|
||||||
|
*
|
||||||
|
* @param read the read to test
|
||||||
|
* @return checks the read group tag PL for the default ion tag
|
||||||
|
*/
|
||||||
|
public static boolean isIonRead(SAMRecord read) {
|
||||||
|
return NGSPlatform.fromRead(read) == NGSPlatform.ION_TORRENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* is the read a SOLiD read?
|
||||||
*
|
*
|
||||||
* @param read the read to test
|
* @param read the read to test
|
||||||
* @return checks the read group tag PL for the default SOLiD tag
|
* @return checks the read group tag PL for the default SOLiD tag
|
||||||
*/
|
*/
|
||||||
public static boolean isSOLiDRead(SAMRecord read) {
|
public static boolean isSOLiDRead(SAMRecord read) {
|
||||||
return isPlatformRead(read, "SOLID");
|
return NGSPlatform.fromRead(read) == NGSPlatform.SOLID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* is the read a SLX read ?
|
* is the read a SLX read?
|
||||||
*
|
*
|
||||||
* @param read the read to test
|
* @param read the read to test
|
||||||
* @return checks the read group tag PL for the default SLX tag
|
* @return checks the read group tag PL for the default SLX tag
|
||||||
*/
|
*/
|
||||||
public static boolean isSLXRead(SAMRecord read) {
|
public static boolean isIlluminaRead(SAMRecord read) {
|
||||||
return isPlatformRead(read, "ILLUMINA");
|
return NGSPlatform.fromRead(read) == NGSPlatform.ILLUMINA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks if the read has a platform tag in the readgroup equal to 'name' ?
|
* checks if the read has a platform tag in the readgroup equal to 'name'.
|
||||||
|
* Assumes that 'name' is upper-cased.
|
||||||
*
|
*
|
||||||
* @param read the read to test
|
* @param read the read to test
|
||||||
* @param name the platform name to test
|
* @param name the upper-cased platform name to test
|
||||||
* @return whether or not name == PL tag in the read group of read
|
* @return whether or not name == PL tag in the read group of read
|
||||||
*/
|
*/
|
||||||
public static boolean isPlatformRead(SAMRecord read, String name) {
|
public static boolean isPlatformRead(SAMRecord read, String name) {
|
||||||
|
|
||||||
SAMReadGroupRecord readGroup = read.getReadGroup();
|
SAMReadGroupRecord readGroup = read.getReadGroup();
|
||||||
if (readGroup != null) {
|
if (readGroup != null) {
|
||||||
Object readPlatformAttr = readGroup.getAttribute("PL");
|
Object readPlatformAttr = readGroup.getAttribute("PL");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue