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
3 changes: 0 additions & 3 deletions src/cli/Read_Analysis/TagPileupCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> outputMatrix = new ArrayList<String>(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)")
Expand Down Expand Up @@ -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))
Expand Down
63 changes: 1 addition & 62 deletions src/objects/PileupParameters.java
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -35,22 +33,13 @@ 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;

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 );
Expand All @@ -68,20 +57,13 @@ 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 );
System.out.println();
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( "<><><><><><><><><><><><><><><><><><><><>" );
}

Expand All @@ -92,13 +74,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;
}
Expand Down Expand Up @@ -141,35 +116,6 @@ public void setOutputCompositeStatus(boolean out) {
outputCOMPOSITE = out;
}

public ArrayList<Color> getColors() {
ArrayList<Color> ALL = new ArrayList<Color>();
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;
}
Expand Down Expand Up @@ -303,20 +249,13 @@ 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"; }

//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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<String, String> BEDFile = new HashMap<String, String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<String, String> GFFFile = new HashMap<String, String>();
Expand Down
33 changes: 5 additions & 28 deletions src/scripts/Read_Analysis/TagPileup.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -192,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++) {
Expand Down Expand Up @@ -267,29 +267,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
Expand Down
50 changes: 0 additions & 50 deletions src/util/JTVOutput.java

This file was deleted.

16 changes: 9 additions & 7 deletions src/window_interface/Read_Analysis/TagPileupOutput.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,6 +27,7 @@ public class TagPileupOutput extends JFrame {
Vector<File> BEDFiles = null;
Vector<File> BAMFiles = null;

ArrayList<Color> COLORS;
PileupParameters PARAM = null;
PrintStream COMPOSITE = null;

Expand All @@ -33,7 +36,7 @@ public class TagPileupOutput extends JFrame {
final JTabbedPane tabbedPane_Scatterplot;
final JTabbedPane tabbedPane_Statistics;

public TagPileupOutput(Vector<File> be, Vector<File> ba, PileupParameters param) {
public TagPileupOutput(Vector<File> be, Vector<File> ba, PileupParameters param, ArrayList<Color> colors) {
setTitle("Tag Pileup Composite");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(150, 150, 800, 600);
Expand All @@ -59,6 +62,7 @@ public TagPileupOutput(Vector<File> be, Vector<File> ba, PileupParameters param)
BEDFiles = be;
BAMFiles = ba;
PARAM = param;
COLORS = colors;
}

public void run() throws IOException {
Expand All @@ -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
Expand All @@ -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);
Expand Down
Loading