Skip to content

Commit

Permalink
fix for no_dup_removal issue
Browse files Browse the repository at this point in the history
  • Loading branch information
leepc12 committed Aug 3, 2017
1 parent c817365 commit fe55069
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 30 deletions.
62 changes: 34 additions & 28 deletions chipseq.bds
Original file line number Diff line number Diff line change
Expand Up @@ -450,23 +450,25 @@ void align_SE( int ctl, int rep, int nth_rep ) {
if ( is_final_stage_bam() ) return

if ( no_dup_removal ) {
( filt_bam_, flagstat_nodup_qc_, pbc_qc_ ) \
string tmp
( filt_bam_, tmp ) \
= dedup_bam( bam_, aln_o_dir, qc_o_dir, group, nth_rep )
wait
}
else {
( filt_bam_, dup_qc_, flagstat_nodup_qc_, pbc_qc_ ) \
= dedup_bam( bam_, aln_o_dir, qc_o_dir, group, nth_rep )
dup_qc{group} = dup_qc_
add_file_to_table( dup_qc_, "QC and logs/$long/Dedup. log")
pbc_qc{group} = pbc_qc_
add_file_to_table( pbc_qc_, "QC and logs/$long/PBC log")
flagstat_nodup_qc{group} = flagstat_nodup_qc_
add_file_to_table( flagstat_nodup_qc_, "QC and logs/$long/Filtered flagstat log")
wait
// add to report
tmp_log := parse_flagstat( flagstat_nodup_qc_ )
deduped_reads = metric_prefix( parse_int( tmp_log{"total"} ) )
}
pbc_qc{group} = pbc_qc_
add_file_to_table( pbc_qc_, "QC and logs/$long/PBC log")
flagstat_nodup_qc{group} = flagstat_nodup_qc_
add_file_to_table( flagstat_nodup_qc_, "QC and logs/$long/Filtered flagstat log")
wait
// add to report
tmp_log := parse_flagstat( flagstat_nodup_qc_ )
deduped_reads = metric_prefix( parse_int( tmp_log{"total"} ) )
}

string tag_
Expand Down Expand Up @@ -636,23 +638,25 @@ void align_PE( int ctl, int rep, int nth_rep ) {
if ( is_final_stage_bam() ) return

if ( no_dup_removal ) {
( filt_bam_, flagstat_nodup_qc_, pbc_qc_ ) \
string tmp
( filt_bam_, tmp ) \
= dedup_bam_PE( bam_, aln_o_dir, qc_o_dir, group, nth_rep )
wait
}
else {
( filt_bam_, dup_qc_, flagstat_nodup_qc_, pbc_qc_ ) \
= dedup_bam_PE( bam_, aln_o_dir, qc_o_dir, group, nth_rep )
dup_qc{group} = dup_qc_
add_file_to_table( dup_qc_, "QC and logs/$long/Dedup. log")
pbc_qc{group} = pbc_qc_
add_file_to_table( pbc_qc_, "QC and logs/$long/PBC log")
flagstat_nodup_qc{group} = flagstat_nodup_qc_
add_file_to_table( flagstat_nodup_qc_, "QC and logs/$long/Filtered flagstat log")
wait
// add to report
tmp_log := parse_flagstat( flagstat_nodup_qc_ )
deduped_reads = metric_prefix( parse_int( tmp_log{"total"} ) )
}
pbc_qc{group} = pbc_qc_
add_file_to_table( pbc_qc_, "QC and logs/$long/PBC log")
flagstat_nodup_qc{group} = flagstat_nodup_qc_
add_file_to_table( flagstat_nodup_qc_, "QC and logs/$long/Filtered flagstat log")
wait
// add to report
tmp_log := parse_flagstat( flagstat_nodup_qc_ )
deduped_reads = metric_prefix( parse_int( tmp_log{"total"} ) )
}

string tag_, bedpe
Expand Down Expand Up @@ -1643,16 +1647,18 @@ string html_chipseq_QC() {
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Flagstat (raw) QC", false, "flagstat", groups, flagstat_qcs )
html += "</div>"
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Flagstat (filtered) QC", false, "flagstat_filt", groups, flagstat_nodup_qcs )
html += "</div>"
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Dup. QC", false, "dup", groups, dup_qcs )
html += "</div>"
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Library Complexity QC", false, has_pe() ? "pbc_PE" : "pbc", groups, pbc_qcs )
if ( pbc_qcs.size()>0 ) html += html_help_pbc()
html += "</div>"
if ( !no_dup_removal ) {
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Flagstat (filtered) QC", false, "flagstat_filt", groups, flagstat_nodup_qcs )
html += "</div>"
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Dup. QC", false, "dup", groups, dup_qcs )
html += "</div>"
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Library Complexity QC", false, has_pe() ? "pbc_PE" : "pbc", groups, pbc_qcs )
if ( pbc_qcs.size()>0 ) html += html_help_pbc()
html += "</div>"
}
html += "<div style='float:left'>"
html += html_table_multiple_logs( "Enrichment QC (strand cross-correlation measures)", false, "xcor", groups, xcor_qcs )
if ( xcor_qcs.size()>0 ) html += html_help_xcor( subsample_xcor, has_se(), has_pe() )
Expand Down
4 changes: 2 additions & 2 deletions modules/postalign_bam.bds
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ string[] dedup_bam( string bam, string o_dir, string log_o_dir, string group, in
filt_bam := "$prefix.filt.bam"

in := [ bam ]
out := no_dup_removal ? [filt_bam, map_qc, pbc_qc ] : [ nodup_bam, dup_qc, map_qc, pbc_qc ]
out := no_dup_removal ? [ filt_bam ] : [ nodup_bam, dup_qc, map_qc, pbc_qc ]

cpus := (nth_dedup==1) ? -1 : nth_dedup; mem := get_res_mem(mem_dedup,nth_dedup); timeout := get_res_wt(wt_dedup)

Expand Down Expand Up @@ -242,7 +242,7 @@ string[] dedup_bam_PE( string bam, string o_dir, string log_o_dir, string group,
filt_bam := "$prefix.filt.bam"
in := [ bam ]
out := no_dup_removal ? [ filt_bam, map_qc, pbc_qc ] : [ nodup_bam, dup_qc, map_qc, pbc_qc ]
out := no_dup_removal ? [ filt_bam ] : [ nodup_bam, dup_qc, map_qc, pbc_qc ]
cpus := (nth_dedup==1) ? -1 : nth_dedup; mem := get_res_mem(mem_dedup,nth_dedup); timeout := get_res_wt(wt_dedup)
Expand Down

0 comments on commit fe55069

Please sign in to comment.