Merge branch 'fusions' into 'dev'
Fusions See merge request epi2melabs/workflow-containers/wf-transcriptomes!64
This commit is contained in:
commit
66a2b3aae0
@ -138,7 +138,7 @@ do:
|
|||||||
```shell
|
```shell
|
||||||
mkdir jaffal_data_dir
|
mkdir jaffal_data_dir
|
||||||
cd jaffal_data_dir/
|
cd jaffal_data_dir/
|
||||||
wf-transcriptomes/download_jaffal_references.sh
|
wf-transcriptomes/subworkflows/JAFFAL/load_jaffal_references.sh
|
||||||
````
|
````
|
||||||
|
|
||||||
To use alternative genome and annotation files, they should be prepared as described
|
To use alternative genome and annotation files, they should be prepared as described
|
||||||
@ -147,7 +147,7 @@ To use alternative genome and annotation files, they should be prepared as descr
|
|||||||
**Specifying the location of the JAFFA code and reference directories**
|
**Specifying the location of the JAFFA code and reference directories**
|
||||||
|
|
||||||
`--jaffal_dir`
|
`--jaffal_dir`
|
||||||
This is the directory made by running install_jaffa.sh as shown above
|
Full path to the directory made by running install_jaffa.sh as shown above. eg: /home/wf-trnascriptomes/JAFFA
|
||||||
|
|
||||||
`--jaffal_refBase`
|
`--jaffal_refBase`
|
||||||
The directory containing the reference data prepared for use with JAFFAL
|
The directory containing the reference data prepared for use with JAFFAL
|
||||||
|
|||||||
@ -798,20 +798,16 @@ def seq_stats_tabs(report, sample_ids, stats):
|
|||||||
section.plot(Tabs(tabs=tabs))
|
section.plot(Tabs(tabs=tabs))
|
||||||
|
|
||||||
|
|
||||||
def jaffal_table(report, sample_ids, result_csvs):
|
def jaffal_table(report, result_csv):
|
||||||
"""Make a table of fusion transcripts identified by JAFFAL."""
|
"""Make a table of fusion transcripts identified by JAFFAL."""
|
||||||
cols = [
|
cols = [
|
||||||
'sample_id', 'fusion genes', 'chrom1', 'chrom2', 'spanning reads',
|
'sample_id', 'fusion genes', 'chrom1', 'chrom2', 'spanning reads',
|
||||||
'classification', 'known']
|
'classification', 'known']
|
||||||
dfs = []
|
|
||||||
for csv, sid in zip(result_csvs, sample_ids):
|
|
||||||
df = pd.read_csv(csv)
|
|
||||||
df['sample_id'] = sid
|
|
||||||
sid_col = df.pop('sample_id')
|
|
||||||
df.insert(0, 'sample_id', sid_col)
|
|
||||||
dfs.append(df)
|
|
||||||
|
|
||||||
df = pd.concat(dfs)
|
df = pd.read_csv(result_csv)
|
||||||
|
sid_col = df.pop('sample_id')
|
||||||
|
df.insert(0, 'sample_id', sid_col)
|
||||||
|
|
||||||
df = df[cols]
|
df = df[cols]
|
||||||
df['chroms'] = df.chrom1.astype(str) + ':' + df.chrom2.astype(str)
|
df['chroms'] = df.chrom1.astype(str) + ':' + df.chrom2.astype(str)
|
||||||
df.rename(columns={
|
df.rename(columns={
|
||||||
@ -874,7 +870,7 @@ def main():
|
|||||||
"--cluster_qc_dirs", required=False, type=str, default=None, nargs='*',
|
"--cluster_qc_dirs", required=False, type=str, default=None, nargs='*',
|
||||||
help="Directory with various cluster quality csvs")
|
help="Directory with various cluster quality csvs")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--jaffal_csv", required=False, type=str, default=None, nargs='*',
|
"--jaffal_csv", required=False, type=str, default=None,
|
||||||
help="Path to JAFFAL results csv")
|
help="Path to JAFFAL results csv")
|
||||||
parser.add_argument('--denovo', dest='denovo', action='store_true')
|
parser.add_argument('--denovo', dest='denovo', action='store_true')
|
||||||
|
|
||||||
@ -921,8 +917,8 @@ def main():
|
|||||||
if args.cluster_qc_dirs is not None:
|
if args.cluster_qc_dirs is not None:
|
||||||
cluster_quality(args.cluster_qc_dirs, report, sample_ids)
|
cluster_quality(args.cluster_qc_dirs, report, sample_ids)
|
||||||
|
|
||||||
if args.jaffal_csv is not None:
|
if args.jaffal_csv:
|
||||||
jaffal_table(report, sample_ids, args.jaffal_csv)
|
jaffal_table(report, args.jaffal_csv)
|
||||||
|
|
||||||
# Arguments and software versions
|
# Arguments and software versions
|
||||||
report.add_section(
|
report.add_section(
|
||||||
|
|||||||
@ -90,7 +90,7 @@ do:
|
|||||||
```shell
|
```shell
|
||||||
mkdir jaffal_data_dir
|
mkdir jaffal_data_dir
|
||||||
cd jaffal_data_dir/
|
cd jaffal_data_dir/
|
||||||
wf-transcriptomes/download_jaffal_references.sh
|
wf-transcriptomes/subworkflows/JAFFAL/load_jaffal_references.sh
|
||||||
````
|
````
|
||||||
|
|
||||||
To use alternative genome and annotation files, they should be prepared as described
|
To use alternative genome and annotation files, they should be prepared as described
|
||||||
@ -99,7 +99,7 @@ To use alternative genome and annotation files, they should be prepared as descr
|
|||||||
**Specifying the location of the JAFFA code and reference directories**
|
**Specifying the location of the JAFFA code and reference directories**
|
||||||
|
|
||||||
`--jaffal_dir`
|
`--jaffal_dir`
|
||||||
This is the directory made by running install_jaffa.sh as shown above
|
Full path to the directory made by running install_jaffa.sh as shown above. eg: /home/wf-trnascriptomes/JAFFA
|
||||||
|
|
||||||
`--jaffal_refBase`
|
`--jaffal_refBase`
|
||||||
The directory containing the reference data prepared for use with JAFFAL
|
The directory containing the reference data prepared for use with JAFFAL
|
||||||
|
|||||||
13
main.nf
13
main.nf
@ -282,12 +282,12 @@ process makeReport {
|
|||||||
path "params.json"
|
path "params.json"
|
||||||
val denovo
|
val denovo
|
||||||
path pychopper_report
|
path pychopper_report
|
||||||
|
path jaffal_csv
|
||||||
tuple val(sample_ids),
|
tuple val(sample_ids),
|
||||||
path(seq_summaries),
|
path(seq_summaries),
|
||||||
path(aln_stats),
|
path(aln_stats),
|
||||||
path(gffcmp_dir),
|
path(gffcmp_dir),
|
||||||
path(gff_annotation),
|
path(gff_annotation)
|
||||||
path(jaffal_csv)
|
|
||||||
output:
|
output:
|
||||||
path("wf-transcriptomes-*.html"), emit: report
|
path("wf-transcriptomes-*.html"), emit: report
|
||||||
script:
|
script:
|
||||||
@ -297,6 +297,8 @@ process makeReport {
|
|||||||
def OPT_ALN = denovo ? '' : "--alignment_stats ${aln_stats}"
|
def OPT_ALN = denovo ? '' : "--alignment_stats ${aln_stats}"
|
||||||
def OPT_DENOVO = denovo ? "--denovo" : ''
|
def OPT_DENOVO = denovo ? "--denovo" : ''
|
||||||
def OPT_PC_REPORT = pychopper_report.name.startsWith('OPTIONAL_FILE') ? '' : "--pychop_report ${pychopper_report}"
|
def OPT_PC_REPORT = pychopper_report.name.startsWith('OPTIONAL_FILE') ? '' : "--pychop_report ${pychopper_report}"
|
||||||
|
def OPT_JAFFAL_CSV = jaffal_csv.name.startsWith('OPTIONAL_FILE') ? '' : "--jaffal_csv ${jaffal_csv}"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
report.py --report $report_name \
|
report.py --report $report_name \
|
||||||
--versions $versions \
|
--versions $versions \
|
||||||
@ -308,7 +310,7 @@ process makeReport {
|
|||||||
--gffcompare_dir $gffcmp_dir \
|
--gffcompare_dir $gffcmp_dir \
|
||||||
--gff_annotation $gff_annotation \
|
--gff_annotation $gff_annotation \
|
||||||
--transcript_table_cov_thresh $params.transcript_table_cov_thresh \
|
--transcript_table_cov_thresh $params.transcript_table_cov_thresh \
|
||||||
--jaffal_csv $jaffal_csv
|
$OPT_JAFFAL_CSV \
|
||||||
$OPT_DENOVO
|
$OPT_DENOVO
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
@ -408,6 +410,9 @@ workflow pipeline {
|
|||||||
|
|
||||||
if (jaffal_refBase){
|
if (jaffal_refBase){
|
||||||
gene_fusions(full_len_reads, jaffal_refBase, jaffal_genome, jaffal_annotation)
|
gene_fusions(full_len_reads, jaffal_refBase, jaffal_genome, jaffal_annotation)
|
||||||
|
jaffal_out = gene_fusions.out.results_csv.collectFile(keepHeader: true, name: 'jaffal.csv')
|
||||||
|
}else{
|
||||||
|
jaffal_out = file("$projectDir/data/OPTIONAL_FILE_1")
|
||||||
}
|
}
|
||||||
|
|
||||||
makeReport(
|
makeReport(
|
||||||
@ -415,11 +420,11 @@ workflow pipeline {
|
|||||||
workflow_params,
|
workflow_params,
|
||||||
params.denovo,
|
params.denovo,
|
||||||
pychopper_report,
|
pychopper_report,
|
||||||
|
jaffal_out,
|
||||||
summariseConcatReads.out.summary
|
summariseConcatReads.out.summary
|
||||||
.join(m.stats)
|
.join(m.stats)
|
||||||
.join(run_gffcompare.out.gffcmp_dir)
|
.join(run_gffcompare.out.gffcmp_dir)
|
||||||
.join(merge_gff_bundles.out.gff)
|
.join(merge_gff_bundles.out.gff)
|
||||||
.join(gene_fusions.out.results_csv)
|
|
||||||
.toList().transpose().toList())
|
.toList().transpose().toList())
|
||||||
|
|
||||||
report = makeReport.out.report
|
report = makeReport.out.report
|
||||||
|
|||||||
5
subworkflows/JAFFAL/download_jaffal_references.sh
Normal file
5
subworkflows/JAFFAL/download_jaffal_references.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#Download the data. We should we move the data out of Figshare?
|
||||||
|
wget -O JAFFA_REFERENCE_FILES_HG38_GENCODE22.V2.tar.gz https://figshare.com/ndownloader/files/25410494
|
||||||
|
tar -zxvf JAFFA_REFERENCE_FILES_HG38_GENCODE22.V2.tar.gz
|
||||||
@ -22,6 +22,12 @@ process jaffal{
|
|||||||
$params.jaffal_dir/JAFFAL.groovy \
|
$params.jaffal_dir/JAFFAL.groovy \
|
||||||
$fastq
|
$fastq
|
||||||
mv "\$JAFFAOUT/jaffa_results.csv" "\$JAFFAOUT/${sample_id}_jaffa_results.csv"
|
mv "\$JAFFAOUT/jaffa_results.csv" "\$JAFFAOUT/${sample_id}_jaffa_results.csv"
|
||||||
|
|
||||||
|
# Add sample id column
|
||||||
|
sed "s/\$/,${sample_id}/" \$JAFFAOUT/${sample_id}_jaffa_results.csv > tmp1
|
||||||
|
# Add header
|
||||||
|
sed "1 s/${sample_id}/sample_id/" tmp1 > tmp2
|
||||||
|
mv tmp2 \$JAFFAOUT/${sample_id}_jaffa_results.csv
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user