Skip to content

Commit 93bd8a2

Browse files
committed
fix TagPileup tab-formatted output bug
This commit fixes the bug described in issue #41. The problem was in the case of setting the output to be tab formatted, the Writer objects OUT_S1 and/or OUT_S2 failed to close. I adjusted the "if" statements for outputting JTV files (whose code fell under the same conditionals as the code responsible for closing the output Writer objects) so that they are consistent with previous conditions but included the case of PARAM.getOutputType()==1 for closing the Writer objects.
1 parent 3d77659 commit 93bd8a2

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/scripts/Read_Analysis/TagPileup.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,20 @@ public void run() throws IOException {
285285
if(STRAND == 0) tabbedPane_Scatterplot.add(BAM.getName(), CompositePlot.createCompositePlot(DOMAIN, AVG_S1, AVG_S2, BEDFiles.get(BED_Index).getName(), PARAM.getColors()));
286286
else tabbedPane_Scatterplot.add(BAM.getName(), CompositePlot.createCompositePlot(DOMAIN, AVG_S1, BEDFiles.get(BED_Index).getName(), PARAM.getColors()));
287287

288-
if(OUT_S1 != null && PARAM.getOutputType() == 2) {
289-
if(PARAM.outputJTV()) {
288+
if(OUT_S1 != null) {
289+
if(PARAM.outputJTV() && PARAM.getOutputType() == 2) {
290290
if(STRAND == 0) JTVOutput.outputJTV(PARAM.getOutput() + File.separator + generateFileName(BEDFiles.get(BED_Index).getName(), BAM.getName(), 0), PARAM.getSenseColor());
291291
else JTVOutput.outputJTV(PARAM.getOutput() + File.separator + generateFileName(BEDFiles.get(BED_Index).getName(), BAM.getName(), 2), PARAM.getCombinedColor());
292292
}
293293
OUT_S1.close();
294294
}
295-
if(OUT_S2 != null && PARAM.getOutputType() == 2){
296-
if(PARAM.outputJTV()) { JTVOutput.outputJTV(PARAM.getOutput() + File.separator + generateFileName(BEDFiles.get(BED_Index).getName(), BAM.getName(), 1), PARAM.getAntiColor()); }
295+
if(OUT_S2 != null){
296+
if(PARAM.outputJTV() && PARAM.getOutputType() == 2) {
297+
JTVOutput.outputJTV(PARAM.getOutput() + File.separator + generateFileName(BEDFiles.get(BED_Index).getName(), BAM.getName(), 1), PARAM.getAntiColor());
298+
}
297299
OUT_S2.close();
298300
}
301+
299302
STATS.setCaretPosition(0);
300303
JScrollPane newpane = new JScrollPane(STATS, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
301304
tabbedPane_Statistics.add(BAM.getName(), newpane);

0 commit comments

Comments
 (0)