Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P21 updatemapping #116

Merged
merged 2 commits into from
May 18, 2023
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
12 changes: 12 additions & 0 deletions peaseq-case.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,16 @@ workflow peaseq {
# Summary statistics on FASTQs
# Combine html files into one for easy viewing

call util.basicfastqstats as indv_R1_bfs {
input :
fastqfile=fastqpair.left,
default_location='SAMPLE/' + sub(basename(fastqpair.left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats'
}
call mapping.mapping as indv_PE_mapping {
input :
fastqfile=fastqpair.left,
fastqfile_R2=fastqpair.right,
metricsfile=indv_R1_bfs.metrics_out,
insert_size=insertsize,
strandedness=strandedness,
index_files=actual_bowtie_index,
Expand Down Expand Up @@ -526,10 +532,16 @@ workflow peaseq {
# Summary statistics on FASTQs
# Combine html files into one for easy viewing

call util.basicfastqstats as R1_bfs {
input :
fastqfile=sample_fastqfiles[0].left,
default_location=if defined(results_name) then results_name + '/BAM_files' else sub(basename(sample_fastqfiles[0].left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats'
}
call mapping.mapping as uno_PE_mapping {
input :
fastqfile=sample_fastqfiles[0].left,
fastqfile_R2=sample_fastqfiles[0].right,
metricsfile=R1_bfs.metrics_out,
insert_size=insertsize,
strandedness=strandedness,
index_files=actual_bowtie_index,
Expand Down
29 changes: 29 additions & 0 deletions peaseq-control.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,17 @@ workflow peaseq {
# Summary statistics on FASTQs
# Combine html files into one for easy viewing

call util.basicfastqstats as s_indv_R1_bfs {
input :
fastqfile=fastqpair.left,
default_location=if multi_fastqpair then 'SAMPLE/individual_fastqs/' + sub(basename(fastqpair.left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats' else 'SAMPLE/' + sub(basename(fastqpair.left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats'
}

call mapping.mapping as s_indv_PE_mapping {
input :
fastqfile=fastqpair.left,
fastqfile_R2=fastqpair.right,
metricsfile=s_indv_R1_bfs.metrics_out,
insert_size=insertsize,
strandedness=strandedness,
index_files=actual_bowtie_index,
Expand Down Expand Up @@ -702,10 +709,17 @@ workflow peaseq {
# Summary statistics on FASTQs
# Combine html files into one for easy viewing

call util.basicfastqstats as c_indv_R1_bfs {
input :
fastqfile=fastqpair.left,
default_location=if multi_fastqpair then 'CONTROL/individual_fastqs/' + sub(basename(fastqpair.left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats' else 'CONTROL/' + sub(basename(fastqpair.left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats'
}

call mapping.mapping as c_indv_PE_mapping {
input :
fastqfile=fastqpair.left,
fastqfile_R2=fastqpair.right,
metricsfile=c_indv_R1_bfs.metrics_out,
insert_size=insertsize,
strandedness=strandedness,
index_files=actual_bowtie_index,
Expand Down Expand Up @@ -845,10 +859,18 @@ workflow peaseq {
# Summary statistics on FASTQs
# Combine html files into one for easy viewing

call util.basicfastqstats as s_R1_bfs {
input :
fastqfile=sample_fastqfiles[0].left,
default_location=if multi_fastqpair then 'SAMPLE/individual_fastqs/' + sub(basename(sample_fastqfiles[0].left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats' else 'SAMPLE/' + sub(basename(sample_fastqfiles[0].left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats'

}

call mapping.mapping as s_uno_PE_mapping {
input :
fastqfile=sample_fastqfiles[0].left,
fastqfile_R2=sample_fastqfiles[0].right,
metricsfile=s_R1_bfs.metrics_out,
insert_size=insertsize,
strandedness=strandedness,
index_files=actual_bowtie_index,
Expand Down Expand Up @@ -883,10 +905,17 @@ workflow peaseq {
# Summary statistics on FASTQs
# Combine html files into one for easy viewing

call util.basicfastqstats as c_R1_bfs {
input :
fastqfile=control_fastqfiles[0].left,
default_location=if multi_control_fastqpair then 'CONTROL/individual_fastqs/' + sub(basename(control_fastqfiles[0].left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats' else 'CONTROL/' + sub(basename(control_fastqfiles[0].left),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','') + '/QC/SummaryStats'
}

call mapping.mapping as c_uno_PE_mapping {
input :
fastqfile=control_fastqfiles[0].left,
fastqfile_R2=control_fastqfiles[0].right,
metricsfile=c_R1_bfs.metrics_out,
insert_size=insertsize,
strandedness=strandedness,
index_files=actual_bowtie_index,
Expand Down
6 changes: 4 additions & 2 deletions workflows/tasks/bowtie.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ task bowtie {
Array[File]+ index_files
String? prefix
String outputfile = if (defined(prefix)) then select_first([prefix,basename(fastqfile)]) + '.sam' else if (defined(fastqfile_R2)) then sub(basename(fastqfile),'_R?[12]_....f.*q.gz|_R?[12].f.*q.gz','.sam') else sub(basename(fastqfile),'.fastq.gz|.fq.gz','.sam')

Int read_length = 75
Int insert_size = 600
Int limit_alignments = 2
Expand All @@ -29,15 +28,18 @@ task bowtie {

command <<<
if [ -f "~{metricsfile}" ]; then
readlength=$(tail -n 1 ~{metricsfile} | awk '{print $4}');
readlength=$(tail -n 1 ~{metricsfile} | awk '{print $1}');
if [ $readlength -lt 28 ]; then readlength=28; fi
echo "Metrics file with readlength " $readlength
else
readlength=~{read_length}
fi

echo $readlength
if [ -f "~{fastqfile_R2}" ]; then
bowtie \
--chunkmbs=256 \
-l $readlength \
-p ~{ncpu} \
-k ~{good_alignments} \
-m ~{limit_alignments} \
Expand Down
2 changes: 1 addition & 1 deletion workflows/tasks/macs.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ task macs {
File bamfile
File? control

Int memory_gb = 20
Int memory_gb = 25
Int max_retries = 1
Int ncpu = 1

Expand Down
2 changes: 1 addition & 1 deletion workflows/tasks/peaseq_util.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ task fraggraph {
String bam_location = "BAM_files"
String annotation_location = "Annotation"

Int memory_gb = 50
Int memory_gb = 75
Int max_retries = 1
Int ncpu = 1
}
Expand Down
2 changes: 1 addition & 1 deletion workflows/tasks/sortbed.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ task sortbed {

String outputfile = basename(bedfile,'.bed')+ '.sorted.bed'

Int memory_gb = 20
Int memory_gb = 30
Int max_retries = 1
Int ncpu = 1
}
Expand Down
3 changes: 2 additions & 1 deletion workflows/workflows/mapping.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ workflow mapping {
String? results_name
}

if ( defined(metricsfile) ) {
if (! defined(fastqfile_R2) ) {
call bowtie.bowtie as SE_map {
input :
fastqfile=fastqfile,
Expand All @@ -35,6 +35,7 @@ workflow mapping {
input :
fastqfile=fastqfile,
fastqfile_R2=fastqfile_R2,
metricsfile=metricsfile,
index_files=index_files,
insert_size=insert_size,
strandedness=strandedness,
Expand Down