Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions qsv/src/org/qcmg/qsv/QSVPipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public QSVPipeline(Options options, String resultsDir, Date analysisDate, String
}

if (options.isQCMG()) {
writeDCCHeader(options, analysisDate, analysisId, exec);
writeDCCHeader(options, analysisId, exec);
}

File countFile = new File(resultsDir + FILE_SEPARATOR + options.getSampleName()+ "_sv_counts.txt");
Expand All @@ -152,11 +152,11 @@ public QSVPipeline(Options options, String resultsDir, Date analysisDate, String

}

private void writeDCCHeader(Options options, Date analysisDate, String analysisId, QExec exec) throws IOException {
new DCCReport(new File(resultsDir + FILE_SEPARATOR + options.getSampleName() + ".somatic.dcc"), analysisDate, analysisId, tumor, normal, options, exec);
private void writeDCCHeader(Options options, String analysisId, QExec exec) throws IOException {
new DCCReport(new File(resultsDir + FILE_SEPARATOR + options.getSampleName() + ".somatic.dcc"), analysisId, tumor, normal, options, exec);
if (options.isTwoFileMode()) {
new DCCReport(new File(resultsDir + FILE_SEPARATOR + options.getSampleName() + ".germline.dcc"), analysisDate, analysisId, tumor, normal, options, exec);
new DCCReport(new File(resultsDir + FILE_SEPARATOR + options.getSampleName() + ".normal-germline.dcc"), analysisDate, analysisId, tumor, normal, options, exec);
new DCCReport(new File(resultsDir + FILE_SEPARATOR + options.getSampleName() + ".germline.dcc"), analysisId, tumor, normal, options, exec);
new DCCReport(new File(resultsDir + FILE_SEPARATOR + options.getSampleName() + ".normal-germline.dcc"), analysisId, tumor, normal, options, exec);
}
}

Expand Down Expand Up @@ -383,11 +383,11 @@ public void annotateAndFilterBams() throws Exception {
CountDownLatch countDownLatch = new CountDownLatch(getThreadNo());

if (options.isTwoFileMode()) {
AnnotateFilterMT normalWorker = new AnnotateFilterMT(Thread.currentThread(), countDownLatch, normal, exitStatus, softclipDir, options);
AnnotateFilterMT normalWorker = new AnnotateFilterMT(countDownLatch, normal, exitStatus, softclipDir, options);
executorService.execute(normalWorker);
}

AnnotateFilterMT tumorWorker = new AnnotateFilterMT(Thread.currentThread(), countDownLatch, tumor, exitStatus, softclipDir, options);
AnnotateFilterMT tumorWorker = new AnnotateFilterMT(countDownLatch, tumor, exitStatus, softclipDir, options);
executorService.execute(tumorWorker);

executorService.shutdown();
Expand Down
15 changes: 12 additions & 3 deletions qsv/src/org/qcmg/qsv/annotate/AnnotateFilterMT.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class AnnotateFilterMT implements Runnable {
private final boolean translocationsOnly;


public AnnotateFilterMT(Thread mainThread, CountDownLatch countDownLatch, QSVParameters parameters, AtomicInteger exitStatus, String softclipDir, Options options) {
public AnnotateFilterMT(CountDownLatch countDownLatch, QSVParameters parameters, AtomicInteger exitStatus, String softclipDir, Options options) {
this.softClipDir = softclipDir;
this.query = options.getPairQuery();
this.clipQuery = options.getClipQuery();
Expand Down Expand Up @@ -168,8 +168,17 @@ public void run() {
writeThreads.shutdown();

logger.info("waiting for threads to finish (max wait will be 100 hours)");
filterThreads.awaitTermination(Constants.EXECUTOR_SERVICE_AWAIT_TERMINATION, TimeUnit.HOURS);
writeThreads.awaitTermination(Constants.EXECUTOR_SERVICE_AWAIT_TERMINATION, TimeUnit.HOURS);

try {
if (!filterThreads.awaitTermination(Constants.EXECUTOR_SERVICE_AWAIT_TERMINATION, TimeUnit.HOURS)) {
logger.error("Filtering threads did not finish within the time limit");
}
if (!writeThreads.awaitTermination(Constants.EXECUTOR_SERVICE_AWAIT_TERMINATION, TimeUnit.HOURS)) {
logger.error("Writing threads did not finish within the time limit");
}
} catch (final InterruptedException e) {
logger.error("Thread was interrupted while waiting for executor service to terminate: " + QSVUtil.getStrackTrace(e));
}

if (!readQueue.isEmpty() || !writeQueue.isEmpty() || !writeClipQueue.isEmpty()) {
throw new Exception(
Expand Down
31 changes: 1 addition & 30 deletions qsv/src/org/qcmg/qsv/annotate/IlluminaLongMatePairRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class IlluminaLongMatePairRecord {
private String zpAnnotation;
private final int isizeUpperLimit;
private final int isizeLowerLimit;
private final int nullNHZ = 0;
private int endZ = 0;
private int sameStrandZ = 0;
private int diffStrandNullZ = 0;
Expand Down Expand Up @@ -122,11 +121,7 @@ public boolean isAbbConverted() {
return abbConverted;
}

public void setAbbConverted(boolean abbConverted) {
this.abbConverted = abbConverted;
}

/**
/**
* Determine orientation of the record
* @return current zp annotation
*/
Expand Down Expand Up @@ -318,29 +313,5 @@ public void setZPAnnotation(String zp) {
this.zpAnnotation = zp;

}

public int getNullNHZ() {
return nullNHZ;
}

public int getEndZ() {
return endZ;
}

public int getSameStrandZ() {
return sameStrandZ;
}

public int getDiffStrandNullZ() {
return diffStrandNullZ;
}

public int getDiffStrandZ() {
return diffStrandZ;
}

public int getSameStrandNullZ() {
return sameStrandNullZ;
}

}
32 changes: 16 additions & 16 deletions qsv/src/org/qcmg/qsv/annotate/PairingStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@

/**
* <p>Java class for anonymous complex type.
*
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;restriction base="{<a href="http://www.w3.org/2001/XMLSchema">...</a>}anyType">
* &lt;sequence>
* &lt;element name="InsertRange">
* &lt;complexType>
Expand Down Expand Up @@ -60,8 +60,8 @@
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
Expand All @@ -79,7 +79,7 @@ public class PairingStats {
protected List<PairingStats.UniquePairing> uniquePairing;
@XmlElement(name = "ReadCount", required = true)
protected List<PairingStats.ReadCount> readCount;
@XmlElement(name = "Coverage", required = false)
@XmlElement(name = "Coverage")
protected List<PairingStats.Coverage> coverage;

/**
Expand Down Expand Up @@ -151,21 +151,21 @@ public List<PairingStats.Coverage> getCoverage() {

/**
* <p>Java class for anonymous complex type.
*
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;restriction base="{<a href="http://www.w3.org/2001/XMLSchema">...</a>}anyType">
* &lt;attribute name="LowerLimit" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="UpperLimit" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
Expand Down Expand Up @@ -243,13 +243,13 @@ public void setAverage(BigInteger value) {

/**
* <p>Java class for anonymous complex type.
*
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;restriction base="{<a href="http://www.w3.org/2001/XMLSchema">...</a>}anyType">
* &lt;sequence>
* &lt;element name="type" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="count" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
Expand All @@ -258,8 +258,8 @@ public void setAverage(BigInteger value) {
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
Expand Down
14 changes: 7 additions & 7 deletions qsv/src/org/qcmg/qsv/annotate/ZPAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@ public class ZPAnnotator {
* Returns a string that corresponds to the ZP annotation for the record
* (ZP=discordant pair classification)
*
* NOTE that in the interests of referential transparency, this method does not set the ZP attribute in the passed in SAMREcord
* NOTE that in the interests of referential transparency, this method does not set the ZP attribute in the passed in SAMRecord
*
*/
public static String createZPAnnotation(SAMRecord record, int isizeLowerLimit, int isizeUpperLimit) {
String zpAnnotation = "";
String zpAnnotation;
if ( ! record.getDuplicateReadFlag()) {

Integer nh = record.getIntegerAttribute(QSVConstants.NH);

if (null != nh && 1 == nh.intValue() && record.getMateUnmappedFlag()) {
if (null != nh && 1 == nh && record.getMateUnmappedFlag()) {
zpAnnotation = QSVConstants.D_STAR_STAR;
} else if (null != nh
&& 1 == nh.intValue()
&& 1 == nh
&& !record.getReferenceName().equals(
record.getMateReferenceName())
&& !record.getMateReferenceName().equals(Constants.EQ_STRING)) {
zpAnnotation = QSVConstants.C_STAR_STAR;

} else if (null != nh && 1 == nh.intValue()
} else if (null != nh && 1 == nh
&& record.getReadFailsVendorQualityCheckFlag()) {
zpAnnotation = QSVConstants.E_STAR_STAR;

} else if (null != nh && 1 == nh.intValue() && isDifferentStrand(record)) {
} else if (null != nh && 1 == nh && isDifferentStrand(record)) {
zpAnnotation = handleOrientation(record, "A");
zpAnnotation += handleIntervalSize(record, isizeLowerLimit, isizeUpperLimit);
} else if (null != nh && 1 != nh.intValue() && isDifferentStrand(record)) {
} else if (null != nh && 1 != nh && isDifferentStrand(record)) {
zpAnnotation = handleOrientation(record, "A");
zpAnnotation += handleIntervalSize(record, isizeLowerLimit, isizeUpperLimit);
if ( ! zpAnnotation.equals(QSVConstants.AAA)) {
Expand Down
41 changes: 18 additions & 23 deletions qsv/src/org/qcmg/qsv/assemble/Alignment.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ public class Alignment {

private int start;
private int length;

public Alignment(Read seed) {
this.seed = seed;
matchedReads = new ArrayList<ReadMatch>();
}


public Alignment(ConcurrentHashMap<Integer, ReadMatch> reads, Read seed)
{
this.seed = seed;
matchedReads = new ArrayList<ReadMatch>(reads.values());
matchedReads = new ArrayList<>(reads.values());
}

/*
Expand Down Expand Up @@ -77,22 +72,22 @@ private char getConsensusBase(int position)
int t = 0;
int c = 0;
int g = 0;
for (int i = 0 , len = bases.length ; i < len ; i++) {
switch (bases[i]) {
case 'A':
a++;
break;
case 'T':
t++;
break;
case 'C':
c++;
break;
case 'G':
g++;
break;
}
}
for (char basis : bases) {
switch (basis) {
case 'A':
a++;
break;
case 'T':
t++;
break;
case 'C':
c++;
break;
case 'G':
g++;
break;
}
}

if(a > t && a > c && a > g && a >= QSVAssemble.MINIMUM_READ_EXTEND) { //Is A the most common?
return 'A';
Expand Down
Loading