From 0177eb4987eb14daddcd5cd794a91f18d2c3b335 Mon Sep 17 00:00:00 2001 From: Olivia Wen-Mei Lang Date: Fri, 18 Jun 2021 15:29:30 -0400 Subject: [PATCH 1/4] deprecate JTV File Format #64 Affected tools are TagPileup in Read_Analysis and the two sort tools in Coordinate_Manipulation Remove the util.JTVOutput class that writes a JTV file. Remove the code within the SortBED and SortGFF script classes that call the JTVOutput class to generate the JTV. Remove the code within the TagPileup script class that calls the JTVOutput class to generate the JTV. Remove the JTV-related variables stored in the PileupParameters class that TagPileup uses. Remove the code within the CLI and window_interface class that set the PileupParameter values. --- src/cli/Read_Analysis/TagPileupCLI.java | 3 -- src/objects/PileupParameters.java | 13 +---- .../BED_Manipulation/SortBED.java | 2 - .../GFF_Manipulation/SortGFF.java | 2 - src/scripts/Read_Analysis/TagPileup.java | 24 --------- src/util/JTVOutput.java | 50 ------------------- .../Read_Analysis/TagPileupWindow.java | 39 +-------------- 7 files changed, 3 insertions(+), 130 deletions(-) delete mode 100644 src/util/JTVOutput.java diff --git a/src/cli/Read_Analysis/TagPileupCLI.java b/src/cli/Read_Analysis/TagPileupCLI.java index 4e6788a80..c0f4e2b3a 100644 --- a/src/cli/Read_Analysis/TagPileupCLI.java +++ b/src/cli/Read_Analysis/TagPileupCLI.java @@ -50,8 +50,6 @@ static class OutputOptions{ @Option(names = {"-M", "--output-matrix"}, description = "specify output basename for matrix files (files each for sense and anti will be output)", arity="0..1") private ArrayList outputMatrix = new ArrayList(Arrays.asList("no","matrix","output")); -// @Option(names = {"-j", "--output-jtv"}, description = "output JTV file (default=false)") -// private boolean jtv = false; @Option(names = {"-z", "--gzip"}, description = "output compressed output (default=false)") private boolean zip = false; @Option(names = {"--cdt"}, description = "output matrix in cdt format (default)") @@ -304,7 +302,6 @@ else if(readType.midpoint){ p.setPErequire(filterOptions.requirePE); //Set output statuses - p.setJTVstatus(false); //not available for CLI p.setGZIPstatus(outputOptions.zip); //Set Ratio (code to standardize tags sequenced to genome size (1 tag / 1 bp)) diff --git a/src/objects/PileupParameters.java b/src/objects/PileupParameters.java index 286cb35ff..ba0225ce8 100644 --- a/src/objects/PileupParameters.java +++ b/src/objects/PileupParameters.java @@ -35,7 +35,6 @@ public class PileupParameters { private File BLACKLIST = null; private boolean STANDARD = false; private boolean outputCOMPOSITE = false; //Output composite values - private boolean outputJTV = false; private boolean outputGZIP = false; private boolean requirePE = false; private double STANDRATIO = 1; @@ -68,7 +67,6 @@ public void printAll(){ System.out.println( "private File BLACKLIST = " + BLACKLIST ); System.out.println( "private boolean STANDARD = " + STANDARD ); System.out.println( "private boolean outputCOMPOSITE = " + outputCOMPOSITE ); - System.out.println( "private boolean outputJTV = " + outputJTV ); System.out.println( "private boolean outputGZIP = " + outputGZIP ); System.out.println( "private boolean requirePE = " + requirePE ); System.out.println( "private double STANDRATIO = " + STANDRATIO ); @@ -92,13 +90,6 @@ public void setGZIPstatus(boolean status) { outputGZIP = status; } - public boolean getOutputJTV() { - return outputJTV; - } - public void setJTVstatus(boolean status) { - outputJTV = status; - } - public File getBlacklist() { return BLACKLIST; } @@ -303,9 +294,7 @@ public String getCLIcmd(){ if(MIN_INSERT!=-9999){ cliCommand += " -n " + MIN_INSERT; } //Add MAX_INSERT if(MAX_INSERT!=-9999){ cliCommand += " -x " + MAX_INSERT; } - - //Add outputJTV - if(outputJTV==true){ cliCommand += " -j"; } + //Add outputGZIP if(outputGZIP==true){ cliCommand += " -z"; } diff --git a/src/scripts/Coordinate_Manipulation/BED_Manipulation/SortBED.java b/src/scripts/Coordinate_Manipulation/BED_Manipulation/SortBED.java index 80a6523c0..2c5ad82ef 100644 --- a/src/scripts/Coordinate_Manipulation/BED_Manipulation/SortBED.java +++ b/src/scripts/Coordinate_Manipulation/BED_Manipulation/SortBED.java @@ -9,7 +9,6 @@ import java.util.Scanner; import objects.CoordinateObjects.BEDCoord; -import util.JTVOutput; public class SortBED { public static void sortBEDbyCDT(String outname, File bed, File cdt, int START_INDEX, int STOP_INDEX) @@ -46,7 +45,6 @@ public static void sortBEDbyCDT(String outname, File bed, File cdt, int START_IN } OUT.close(); CDTFile = null; // Free up memory by getting CDT file out of memory - JTVOutput.outputJTV(outname, "green"); // Match to bed file after HashMap BEDFile = new HashMap(); diff --git a/src/scripts/Coordinate_Manipulation/GFF_Manipulation/SortGFF.java b/src/scripts/Coordinate_Manipulation/GFF_Manipulation/SortGFF.java index 0c86e10a1..4d02de4f3 100644 --- a/src/scripts/Coordinate_Manipulation/GFF_Manipulation/SortGFF.java +++ b/src/scripts/Coordinate_Manipulation/GFF_Manipulation/SortGFF.java @@ -9,7 +9,6 @@ import java.util.Scanner; import objects.CoordinateObjects.GFFCoord; -import util.JTVOutput; public class SortGFF { public static void sortGFFbyCDT(String outname, File gff, File cdt, int START_INDEX, int STOP_INDEX) @@ -46,7 +45,6 @@ public static void sortGFFbyCDT(String outname, File gff, File cdt, int START_IN } OUT.close(); CDTFile = null; // Free up memory by getting CDT file out of memory - JTVOutput.outputJTV(outname, "green"); // Match to gff file after HashMap GFFFile = new HashMap(); diff --git a/src/scripts/Read_Analysis/TagPileup.java b/src/scripts/Read_Analysis/TagPileup.java index 3d799648f..f9e96527f 100644 --- a/src/scripts/Read_Analysis/TagPileup.java +++ b/src/scripts/Read_Analysis/TagPileup.java @@ -25,7 +25,6 @@ import objects.CoordinateObjects.BEDCoord; import scripts.Read_Analysis.PileupScripts.PileupExtract; import util.ArrayUtilities; -import util.JTVOutput; public class TagPileup { File BED = null; @@ -267,29 +266,6 @@ public void run() throws IOException { } } - // Output JTV files - if (OUT_S1 != null) { - if (PARAM.getOutputJTV() && PARAM.getOutputType() == 2) { - if (STRAND == 0) - JTVOutput.outputJTV( - PARAM.getOutputDirectory() + File.separator + generateFileName(BED.getName(), BAM.getName(), 0), - PARAM.getSenseColor()); - else - JTVOutput.outputJTV( - PARAM.getOutputDirectory() + File.separator + generateFileName(BED.getName(), BAM.getName(), 2), - PARAM.getCombinedColor()); - } - OUT_S1.close(); - } - if (OUT_S2 != null) { - if (PARAM.getOutputJTV() && PARAM.getOutputType() == 2) { - JTVOutput.outputJTV( - PARAM.getOutputDirectory() + File.separator + generateFileName(BED.getName(), BAM.getName(), 1), - PARAM.getAntiColor()); - } - OUT_S2.close(); - } - } // Get size of largest array for composite generation diff --git a/src/util/JTVOutput.java b/src/util/JTVOutput.java deleted file mode 100644 index 7b09c1405..000000000 --- a/src/util/JTVOutput.java +++ /dev/null @@ -1,50 +0,0 @@ -package util; - -import java.awt.Color; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.PrintStream; - -public class JTVOutput { - - public static void outputJTV(String filename, String type) throws FileNotFoundException { - String[] name = filename.split("\\."); - PrintStream OUT = new PrintStream(new File(name[0] + ".jtv")); - if(type.equals("red")) { - OUT.println(""); - } else if(type.equals("orange")) { - OUT.println(""); - } else if(type.equals("yellow")) { - OUT.println(""); - } else if(type.equals("green")) { - OUT.println(""); - } else if(type.equals("blue")) { - OUT.println(""); - } else if(type.equals("purple")) { - OUT.println(""); - } else if(type.equals("black")) { - OUT.println(""); - OUT.close(); - } - - public static String convertColortoHex(Color RGB) { - String hex = Integer.toHexString(RGB.getRGB() & 0xffffff); - if (hex.length() < 6) { - hex = "0" + hex; - } - hex = "#" + hex; - return hex; - } -} diff --git a/src/window_interface/Read_Analysis/TagPileupWindow.java b/src/window_interface/Read_Analysis/TagPileupWindow.java index f5174576b..f53bf6288 100644 --- a/src/window_interface/Read_Analysis/TagPileupWindow.java +++ b/src/window_interface/Read_Analysis/TagPileupWindow.java @@ -98,7 +98,6 @@ public class TagPileupWindow extends JFrame implements ActionListener, PropertyC private JCheckBox chckbxRequireProperPe; private JCheckBox chckbxFilterByMin; private JCheckBox chckbxFilterByMax; - private JCheckBox chckbxOutputJtv; private JCheckBox chckbxOutputGzip; JProgressBar progressBar; @@ -180,7 +179,6 @@ public Void doInBackground() throws IOException, InterruptedException { if (rdbtnTabdelimited.isSelected()) { param.setOutputType(1); } else if (rdbtnCdt.isSelected()) { param.setOutputType(2); - if (chckbxOutputJtv.isSelected()) { param.setJTVstatus(true); } } if (chckbxOutputGzip.isSelected()) { param.setGZIPstatus(true); } } @@ -719,14 +717,9 @@ public void actionPerformed(ActionEvent e) { output.add(rdbtnCdt); rdbtnCdt.setSelected(true); - chckbxOutputJtv = new JCheckBox("Output JTV"); - sl_contentPane.putConstraint(SpringLayout.NORTH, chckbxOutputJtv, 0, SpringLayout.NORTH, rdbtnCdt); - sl_contentPane.putConstraint(SpringLayout.WEST, chckbxOutputJtv, 10, SpringLayout.EAST, rdbtnCdt); - contentPane.add(chckbxOutputJtv); - chckbxOutputGzip = new JCheckBox("Output GZIP"); - sl_contentPane.putConstraint(SpringLayout.NORTH, chckbxOutputGzip, 0, SpringLayout.NORTH, chckbxOutputData); - sl_contentPane.putConstraint(SpringLayout.WEST, chckbxOutputGzip, 10, SpringLayout.EAST, chckbxOutputJtv); + sl_contentPane.putConstraint(SpringLayout.NORTH, chckbxOutputGzip, 0, SpringLayout.NORTH, rdbtnCdt); + sl_contentPane.putConstraint(SpringLayout.WEST, chckbxOutputGzip, 10, SpringLayout.EAST, rdbtnCdt); contentPane.add(chckbxOutputGzip); lblOutputMatrixFormat = new JLabel("Matrix File Format:"); @@ -859,15 +852,11 @@ public void itemStateChanged(ItemEvent e) { lblOutputMatrixFormat.setEnabled(true); rdbtnTabdelimited.setEnabled(true); rdbtnCdt.setEnabled(true); - if (rdbtnCdt.isSelected()) { - chckbxOutputJtv.setEnabled(true); - } chckbxOutputGzip.setEnabled(true); } else { lblOutputMatrixFormat.setEnabled(false); rdbtnTabdelimited.setEnabled(false); rdbtnCdt.setEnabled(false); - chckbxOutputJtv.setEnabled(false); chckbxOutputGzip.setEnabled(false); if (!chckbxOutputCompositeData.isSelected()) { activateOutput(false); @@ -876,26 +865,6 @@ public void itemStateChanged(ItemEvent e) { } }); - rdbtnTabdelimited.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - if (rdbtnTabdelimited.isSelected()) { - chckbxOutputJtv.setEnabled(false); - } else { - chckbxOutputJtv.setEnabled(true); - } - } - }); - - rdbtnCdt.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - if (rdbtnCdt.isSelected()) { - chckbxOutputJtv.setEnabled(true); - } else { - chckbxOutputJtv.setEnabled(false); - } - } - }); - chckbxOutputCompositeData.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (chckbxOutputCompositeData.isSelected()) { @@ -1050,12 +1019,8 @@ public void massXable(Container con, boolean status) { lblOutputMatrixFormat.setEnabled(false); rdbtnTabdelimited.setEnabled(false); rdbtnCdt.setEnabled(false); - chckbxOutputJtv.setEnabled(false); chckbxOutputGzip.setEnabled(false); } - if (rdbtnTabdelimited.isSelected()) { - chckbxOutputJtv.setEnabled(false); - } if (!chckbxOutputCompositeData.isSelected()) { txtCompositeName.setEnabled(false); } From 6ee223c3189f05fd4de5611973c6b4dd88a791eb Mon Sep 17 00:00:00 2001 From: Olivia Wen-Mei Lang Date: Mon, 28 Jun 2021 02:12:13 -0400 Subject: [PATCH 2/4] move composite plot color information from PileupParameters object Since the JTV file type was deprecated, the command line interface of Tag Pileup does not use color information because it only stores the values of the composite plot rather than generating the PNG (see separate composite plot tool). As a result, the PileupParameters object is used by the script TagPileup object and the colors are used only by the Output window from the GUI interface. It is redundant to pass the color information to the script when it is only used by the output window. PileupParameters.java--color information (Anti, Sense, and Combined) are removed from the object. TagPileupOutput--constructor adjusted to accept an ArrayList of Color objects and the composite plot figures are adjusted to use this ArrayList for generating the composite plot object. Two whitespace formatting changes are also included here. TagPileupWindow--The code for changing the PileupParameters color fields is adjusted to create a new ArrayList of Color objects to pass to the TagPileupOutput object. --- src/objects/PileupParameters.java | 50 ------------------- .../Read_Analysis/TagPileupOutput.java | 16 +++--- .../Read_Analysis/TagPileupWindow.java | 10 ++-- 3 files changed, 15 insertions(+), 61 deletions(-) diff --git a/src/objects/PileupParameters.java b/src/objects/PileupParameters.java index ba0225ce8..446ae8964 100644 --- a/src/objects/PileupParameters.java +++ b/src/objects/PileupParameters.java @@ -1,8 +1,6 @@ package objects; -import java.awt.Color; import java.io.File; -import java.util.ArrayList; import java.io.PrintStream; public class PileupParameters { @@ -42,14 +40,6 @@ public class PileupParameters { private int MIN_INSERT = -9999; private int MAX_INSERT = -9999; - private Color Sense = null; - private Color Anti = null; - private Color Combined = null; - - public PileupParameters() { - - } - public void printAll(){ System.out.println( "<><><><><><><><><><><><><><><><><><><><>" ); System.out.println( "private File OUTPUT = " + OUTPUT ); @@ -74,12 +64,6 @@ public void printAll(){ System.out.println( "private int MIN_INSERT = " + MIN_INSERT ); System.out.println( "private int MAX_INSERT = " + MAX_INSERT ); System.out.println(); - System.out.println( "private Color Sense = " + Sense ); - System.out.println( "private Color Anti = " + Anti ); - System.out.println( "private Color Combined = " + Combined ); -// System.out.println( "" + ); -// System.out.println( "" + ); -// System.out.println( "" + ); System.out.println( "<><><><><><><><><><><><><><><><><><><><>" ); } @@ -132,35 +116,6 @@ public void setOutputCompositeStatus(boolean out) { outputCOMPOSITE = out; } - public ArrayList getColors() { - ArrayList ALL = new ArrayList(); - if(Sense != null) ALL.add(Sense); - if(Anti != null) ALL.add(Anti); - if(Combined != null) ALL.add(Combined); - return ALL; - } - - public Color getSenseColor() { - return Sense; - } - public void setSenseColor(Color s) { - Sense = s; - } - - public Color getAntiColor() { - return Anti; - } - public void setAntiColor(Color a) { - Anti = a; - } - - public Color getCombinedColor() { - return Combined; - } - public void setCombinedColor(Color c) { - Combined = c; - } - public double getRatio() { return STANDRATIO; } @@ -301,11 +256,6 @@ public String getCLIcmd(){ //Add CPU if(CPU!=1){ cliCommand += " --cpu " + CPU; } -// System.out.println( "private File OUTPUT = " + OUTPUT ); -// System.out.println( "private String COMPOSITE = " + COMPOSITE ); -// System.out.println( "private int OUTTYPE = " + OUTTYPE ); -// System.out.println( "private boolean outputCOMPOSITE = " + outputCOMPOSITE ); - return(cliCommand); } diff --git a/src/window_interface/Read_Analysis/TagPileupOutput.java b/src/window_interface/Read_Analysis/TagPileupOutput.java index 7bc865d3b..9af36372c 100644 --- a/src/window_interface/Read_Analysis/TagPileupOutput.java +++ b/src/window_interface/Read_Analysis/TagPileupOutput.java @@ -1,9 +1,11 @@ package window_interface.Read_Analysis; import java.awt.BorderLayout; +import java.awt.Color; import java.io.File; import java.io.IOException; import java.io.PrintStream; +import java.util.ArrayList; import java.util.Vector; import javax.swing.JFrame; @@ -25,6 +27,7 @@ public class TagPileupOutput extends JFrame { Vector BEDFiles = null; Vector BAMFiles = null; + ArrayList COLORS; PileupParameters PARAM = null; PrintStream COMPOSITE = null; @@ -33,7 +36,7 @@ public class TagPileupOutput extends JFrame { final JTabbedPane tabbedPane_Scatterplot; final JTabbedPane tabbedPane_Statistics; - public TagPileupOutput(Vector be, Vector ba, PileupParameters param) { + public TagPileupOutput(Vector be, Vector ba, PileupParameters param, ArrayList colors) { setTitle("Tag Pileup Composite"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(150, 150, 800, 600); @@ -59,6 +62,7 @@ public TagPileupOutput(Vector be, Vector ba, PileupParameters param) BEDFiles = be; BAMFiles = ba; PARAM = param; + COLORS = colors; } public void run() throws IOException { @@ -82,15 +86,13 @@ public void run() throws IOException { if (BAMvalid[z]) { // Code to standardize tags sequenced to genome size (1 tag / 1 bp) if (PARAM.getStandard() && PARAM.getBlacklist() != null) { - PARAM.setRatio( - BAMUtilities.calculateStandardizationRatio(BAM, PARAM.getBlacklist(), PARAM.getRead())); + PARAM.setRatio(BAMUtilities.calculateStandardizationRatio(BAM, PARAM.getBlacklist(), PARAM.getRead())); } else if (PARAM.getStandard()) { PARAM.setRatio(BAMUtilities.calculateStandardizationRatio(BAM, PARAM.getRead())); } for (int BED_Index = 0; BED_Index < BEDFiles.size(); BED_Index++) { - System.err.println( - "Processing BAM: " + BAM.getName() + "\tCoordinate: " + BEDFiles.get(BED_Index).getName()); + System.err.println( "Processing BAM: " + BAM.getName() + "\tCoordinate: " + BEDFiles.get(BED_Index).getName()); JTextArea STATS = new JTextArea(); // Generate statistics object STATS.setEditable(false); // Make it un-editable @@ -101,9 +103,9 @@ public void run() throws IOException { // Make composite plots if (PARAM.getStrand() == 0) { - tabbedPane_Scatterplot.add(BAM.getName(), CompositePlot.createCompositePlot(script_obj.DOMAIN, script_obj.AVG_S1, script_obj.AVG_S2, BEDFiles.get(BED_Index).getName(), PARAM.getColors())); + tabbedPane_Scatterplot.add(BAM.getName(), CompositePlot.createCompositePlot(script_obj.DOMAIN, script_obj.AVG_S1, script_obj.AVG_S2, BEDFiles.get(BED_Index).getName(), COLORS)); } else { - tabbedPane_Scatterplot.add(BAM.getName(), CompositePlot.createCompositePlot(script_obj.DOMAIN, script_obj.AVG_S1, BEDFiles.get(BED_Index).getName(), PARAM.getColors())); + tabbedPane_Scatterplot.add(BAM.getName(), CompositePlot.createCompositePlot(script_obj.DOMAIN, script_obj.AVG_S1, BEDFiles.get(BED_Index).getName(), COLORS)); } STATS.setCaretPosition(0); diff --git a/src/window_interface/Read_Analysis/TagPileupWindow.java b/src/window_interface/Read_Analysis/TagPileupWindow.java index f53bf6288..48bddaf3b 100644 --- a/src/window_interface/Read_Analysis/TagPileupWindow.java +++ b/src/window_interface/Read_Analysis/TagPileupWindow.java @@ -15,6 +15,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; +import java.util.ArrayList; import java.util.Vector; import javax.swing.ButtonGroup; @@ -137,13 +138,14 @@ public Void doInBackground() throws IOException, InterruptedException { setProgress(0); // Load up parameters for the pileup into single object PileupParameters param = new PileupParameters(); + ArrayList colors = new ArrayList(); if (rdbtnSeperate.isSelected()) { param.setStrand(0); - param.setSenseColor(btnSenseColor.getForeground()); - param.setAntiColor(btnAntiColor.getForeground()); + colors.add(btnSenseColor.getForeground()); + colors.add(btnAntiColor.getForeground()); } else if (rdbtnComb.isSelected()) { param.setStrand(1); - param.setCombinedColor(btnCombinedColor.getForeground()); + colors.add(btnCombinedColor.getForeground()); } if (rdbtnRead1.isSelected()) { param.setRead(0); } @@ -198,7 +200,7 @@ else if (rdbtnCdt.isSelected()) { param.setStdNum(Integer.parseInt(txtNumStd.getText())); param.setCPU(Integer.parseInt(txtCPU.getText())); - TagPileupOutput pile = new TagPileupOutput(BEDFiles, BAMFiles, param); + TagPileupOutput pile = new TagPileupOutput(BEDFiles, BAMFiles, param, colors); pile.addPropertyChangeListener("tag", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent propertyChangeEvent) { From 43335b158ae50b58cf86327536080b50587e64c6 Mon Sep 17 00:00:00 2001 From: Olivia Wen-Mei Lang Date: Tue, 21 Dec 2021 09:42:50 -0500 Subject: [PATCH 3/4] minor adjust output selection logic TagPileup TagPileupWindow contained logically redundant if-statement checks that were merged in this commit. i.e. the chckbxOutputData was checked for if it was *not selected* and then for if it was *selected* which was logically merged with an added "else" statement --- src/window_interface/Read_Analysis/TagPileupWindow.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/window_interface/Read_Analysis/TagPileupWindow.java b/src/window_interface/Read_Analysis/TagPileupWindow.java index 48bddaf3b..b0dc6b0e8 100644 --- a/src/window_interface/Read_Analysis/TagPileupWindow.java +++ b/src/window_interface/Read_Analysis/TagPileupWindow.java @@ -163,8 +163,6 @@ public Void doInBackground() throws IOException, InterruptedException { else if (rdbtnSlidingWindow.isSelected()) { param.setTrans(1); } else if (rdbtnGaussianSmooth.isSelected()) { param.setTrans(2); } - if (!chckbxOutputData.isSelected()) { param.setOutputType(0); } - if(!chckbxOutputData.isSelected() && !chckbxOutputCompositeData.isSelected()) { param.setOutputDirectory(null); } else { param.setOutputDirectory(OUT_DIR); } @@ -179,11 +177,9 @@ public Void doInBackground() throws IOException, InterruptedException { if (chckbxOutputData.isSelected()) { if (rdbtnTabdelimited.isSelected()) { param.setOutputType(1); } - else if (rdbtnCdt.isSelected()) { - param.setOutputType(2); - } + else if (rdbtnCdt.isSelected()) { param.setOutputType(2); } if (chckbxOutputGzip.isSelected()) { param.setGZIPstatus(true); } - } + } else { param.setOutputType(0); } if (chckbxTagStandard.isSelected()) { if (BLACKLIST != null) { param.setBlacklist(BLACKLIST); } From 0e0a79e106a66907ea4e099dc3f70d0ad19313e5 Mon Sep 17 00:00:00 2001 From: Olivia Wen-Mei Lang Date: Tue, 21 Dec 2021 09:44:12 -0500 Subject: [PATCH 4/4] add close statement for writers TagPileup Two writer objects were not closed in the TagPileup script. This was fixed in this commit (along with some cosmetic code indentation adjustments) --- src/scripts/Read_Analysis/TagPileup.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/scripts/Read_Analysis/TagPileup.java b/src/scripts/Read_Analysis/TagPileup.java index f9e96527f..c6e3bcd19 100644 --- a/src/scripts/Read_Analysis/TagPileup.java +++ b/src/scripts/Read_Analysis/TagPileup.java @@ -191,12 +191,13 @@ public void run() throws IOException { if (AVG_S2 != null) AVG_S2[j] += tempR[j]; } - if (OUT_S1 != null) - OUT_S1.write("\n"); - if (OUT_S2 != null) - OUT_S2.write("\n"); + if (OUT_S1 != null) OUT_S1.write("\n"); + if (OUT_S2 != null) OUT_S2.write("\n"); } + if (OUT_S1 != null) OUT_S1.close(); + if (OUT_S2 != null) OUT_S2.close(); + // Calculate average and domain here int temp = (int) (((double) AVG_S1.length / 2.0) + 0.5); for (int i = 0; i < AVG_S1.length; i++) {