Sfoglia il codice sorgente

unified output file prefix

tags/v0.2.6
stead99 4 anni fa
parent
commit
691db991ce
4 ha cambiato i file con 22 aggiunte e 21 eliminazioni
  1. +6
    -6
      tasks/count.wdl
  2. +10
    -8
      tasks/fastp.wdl
  3. +5
    -5
      tasks/hisat2.wdl
  4. +1
    -2
      workflow.wdl

+ 6
- 6
tasks/count.wdl Vedi File

@@ -1,15 +1,15 @@
task count {
Array[File] ballgown
String sample_id
String base=basename(gene_abundance, ".gene.abundance.txt")
String docker
String cluster
String disk_size
Int count_length

command <<<
mkdir -p /cromwell_root/tmp/ballgown/${sample_id}
cp -r ${sep=" " ballgown} /cromwell_root/tmp/ballgown/${sample_id}
count -i /cromwell_root/tmp/ballgown -l ${count_length} -g ${sample_id}_gene_count_matrix.csv -t ${sample_id}_transcript_count_matrix.csv
mkdir -p /cromwell_root/tmp/ballgown/${base}
cp -r ${sep=" " ballgown} /cromwell_root/tmp/ballgown/${base}
count -i /cromwell_root/tmp/ballgown -l ${count_length} -g ${base}_gene_count_matrix.csv -t ${base}_transcript_count_matrix.csv
>>>
runtime {
@@ -20,7 +20,7 @@ task count {
}
output {
File mat_expression_genecount="${sample_id}_gene_count_matrix.csv"
File mat_expression_transcriptcount="${sample_id}_transcript_count_matrix.csv"
File mat_expression_genecount="${base}_gene_count_matrix.csv"
File mat_expression_transcriptcount="${base}_transcript_count_matrix.csv"
}
}

+ 10
- 8
tasks/fastp.wdl Vedi File

@@ -1,7 +1,9 @@
task fastp {
File read1
File read2
String sample_id
String read1name=sub(basename(read1),"\\.\\S+$", "")
String read2name=sub(basename(read2),"\\.\\S+$", "")
String sample_name=sub(basename(read1),"\\_*1.\\S+$", "")
String adapter_sequence
String adapter_sequence_r2
String docker
@@ -14,10 +16,10 @@ command <<<
## Trim
if [ "${trim_adapter}" != 'true' ]; then
cp ${read1} ${sample_id}_R1.fq.gz
cp ${read2} ${sample_id}_R2.fq.gz
cp ${read1} ${read1name}.fq.gz
cp ${read2} ${read2name}.fq.gz
else
fastp --thread $nt --adapter_sequence ${adapter_sequence} --adapter_sequence_r2 ${adapter_sequence_r2} --detect_adapter_for_pe -i ${read1} -I ${read2} -o ${sample_id}_R1.fq.gz -O ${sample_id}_R2.fq.gz -j ${sample_id}.json -h ${sample_id}.html
fastp --thread $nt --adapter_sequence ${adapter_sequence} --adapter_sequence_r2 ${adapter_sequence_r2} --detect_adapter_for_pe -i ${read1} -I ${read2} -o ${read1name}.fq.gz -O ${read2name}.fq.gz -j ${sample_name}.json -h ${sample_name}.html
fi
>>>
@@ -29,9 +31,9 @@ command <<<
}

output {
File json = "${sample_id}.json"
File report = "${sample_id}.html"
File trim_R1 = "${sample_id}_R1.fq.gz"
File trim_R2 = "${sample_id}_R2.fq.gz"
File json = "${sample_name}.json"
File report = "${sample_name}.html"
File trim_R1 = "${read1name}.fq.gz"
File trim_R2 = "${read2name}.fq.gz"
}
}

+ 5
- 5
tasks/hisat2.wdl Vedi File

@@ -2,8 +2,8 @@ task hisat2 {
File idx
File read_1P
File read_2P
String sample_name=sub(basename(read_1P),"\\_*1.\\S+$", "")
String idx_prefix
String sample_id
String docker
String cluster
String disk_size
@@ -11,7 +11,7 @@ task hisat2 {

command {
nt=$(nproc)
hisat2 -t -p $nt -x ${idx}/${idx_prefix} -1 ${read_1P} -2 ${read_2P} -S ${sample_id}.sam --un-conc-gz ${sample_id}_un.fq.gz
hisat2 -t -p $nt -x ${idx}/${idx_prefix} -1 ${read_1P} -2 ${read_2P} -S ${sample_name}.sam --un-conc-gz ${sample_name}_un.fq.gz
}
runtime {
@@ -22,8 +22,8 @@ task hisat2 {
}

output {
File sam=sample_id + ".sam"
File unmapread_1p=sample_id + "_un.fq.1.gz"
File unmapread_2p=sample_id + "_un.fq.2.gz"
File sam=sample_name + ".sam"
File unmapread_1p=sample_name + "_un.fq.1.gz"
File unmapread_2p=sample_name + "_un.fq.2.gz"
}
}

+ 1
- 2
workflow.wdl Vedi File

@@ -71,7 +71,6 @@ workflow {{ project_name }} {

call fastp.fastp as fastp {
input:
sample_id=sample_id,
read1=read1,
read2=read2,
docker=fastp_docker,
@@ -84,7 +83,6 @@ workflow {{ project_name }} {
call hisat2.hisat2 as hisat2 {
input:
sample_id=sample_id,
docker=hisat2_docker,
cluster=hisat2_cluster,
idx=idx,
@@ -138,6 +136,7 @@ workflow {{ project_name }} {
docker=count_docker,
cluster=count_cluster,
ballgown=stringtie.ballgown,
gene_abundance=stringtie.gene_abundance,
disk_size=disk_size,
count_length=count_length
}

Loading…
Annulla
Salva