@@ -0,0 +1,13 @@ | |||
{ | |||
"idx": "oss://pgx-reference-data/reference/hisat2/grch38_snp_tran/", | |||
"gtf": "oss://pgx-reference-data/reference/tophat2/annotation/gencode.v22.annotation.gtf", | |||
"idx_prefix": "genome_snp_tran", | |||
"hisat2_docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/hisat2:v2.1.0-2", | |||
"hisat2_cluster": "OnDemand bcs.a2.3xlarge img-ubuntu-vpc", | |||
"samtools_docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/samtools:v1.3.1", | |||
"samtools_cluster": "OnDemand bcs.a2.large img-ubuntu-vpc", | |||
"stringtie_docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/stringtie:v1.3.4", | |||
"stringtie_cluster": "OnDemand bcs.a2.large img-ubuntu-vpc", | |||
"ballgown_docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/pgx-ballgown:0.0.1", | |||
"ballgown_cluster": "OnDemand bcs.a2.large img-ubuntu-vpc", | |||
} |
@@ -0,0 +1,15 @@ | |||
{ | |||
"{{ project_name }}.read1": "{{ read1 }}", | |||
"{{ project_name }}.read2": "{{ read2 }}", | |||
"{{ project_name }}.idx": "{{ idx }}", | |||
"{{ project_name }}.gtf": "{{ gtf }}", | |||
"{{ project_name }}.idx_prefix": "{{ idx_prefix }}", | |||
"{{ project_name }}.hisat2.docker": "{{ hisat2_docker }}", | |||
"{{ project_name }}.hisat2.cluster": "{{ hisat2_cluster }}", | |||
"{{ project_name }}.samtools.docker": "{{ samtools_docker }}", | |||
"{{ project_name }}.samtools.cluster": "{{ samtools_cluster }}", | |||
"{{ project_name }}.stringtie.docker": "{{ stringtie_docker }}", | |||
"{{ project_name }}.stringtie.cluster": "{{ stringtie_cluster }}" | |||
"{{ project_name }}.ballgown.docker": "{{ ballgown_docker }}", | |||
"{{ project_name }}.ballgown.cluster": "{{ ballgown_cluster }}" | |||
} |
@@ -0,0 +1,23 @@ | |||
> Author: Jun Shang | |||
> | |||
> Email: shangjunv@163.com | |||
> | |||
> Last Updates: 25/02/2020 | |||
#### Requirements | |||
- choppy | |||
- Ali-Cloud | |||
``` | |||
$ source activate choppy/open-choppy-env | |||
$ choppy install junshang/rna-seq-pair-end-viral | |||
$ choppy apps | |||
``` | |||
#### quick start | |||
``` | |||
$ choppy samples junshang/rna-seq-pair-end-viral-latest > samples.csv | |||
$ choppy batch junshang/rna-seq-pair-end-viral-latest samples.csv -p Your_project_name | |||
``` |
@@ -0,0 +1,24 @@ | |||
task ballgown { | |||
File ballgown | |||
File gene_abundance | |||
String base = basename(gene_abundance, ".gene.abundance.txt") | |||
String docker | |||
String cluster | |||
command <<< | |||
mkdir /cromwell_root/tmp/ | |||
cp -r ${ballgown} /cromwell_root/tmp/ | |||
Rscript /usr/bin/ballgown.R /cromwell_root/tmp/ballgown/ ${base}.txt | |||
>>> | |||
runtime { | |||
docker: docker | |||
cluster: cluster | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd 150 /cromwell_root/" | |||
} | |||
output { | |||
File mat_expression = "${base}.txt" | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
task hisat2 { | |||
File idx | |||
File read_1P | |||
File read_2P | |||
String idx_prefix | |||
String base = sub(basename(read_1P),"\\.\\S+$", "") | |||
String docker | |||
String cluster | |||
command { | |||
nt=$(nproc) | |||
hisat2 -t -p $nt -x ${idx}/${idx_prefix} -1 ${read_1P} -2 ${read_2P} -S ${base}.sam --un-conc-gz ${base}_un.fq.gz | |||
} | |||
runtime { | |||
docker: docker | |||
cluster: cluster | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd 200 /cromwell_root/" | |||
} | |||
output { | |||
File sam = base + ".sam" | |||
File unmapread_1p = base + "_un.fq.1.gz" | |||
File unmapread_2p = base + "_un.fq.2.gz" | |||
} | |||
} |
@@ -0,0 +1,34 @@ | |||
task samtools { | |||
File sam | |||
String base = basename(sam, ".sam") | |||
String bam = base + ".bam" | |||
String sorted_bam = base + ".sorted.bam" | |||
String sorted_bam_index = base + ".sorted.bam.bai" | |||
String viral_samstats = base + ".viral.samstats" | |||
String docker | |||
String cluster | |||
command <<< | |||
set -o pipefail | |||
set -e | |||
/opt/conda/bin/samtools view -bS ${sam} > ${bam} | |||
/opt/conda/bin/samtools sort -m 1000000000 ${bam} -o ${sorted_bam} | |||
/opt/conda/bin/samtools index ${sorted_bam} | |||
/opt/conda/bin/samtools stats ${sorted_bam} > ${viral_samstats} | |||
>>> | |||
runtime { | |||
docker: docker | |||
cluster: cluster | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd 200 /cromwell_root/" | |||
} | |||
output { | |||
File out_bam = sorted_bam | |||
File out_bam_index = sorted_bam_index | |||
File out_viral_samstats = viral_samstats | |||
} | |||
} | |||
@@ -0,0 +1,26 @@ | |||
task stringtie { | |||
File bam | |||
File gtf | |||
String docker | |||
String base = basename(bam, ".sorted.bam") | |||
String cluster | |||
command <<< | |||
nt=$(nproc) | |||
mkdir ballgown | |||
/opt/conda/bin/stringtie -e -B -p $nt -G ${gtf} -o ballgown/${base}/${base}.gtf -C ${base}.cov.ref.gtf -A ${base}.gene.abundance.txt ${bam} | |||
>>> | |||
runtime { | |||
docker: docker | |||
cluster: cluster | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd 150 /cromwell_root/" | |||
} | |||
output { | |||
File covered_transcripts = "${base}.cov.ref.gtf" | |||
File gene_abundance = "${base}.gene.abundance.txt" | |||
Array[File] ballgown = ["ballgown/${base}/${base}.gtf", "ballgown/${base}/e2t.ctab", "ballgown/${base}/e_data.ctab", "ballgown/${base}/i2t.ctab", "ballgown/${base}/i_data.ctab", "ballgown/${base}/t_data.ctab"] | |||
} | |||
} |
@@ -0,0 +1,35 @@ | |||
import "./tasks/hisat2.wdl" as hisat2 | |||
import "./tasks/samtools.wdl" as samtools | |||
import "./tasks/stringtie.wdl" as stringtie | |||
import "./tasks/ballgown.wdl" as ballgown | |||
workflow {{ project_name }} { | |||
File read1 | |||
File read2 | |||
File idx | |||
String idx_prefix | |||
File gtf | |||
call hisat2.hisat2 as hisat2 { | |||
input: idx=idx, idx_prefix=idx_prefix, read_1P=read1, read_2P=read2 | |||
} | |||
all samtools.samtools as samtools { | |||
input: sam = hisat2.sam | |||
} | |||
call stringtie.stringtie as stringtie { | |||
input: gtf = gtf, bam = samtools.out_bam | |||
} | |||
call ballgown.ballgown as ballgown { | |||
input: ballgown = stringtie.ballgown | |||
} | |||
} | |||