Skip to content

Commit d234f01

Browse files
committed
Tag Pileup Total Tag normalization with Blacklist filtering
Now allows user to add blacklist file (BED format) and use that to modify how the total tag normalization is calculated. This parameter is optional.
1 parent 77a0036 commit d234f01

2 files changed

Lines changed: 355 additions & 285 deletions

File tree

src/scripts/Read_Analysis/TagPileup.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ public void run() throws IOException {
9696
else {
9797

9898
//Code to standardize tags sequenced to genome size (1 tag / 1 bp)
99-
if(PARAM.getStandard()) { PARAM.setRatio(BAMUtilities.calculateStandardizationRatio(BAM, PARAM.getRead())); }
99+
if(PARAM.getStandard() && PARAM.getBlacklist() != null) { PARAM.setRatio(BAMUtilities.calculateStandardizationRatio(BAM, PARAM.getBlacklist(), PARAM.getRead())); }
100+
else if(PARAM.getStandard()) { PARAM.setRatio(BAMUtilities.calculateStandardizationRatio(BAM, PARAM.getRead())); }
101+
//System.out.println(PARAM.getRatio());
100102

101103
for(int BED_Index = 0; BED_Index < BEDFiles.size(); BED_Index++) {
102104
JTextArea STATS = new JTextArea(); //Generate statistics object
@@ -124,13 +126,14 @@ public void run() throws IOException {
124126
int currentindex = 0;
125127
for(int x = 0; x < CPU; x++) {
126128
currentindex += subset;
127-
if(CPU == 1) subset = INPUT.size();
128-
else if(INPUT.size() % CPU == 0) subset = INPUT.size() / CPU;
129+
if(CPU == 1) { subset = INPUT.size(); }
130+
else if(INPUT.size() % CPU == 0) { subset = INPUT.size() / CPU; }
129131
else {
130132
int remainder = INPUT.size() % CPU;
131133
if(x < remainder ) subset = (int)(((double)INPUT.size() / (double)CPU) + 1);
132134
else subset = (int)(((double)INPUT.size() / (double)CPU));
133135
}
136+
//System.out.println("CPU: " + x + "\tInterval: " + currentindex + "\t" + subset);
134137
PileupExtract extract = new PileupExtract(PARAM, BAM, INPUT, currentindex, subset);
135138
parseMaster.execute(extract);
136139
}

0 commit comments

Comments
 (0)