This commit is contained in:
Neil Horner 2022-08-01 19:07:20 +00:00
parent 3614a1158a
commit e63cc73b6c
6 changed files with 32 additions and 20 deletions

View File

@ -138,7 +138,7 @@ do:
```shell
mkdir 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
@ -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**
`--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`
The directory containing the reference data prepared for use with JAFFAL

View File

@ -798,20 +798,16 @@ def seq_stats_tabs(report, sample_ids, stats):
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."""
cols = [
'sample_id', 'fusion genes', 'chrom1', 'chrom2', 'spanning reads',
'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['chroms'] = df.chrom1.astype(str) + ':' + df.chrom2.astype(str)
df.rename(columns={
@ -874,7 +870,7 @@ def main():
"--cluster_qc_dirs", required=False, type=str, default=None, nargs='*',
help="Directory with various cluster quality csvs")
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")
parser.add_argument('--denovo', dest='denovo', action='store_true')
@ -921,8 +917,8 @@ def main():
if args.cluster_qc_dirs is not None:
cluster_quality(args.cluster_qc_dirs, report, sample_ids)
if args.jaffal_csv is not None:
jaffal_table(report, sample_ids, args.jaffal_csv)
if args.jaffal_csv:
jaffal_table(report, args.jaffal_csv)
# Arguments and software versions
report.add_section(

View File

@ -90,7 +90,7 @@ do:
```shell
mkdir 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
@ -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**
`--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`
The directory containing the reference data prepared for use with JAFFAL

13
main.nf
View File

@ -282,12 +282,12 @@ process makeReport {
path "params.json"
val denovo
path pychopper_report
path jaffal_csv
tuple val(sample_ids),
path(seq_summaries),
path(aln_stats),
path(gffcmp_dir),
path(gff_annotation),
path(jaffal_csv)
path(gff_annotation)
output:
path("wf-transcriptomes-*.html"), emit: report
script:
@ -297,6 +297,8 @@ process makeReport {
def OPT_ALN = denovo ? '' : "--alignment_stats ${aln_stats}"
def OPT_DENOVO = denovo ? "--denovo" : ''
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 \
--versions $versions \
@ -308,7 +310,7 @@ process makeReport {
--gffcompare_dir $gffcmp_dir \
--gff_annotation $gff_annotation \
--transcript_table_cov_thresh $params.transcript_table_cov_thresh \
--jaffal_csv $jaffal_csv
$OPT_JAFFAL_CSV \
$OPT_DENOVO
"""
}
@ -408,6 +410,9 @@ workflow pipeline {
if (jaffal_refBase){
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(
@ -415,11 +420,11 @@ workflow pipeline {
workflow_params,
params.denovo,
pychopper_report,
jaffal_out,
summariseConcatReads.out.summary
.join(m.stats)
.join(run_gffcompare.out.gffcmp_dir)
.join(merge_gff_bundles.out.gff)
.join(gene_fusions.out.results_csv)
.toList().transpose().toList())
report = makeReport.out.report

View 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

View File

@ -22,6 +22,12 @@ process jaffal{
$params.jaffal_dir/JAFFAL.groovy \
$fastq
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
"""
}