Publish isoforms table
This commit is contained in:
parent
84dbafd1c9
commit
fdb938a147
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- `de_analysis/all_counts_filtered.tsv` to `de_analysis/filtered_transcript_counts_with_genes.tsv`
|
- `de_analysis/all_counts_filtered.tsv` to `de_analysis/filtered_transcript_counts_with_genes.tsv`
|
||||||
- `de_analysis/de_tpm_transcript_counts.tsv` to `de_analysis/unfiltered_tpm_transcript_counts.tsv`
|
- `de_analysis/de_tpm_transcript_counts.tsv` to `de_analysis/unfiltered_tpm_transcript_counts.tsv`
|
||||||
### Added
|
### Added
|
||||||
|
- Published isoforms table to output directory.
|
||||||
- Output additional `de_analysis/cpm_gene_counts.tsv` with counts per million gene counts.
|
- Output additional `de_analysis/cpm_gene_counts.tsv` with counts per million gene counts.
|
||||||
- Output additional `de_analysis/unfiltered_transcript_counts_with_genes.tsv` with unfiltered transcript counts with associated gene IDs.
|
- Output additional `de_analysis/unfiltered_transcript_counts_with_genes.tsv` with unfiltered transcript counts with associated gene IDs.
|
||||||
- Add gene name column to the de_analysis counts TSV files.
|
- Add gene name column to the de_analysis counts TSV files.
|
||||||
|
|||||||
31
README.md
31
README.md
@ -201,21 +201,22 @@ Output files may be aggregated including information for all samples or provided
|
|||||||
| Annotated assembled transcriptome | {{ alias }}_merged_transcriptome.fas | Per sample annotated assembled transcriptome. | per-sample |
|
| Annotated assembled transcriptome | {{ alias }}_merged_transcriptome.fas | Per sample annotated assembled transcriptome. | per-sample |
|
||||||
| Alignment summary statistics | {{ alias }}_read_aln_stats.tsv | Per sample alignment summary statistics. | per-sample |
|
| Alignment summary statistics | {{ alias }}_read_aln_stats.tsv | Per sample alignment summary statistics. | per-sample |
|
||||||
| GFF compare results. | {{ alias }}_gffcompare | All GFF compare output files. | per-sample |
|
| GFF compare results. | {{ alias }}_gffcompare | All GFF compare output files. | per-sample |
|
||||||
| Differential gene expression results | /de_analysis/results_dge.tsv | This is a gene-level result file that describes genes and their probability of showing differential expression between experimental conditions. | aggregated |
|
| Differential gene expression results | de_analysis/results_dge.tsv | This is a gene-level result file that describes genes and their probability of showing differential expression between experimental conditions. | aggregated |
|
||||||
| Differential gene expression report | /de_analysis/results_dge.pdf | Summary report of differential gene expression analysis as a PDF. | aggregated |
|
| Differential gene expression report | de_analysis/results_dge.pdf | Summary report of differential gene expression analysis as a PDF. | aggregated |
|
||||||
| Differential transcript usage gene TSV | /de_analysis/results_dtu_gene.tsv | This is a gene-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
| Differential transcript usage gene TSV | de_analysis/results_dtu_gene.tsv | This is a gene-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
||||||
| Differential transcript usage report | /de_analysis/results_dtu.pdf | Summary report of differential transcript usage results as a PDF. | aggregated |
|
| Differential transcript usage report | de_analysis/results_dtu.pdf | Summary report of differential transcript usage results as a PDF. | aggregated |
|
||||||
| Differential transcript usage TSV | /de_analysis/results_dtu_transcript.tsv | This is a transcript-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
| Differential transcript usage TSV | de_analysis/results_dtu_transcript.tsv | This is a transcript-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
||||||
| Differential transcript usage stageR TSV | /de_analysis/results_dtu_stageR.tsv | This is the output from StageR and it shows both gene and transcript probabilities of differential expression | aggregated |
|
| Differential transcript usage stageR TSV | de_analysis/results_dtu_stageR.tsv | This is the output from StageR and it shows both gene and transcript probabilities of differential expression | aggregated |
|
||||||
| Differential transcript usage DEXSeq TSV | /de_analysis/results_dexseq.tsv | The complete output from the DEXSeq-analysis, shows both gene and transcript probabilities of differential expression. | aggregated |
|
| Differential transcript usage DEXSeq TSV | de_analysis/results_dexseq.tsv | The complete output from the DEXSeq-analysis, shows both gene and transcript probabilities of differential expression. | aggregated |
|
||||||
| Gene counts | /de_analysis/all_gene_counts.tsv | Raw gene counts created by the Salmon tool, before filtering. | aggregated |
|
| Gene counts | de_analysis/all_gene_counts.tsv | Raw gene counts created by the Salmon tool, before filtering. | aggregated |
|
||||||
| Gene counts per million | /de_analysis/cpm_gene_counts.tsv | This file shows counts per million (CPM) of the raw gene counts to facilitate comparisons across samples. | aggregated |
|
| Gene counts per million | de_analysis/cpm_gene_counts.tsv | This file shows counts per million (CPM) of the raw gene counts to facilitate comparisons across samples. | aggregated |
|
||||||
| Transcript counts | /de_analysis/unfiltered_transcript_counts_with_genes.tsv | Raw transcript counts created by the Salmon tool, before filtering. Includes reference to the associated gene ID. | aggregated |
|
| Transcript counts | de_analysis/unfiltered_transcript_counts_with_genes.tsv | Raw transcript counts created by the Salmon tool, before filtering. Includes reference to the associated gene ID. | aggregated |
|
||||||
| Transcript per million counts | /de_analysis/unfiltered_tpm_transcript_counts.tsv | This file shows transcripts per million (TPM) of the raw counts to facilitate comparisons across samples. | aggregated |
|
| Transcript per million counts | de_analysis/unfiltered_tpm_transcript_counts.tsv | This file shows transcripts per million (TPM) of the raw counts to facilitate comparisons across samples. | aggregated |
|
||||||
| Transcript counts filtered | /de_analysis/filtered_transcript_counts_with_genes.tsv | Filtered transcript counts, used for differential transcript usage analysis. Includes a reference to the associated gene ID. | aggregated |
|
| Transcript counts filtered | de_analysis/filtered_transcript_counts_with_genes.tsv | Filtered transcript counts, used for differential transcript usage analysis. Includes a reference to the associated gene ID. | aggregated |
|
||||||
| Final non redundant transcriptome | /de_analysis/final_non_redundant_transcriptome.fasta | Transcripts that were used for differential expression analysis including novel transcripts with the identifiers used for DE analysis. | aggregated |
|
| Transcript info table | {{ alias }}_transcripts_table.tsv | This file details each isoform that was reconstructed from the input reads. It contains a subset of columns from the .tmap output from [gffcompare](https://ccb.jhu.edu/software/stringtie/gffcompare.shtml) | per-sample |
|
||||||
| Fusion transcript sequences | /jaffal_output_{{ alias }}/jaffa_results.fasta | Fusion transcript sequences output by Jaffa. | per-sample |
|
| Final non redundant transcriptome | de_analysis/final_non_redundant_transcriptome.fasta | Transcripts that were used for differential expression analysis including novel transcripts with the identifiers used for DE analysis. | aggregated |
|
||||||
| Fusion transcript sequence summary file | /jaffal_output_{{ alias }}/jaffa_results.csv | Fusion transcript sequences summary file output by Jaffa. | per-sample |
|
| Fusion transcript sequences | jaffal_output_{{ alias }}/jaffa_results.fasta | Fusion transcript sequences output by Jaffa. | per-sample |
|
||||||
|
| Fusion transcript sequence summary file | jaffal_output_{{ alias }}/jaffa_results.csv | Fusion transcript sequences summary file output by Jaffa. | per-sample |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
68
bin/workflow_glue/make_isoform_table.py
Executable file
68
bin/workflow_glue/make_isoform_table.py
Executable file
@ -0,0 +1,68 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""Make report tables and data for plotting."""
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
from .util import wf_parser # noqa: ABS101
|
||||||
|
|
||||||
|
|
||||||
|
def argparser():
|
||||||
|
"""Argument parser for entrypoint."""
|
||||||
|
parser = wf_parser("Prepare report data")
|
||||||
|
parser.add_argument(
|
||||||
|
'--sample_id', help="Sample ID", required=True)
|
||||||
|
parser.add_argument(
|
||||||
|
'--gffcompare_dir',
|
||||||
|
help="The gffcompare output directory",
|
||||||
|
required=False,
|
||||||
|
type=Path)
|
||||||
|
|
||||||
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
def make_isoform_table(gffcompare_dir, sample_id):
|
||||||
|
"""Make an isoform summary table."""
|
||||||
|
try:
|
||||||
|
tmap_file = next(gffcompare_dir.glob('*.tmap'))
|
||||||
|
except StopIteration:
|
||||||
|
raise ValueError("Cannot find .tmap file in {}".format(gffcompare_dir))
|
||||||
|
dtypes = {
|
||||||
|
'ref_gene_id': str,
|
||||||
|
'ref_id': str,
|
||||||
|
'class_code': str,
|
||||||
|
'qry_id': str,
|
||||||
|
'num_exons': np.uint16,
|
||||||
|
'cov': np.uint32,
|
||||||
|
'len': np.uint32
|
||||||
|
}
|
||||||
|
df = pd.read_csv(
|
||||||
|
tmap_file, sep='\t+',
|
||||||
|
index_col=None,
|
||||||
|
usecols=list(dtypes.keys()),
|
||||||
|
dtype=dtypes)
|
||||||
|
|
||||||
|
if len(df) == 0: # No transcripts. Write a header only result file
|
||||||
|
df = pd.DataFrame(
|
||||||
|
columns=list(dtypes.keys()) + ['sample_id', 'parent gene iso num'])
|
||||||
|
df.to_csv(f'{sample_id}_transcripts_table.tsv', sep='\t', index=False)
|
||||||
|
else:
|
||||||
|
df = df.assign(sample_id=sample_id)
|
||||||
|
|
||||||
|
# Make a column of number of isoforms in parent gene
|
||||||
|
gb = df.groupby(['ref_gene_id']).count()
|
||||||
|
gb.rename(columns={'ref_id': 'num_isoforms'}, inplace=True)
|
||||||
|
|
||||||
|
df['parent gene iso num'] = df.apply(
|
||||||
|
lambda x: gb.loc[(x.ref_gene_id), 'num_isoforms'], axis=1)
|
||||||
|
|
||||||
|
# Unclassified transcripts should not be lumped together
|
||||||
|
df.loc[df.class_code == 'u', 'parent gene iso num'] = None
|
||||||
|
|
||||||
|
df.to_csv(f'{sample_id}_transcripts_table.tsv', sep='\t', index=False)
|
||||||
|
|
||||||
|
|
||||||
|
def main(args):
|
||||||
|
"""Entry point."""
|
||||||
|
if args.gffcompare_dir:
|
||||||
|
make_isoform_table(args.gffcompare_dir, args.sample_id)
|
||||||
@ -59,6 +59,9 @@ def argparser():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--sample_ids", required=True, nargs='+',
|
"--sample_ids", required=True, nargs='+',
|
||||||
help="List of sample ids")
|
help="List of sample ids")
|
||||||
|
parser.add_argument(
|
||||||
|
"--isoform_table", required=False, type=Path,
|
||||||
|
help="Path to directory of TSV files with isoform summaries")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--isoform_table_nrows", required=False, type=int, default=5000,
|
"--isoform_table_nrows", required=False, type=int, default=5000,
|
||||||
help="Maximum rows to display in isoforms table")
|
help="Maximum rows to display in isoforms table")
|
||||||
@ -549,8 +552,6 @@ def gff_compare_plots(report, gffcompare_outdirs, sample_ids):
|
|||||||
cover_panel = Tabs(tabs=tabs)
|
cover_panel = Tabs(tabs=tabs)
|
||||||
section.plot(cover_panel)
|
section.plot(cover_panel)
|
||||||
|
|
||||||
return df_tmap
|
|
||||||
|
|
||||||
|
|
||||||
def pychopper_plots(report, pychop_report):
|
def pychopper_plots(report, pychop_report):
|
||||||
"""Make plots from pychopper output.
|
"""Make plots from pychopper output.
|
||||||
@ -648,11 +649,10 @@ def cluster_quality(cluster_qc_dir, report, sample_ids):
|
|||||||
section.plot(cover_panel)
|
section.plot(cover_panel)
|
||||||
|
|
||||||
|
|
||||||
def transcript_table(report, df_tmaps, max_rows):
|
def transcript_table(report, isoform_table, max_rows):
|
||||||
"""Create searchable table of transcripts.
|
"""Create searchable table of transcripts.
|
||||||
|
|
||||||
:param df_tmaps: pd.DataFrame of all gffcomapre `.tmap` files from all
|
:param isoform_table: path to folder of isoform table files
|
||||||
samples
|
|
||||||
"""
|
"""
|
||||||
section = report.add_section()
|
section = report.add_section()
|
||||||
|
|
||||||
@ -668,24 +668,11 @@ def transcript_table(report, df_tmaps, max_rows):
|
|||||||
`isoform_table_nrows`. It is currently set to `{}`
|
`isoform_table_nrows`. It is currently set to `{}`
|
||||||
'''.format(max_rows))
|
'''.format(max_rows))
|
||||||
|
|
||||||
df = df_tmaps.drop(
|
dfs = []
|
||||||
columns=[
|
for file_ in Path(isoform_table).iterdir():
|
||||||
'FPKM', 'qry_gene_id', 'major_iso_id', 'ref_match_len', 'TPM'])
|
d = pd.read_csv(file_, sep='\t')
|
||||||
|
dfs.append(d)
|
||||||
if len(df) == 0:
|
df = pd.concat(dfs)
|
||||||
sys.stderr("No transcripts found")
|
|
||||||
section.markdown("No transcripts found")
|
|
||||||
return
|
|
||||||
|
|
||||||
# Make a column of number of isoforms in parent gene
|
|
||||||
gb = df.groupby(['ref_gene_id', 'sample_id']).count()
|
|
||||||
# gb = gb.set_index(['ref_gene_id', 'sample_id'])
|
|
||||||
gb.rename(columns={'ref_id': 'num_isoforms'}, inplace=True)
|
|
||||||
|
|
||||||
df['parent gene iso num'] = df.apply(
|
|
||||||
lambda x: gb.loc[(x.ref_gene_id, x.sample_id), 'num_isoforms'], axis=1)
|
|
||||||
# Uncalssified transcritps should not be lumped togetehr
|
|
||||||
df.loc[df.class_code == 'u', 'parent gene iso num'] = None
|
|
||||||
|
|
||||||
# Keep top n rows with most coverage
|
# Keep top n rows with most coverage
|
||||||
df.sort_values('cov', ascending=False, inplace=True)
|
df.sort_values('cov', ascending=False, inplace=True)
|
||||||
@ -934,14 +921,13 @@ def main(args):
|
|||||||
report, args.gff_annotation, sample_ids)
|
report, args.gff_annotation, sample_ids)
|
||||||
|
|
||||||
if args.gffcompare_dir is not None:
|
if args.gffcompare_dir is not None:
|
||||||
df_tmaps = gff_compare_plots(
|
gff_compare_plots(
|
||||||
report,
|
report,
|
||||||
[Path(x) for x in args.gffcompare_dir],
|
[Path(x) for x in args.gffcompare_dir],
|
||||||
sample_ids)
|
sample_ids)
|
||||||
|
|
||||||
if df_tmaps is not None:
|
if args.isoform_table is not None:
|
||||||
# Skip this section. This needs some work
|
transcript_table(report, args.isoform_table, args.isoform_table_nrows)
|
||||||
transcript_table(report, df_tmaps, args.isoform_table_nrows)
|
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
@ -12,18 +12,19 @@ Output files may be aggregated including information for all samples or provided
|
|||||||
| Annotated assembled transcriptome | {{ alias }}_merged_transcriptome.fas | Per sample annotated assembled transcriptome. | per-sample |
|
| Annotated assembled transcriptome | {{ alias }}_merged_transcriptome.fas | Per sample annotated assembled transcriptome. | per-sample |
|
||||||
| Alignment summary statistics | {{ alias }}_read_aln_stats.tsv | Per sample alignment summary statistics. | per-sample |
|
| Alignment summary statistics | {{ alias }}_read_aln_stats.tsv | Per sample alignment summary statistics. | per-sample |
|
||||||
| GFF compare results. | {{ alias }}_gffcompare | All GFF compare output files. | per-sample |
|
| GFF compare results. | {{ alias }}_gffcompare | All GFF compare output files. | per-sample |
|
||||||
| Differential gene expression results | /de_analysis/results_dge.tsv | This is a gene-level result file that describes genes and their probability of showing differential expression between experimental conditions. | aggregated |
|
| Differential gene expression results | de_analysis/results_dge.tsv | This is a gene-level result file that describes genes and their probability of showing differential expression between experimental conditions. | aggregated |
|
||||||
| Differential gene expression report | /de_analysis/results_dge.pdf | Summary report of differential gene expression analysis as a PDF. | aggregated |
|
| Differential gene expression report | de_analysis/results_dge.pdf | Summary report of differential gene expression analysis as a PDF. | aggregated |
|
||||||
| Differential transcript usage gene TSV | /de_analysis/results_dtu_gene.tsv | This is a gene-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
| Differential transcript usage gene TSV | de_analysis/results_dtu_gene.tsv | This is a gene-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
||||||
| Differential transcript usage report | /de_analysis/results_dtu.pdf | Summary report of differential transcript usage results as a PDF. | aggregated |
|
| Differential transcript usage report | de_analysis/results_dtu.pdf | Summary report of differential transcript usage results as a PDF. | aggregated |
|
||||||
| Differential transcript usage TSV | /de_analysis/results_dtu_transcript.tsv | This is a transcript-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
| Differential transcript usage TSV | de_analysis/results_dtu_transcript.tsv | This is a transcript-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression. | aggregated |
|
||||||
| Differential transcript usage stageR TSV | /de_analysis/results_dtu_stageR.tsv | This is the output from StageR and it shows both gene and transcript probabilities of differential expression | aggregated |
|
| Differential transcript usage stageR TSV | de_analysis/results_dtu_stageR.tsv | This is the output from StageR and it shows both gene and transcript probabilities of differential expression | aggregated |
|
||||||
| Differential transcript usage DEXSeq TSV | /de_analysis/results_dexseq.tsv | The complete output from the DEXSeq-analysis, shows both gene and transcript probabilities of differential expression. | aggregated |
|
| Differential transcript usage DEXSeq TSV | de_analysis/results_dexseq.tsv | The complete output from the DEXSeq-analysis, shows both gene and transcript probabilities of differential expression. | aggregated |
|
||||||
| Gene counts | /de_analysis/all_gene_counts.tsv | Raw gene counts created by the Salmon tool, before filtering. | aggregated |
|
| Gene counts | de_analysis/all_gene_counts.tsv | Raw gene counts created by the Salmon tool, before filtering. | aggregated |
|
||||||
| Gene counts per million | /de_analysis/cpm_gene_counts.tsv | This file shows counts per million (CPM) of the raw gene counts to facilitate comparisons across samples. | aggregated |
|
| Gene counts per million | de_analysis/cpm_gene_counts.tsv | This file shows counts per million (CPM) of the raw gene counts to facilitate comparisons across samples. | aggregated |
|
||||||
| Transcript counts | /de_analysis/unfiltered_transcript_counts_with_genes.tsv | Raw transcript counts created by the Salmon tool, before filtering. Includes reference to the associated gene ID. | aggregated |
|
| Transcript counts | de_analysis/unfiltered_transcript_counts_with_genes.tsv | Raw transcript counts created by the Salmon tool, before filtering. Includes reference to the associated gene ID. | aggregated |
|
||||||
| Transcript per million counts | /de_analysis/unfiltered_tpm_transcript_counts.tsv | This file shows transcripts per million (TPM) of the raw counts to facilitate comparisons across samples. | aggregated |
|
| Transcript per million counts | de_analysis/unfiltered_tpm_transcript_counts.tsv | This file shows transcripts per million (TPM) of the raw counts to facilitate comparisons across samples. | aggregated |
|
||||||
| Transcript counts filtered | /de_analysis/filtered_transcript_counts_with_genes.tsv | Filtered transcript counts, used for differential transcript usage analysis. Includes a reference to the associated gene ID. | aggregated |
|
| Transcript counts filtered | de_analysis/filtered_transcript_counts_with_genes.tsv | Filtered transcript counts, used for differential transcript usage analysis. Includes a reference to the associated gene ID. | aggregated |
|
||||||
| Final non redundant transcriptome | /de_analysis/final_non_redundant_transcriptome.fasta | Transcripts that were used for differential expression analysis including novel transcripts with the identifiers used for DE analysis. | aggregated |
|
| Transcript info table | {{ alias }}_transcripts_table.tsv | This file details each isoform that was reconstructed from the input reads. It contains a subset of columns from the .tmap output from [gffcompare](https://ccb.jhu.edu/software/stringtie/gffcompare.shtml) | per-sample |
|
||||||
| Fusion transcript sequences | /jaffal_output_{{ alias }}/jaffa_results.fasta | Fusion transcript sequences output by Jaffa. | per-sample |
|
| Final non redundant transcriptome | de_analysis/final_non_redundant_transcriptome.fasta | Transcripts that were used for differential expression analysis including novel transcripts with the identifiers used for DE analysis. | aggregated |
|
||||||
| Fusion transcript sequence summary file | /jaffal_output_{{ alias }}/jaffa_results.csv | Fusion transcript sequences summary file output by Jaffa. | per-sample |
|
| Fusion transcript sequences | jaffal_output_{{ alias }}/jaffa_results.fasta | Fusion transcript sequences output by Jaffa. | per-sample |
|
||||||
|
| Fusion transcript sequence summary file | jaffal_output_{{ alias }}/jaffa_results.csv | Fusion transcript sequences summary file output by Jaffa. | per-sample |
|
||||||
|
|||||||
28
main.nf
28
main.nf
@ -303,8 +303,11 @@ process run_gffcompare{
|
|||||||
tuple val(sample_id), path(query_annotation)
|
tuple val(sample_id), path(query_annotation)
|
||||||
path ref_annotation
|
path ref_annotation
|
||||||
output:
|
output:
|
||||||
tuple val(sample_id), path("${sample_id}_gffcompare"), emit: gffcmp_dir
|
tuple val(sample_id), path("${sample_id}_gffcompare"),
|
||||||
path ("${sample_id}_annotated.gtf"), emit: gtf, optional: true
|
emit: gffcmp_dir
|
||||||
|
path ("${sample_id}_annotated.gtf"), emit: gtf
|
||||||
|
tuple val(sample_id), path("${sample_id}_transcripts_table.tsv"),
|
||||||
|
emit: isoforms_table
|
||||||
script:
|
script:
|
||||||
def out_dir = "${sample_id}_gffcompare"
|
def out_dir = "${sample_id}_gffcompare"
|
||||||
"""
|
"""
|
||||||
@ -320,6 +323,11 @@ process run_gffcompare{
|
|||||||
mv *.tmap $out_dir
|
mv *.tmap $out_dir
|
||||||
mv *.refmap $out_dir
|
mv *.refmap $out_dir
|
||||||
cp ${out_dir}/str_merged.annotated.gtf ${sample_id}_annotated.gtf
|
cp ${out_dir}/str_merged.annotated.gtf ${sample_id}_annotated.gtf
|
||||||
|
|
||||||
|
# Make an isoform table for report and user output.
|
||||||
|
workflow-glue make_isoform_table \
|
||||||
|
--sample_id $sample_id \
|
||||||
|
--gffcompare_dir "${sample_id}_gffcompare"
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +387,6 @@ process merge_transcriptomes {
|
|||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
process makeReport {
|
process makeReport {
|
||||||
|
|
||||||
label "isoforms"
|
label "isoforms"
|
||||||
@ -398,6 +405,7 @@ process makeReport {
|
|||||||
path "gff_annotation/*"
|
path "gff_annotation/*"
|
||||||
path "de_report/*"
|
path "de_report/*"
|
||||||
path "seqkit/*"
|
path "seqkit/*"
|
||||||
|
path "isoforms_table/*"
|
||||||
output:
|
output:
|
||||||
path("wf-transcriptomes-*.html"), emit: report
|
path("wf-transcriptomes-*.html"), emit: report
|
||||||
// for DE analysis, a `gene_name` column will be added to
|
// for DE analysis, a `gene_name` column will be added to
|
||||||
@ -439,6 +447,11 @@ process makeReport {
|
|||||||
else
|
else
|
||||||
OPT_PC_REPORT="--pychop_report pychopper_report/*"
|
OPT_PC_REPORT="--pychop_report pychopper_report/*"
|
||||||
fi
|
fi
|
||||||
|
if [ -f "isoforms_table/OPTIONAL_FILE" ]; then
|
||||||
|
OPT_ISO_TABLE=""
|
||||||
|
else
|
||||||
|
OPT_ISO_TABLE="--isoform_table isoforms_table"
|
||||||
|
fi
|
||||||
workflow-glue report --report !{report_name} \
|
workflow-glue report --report !{report_name} \
|
||||||
--versions !{versions} \
|
--versions !{versions} \
|
||||||
--params params.json \
|
--params params.json \
|
||||||
@ -447,6 +460,7 @@ process makeReport {
|
|||||||
--sample_ids !{sids} \
|
--sample_ids !{sids} \
|
||||||
--stats per_read_stats/* \
|
--stats per_read_stats/* \
|
||||||
${OPT_GFF_ANNOTATION} \
|
${OPT_GFF_ANNOTATION} \
|
||||||
|
${OPT_ISO_TABLE} \
|
||||||
${OPT_GFFCMP_DIR} \
|
${OPT_GFFCMP_DIR} \
|
||||||
--isoform_table_nrows !{params.isoform_table_nrows} \
|
--isoform_table_nrows !{params.isoform_table_nrows} \
|
||||||
${OPT_JAFFAL_CSV} \
|
${OPT_JAFFAL_CSV} \
|
||||||
@ -598,6 +612,7 @@ workflow pipeline {
|
|||||||
run_gffcompare(merge_gff_bundles.out.gff, ref_annotation)
|
run_gffcompare(merge_gff_bundles.out.gff, ref_annotation)
|
||||||
gff_compare_dir = run_gffcompare.out.gffcmp_dir
|
gff_compare_dir = run_gffcompare.out.gffcmp_dir
|
||||||
gff_compare = run_gffcompare.out.gffcmp_dir.map{ it -> it[1]}.collect()
|
gff_compare = run_gffcompare.out.gffcmp_dir.map{ it -> it[1]}.collect()
|
||||||
|
isoforms_table = run_gffcompare.out.isoforms_table.map{ it -> it[1]}.collect()
|
||||||
// create per sample gff tuples with gff compare directories
|
// create per sample gff tuples with gff compare directories
|
||||||
gff_tuple = merge_gff_bundles.out.gff
|
gff_tuple = merge_gff_bundles.out.gff
|
||||||
.join(gff_compare_dir)
|
.join(gff_compare_dir)
|
||||||
@ -606,6 +621,7 @@ workflow pipeline {
|
|||||||
optional_channel = Channel.fromPath("$projectDir/data/OPTIONAL_FILE")
|
optional_channel = Channel.fromPath("$projectDir/data/OPTIONAL_FILE")
|
||||||
gff_tuple = merge_gff_bundles.out.gff.combine(optional_channel)
|
gff_tuple = merge_gff_bundles.out.gff.combine(optional_channel)
|
||||||
gff_compare = OPTIONAL_FILE
|
gff_compare = OPTIONAL_FILE
|
||||||
|
isoforms_table = file("$projectDir/data/OPTIONAL_FILE")
|
||||||
}
|
}
|
||||||
// For reference based assembly, there is only one reference
|
// For reference based assembly, there is only one reference
|
||||||
// So map this reference to all sample_ids
|
// So map this reference to all sample_ids
|
||||||
@ -620,6 +636,7 @@ workflow pipeline {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
gff_compare = file("$projectDir/data/OPTIONAL_FILE")
|
gff_compare = file("$projectDir/data/OPTIONAL_FILE")
|
||||||
|
isoforms_table = file("$projectDir/data/OPTIONAL_FILE")
|
||||||
merge_gff = file("$projectDir/data/OPTIONAL_FILE")
|
merge_gff = file("$projectDir/data/OPTIONAL_FILE")
|
||||||
assembly_stats = file("$projectDir/data/OPTIONAL_FILE")
|
assembly_stats = file("$projectDir/data/OPTIONAL_FILE")
|
||||||
use_ref_ann = false
|
use_ref_ann = false
|
||||||
@ -632,7 +649,6 @@ workflow pipeline {
|
|||||||
jaffal_out = file("$projectDir/data/OPTIONAL_FILE")
|
jaffal_out = file("$projectDir/data/OPTIONAL_FILE")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (params.de_analysis){
|
if (params.de_analysis){
|
||||||
sample_sheet = file(params.sample_sheet, type:"file")
|
sample_sheet = file(params.sample_sheet, type:"file")
|
||||||
if (!params.ref_transcriptome){
|
if (!params.ref_transcriptome){
|
||||||
@ -670,7 +686,8 @@ workflow pipeline {
|
|||||||
gff_compare,
|
gff_compare,
|
||||||
merge_gff,
|
merge_gff,
|
||||||
de_report,
|
de_report,
|
||||||
count_transcripts_file)
|
count_transcripts_file,
|
||||||
|
isoforms_table)
|
||||||
|
|
||||||
report = makeReport.out.report
|
report = makeReport.out.report
|
||||||
|
|
||||||
@ -679,6 +696,7 @@ workflow pipeline {
|
|||||||
if (use_ref_ann){
|
if (use_ref_ann){
|
||||||
results = run_gffcompare.output.gffcmp_dir.concat(
|
results = run_gffcompare.output.gffcmp_dir.concat(
|
||||||
assembly.stats,
|
assembly.stats,
|
||||||
|
run_gffcompare.out.isoforms_table,
|
||||||
get_transcriptome.out.transcriptome.flatMap(map_sample_ids_cls))
|
get_transcriptome.out.transcriptome.flatMap(map_sample_ids_cls))
|
||||||
.map {it -> it[1]}
|
.map {it -> it[1]}
|
||||||
.concat(results)
|
.concat(results)
|
||||||
|
|||||||
@ -81,7 +81,7 @@
|
|||||||
"type": "per-sample"
|
"type": "per-sample"
|
||||||
},
|
},
|
||||||
"dge-results-tsv": {
|
"dge-results-tsv": {
|
||||||
"filepath": "/de_analysis/results_dge.tsv",
|
"filepath": "de_analysis/results_dge.tsv",
|
||||||
"title": "Differential gene expression results",
|
"title": "Differential gene expression results",
|
||||||
"description": "This is a gene-level result file that describes genes and their probability of showing differential expression between experimental conditions.",
|
"description": "This is a gene-level result file that describes genes and their probability of showing differential expression between experimental conditions.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -89,7 +89,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"dge-report-pdf": {
|
"dge-report-pdf": {
|
||||||
"filepath": "/de_analysis/results_dge.pdf",
|
"filepath": "de_analysis/results_dge.pdf",
|
||||||
"title": "Differential gene expression report",
|
"title": "Differential gene expression report",
|
||||||
"description": "Summary report of differential gene expression analysis as a PDF.",
|
"description": "Summary report of differential gene expression analysis as a PDF.",
|
||||||
"mime-type": "application/pdf",
|
"mime-type": "application/pdf",
|
||||||
@ -97,7 +97,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"dtu-gene-tsv": {
|
"dtu-gene-tsv": {
|
||||||
"filepath": "/de_analysis/results_dtu_gene.tsv",
|
"filepath": "de_analysis/results_dtu_gene.tsv",
|
||||||
"title": "Differential transcript usage gene TSV",
|
"title": "Differential transcript usage gene TSV",
|
||||||
"description": "This is a gene-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression.",
|
"description": "This is a gene-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -105,7 +105,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"dtu-report-pdf": {
|
"dtu-report-pdf": {
|
||||||
"filepath": "/de_analysis/results_dtu.pdf",
|
"filepath": "de_analysis/results_dtu.pdf",
|
||||||
"title": "Differential transcript usage report",
|
"title": "Differential transcript usage report",
|
||||||
"description": "Summary report of differential transcript usage results as a PDF.",
|
"description": "Summary report of differential transcript usage results as a PDF.",
|
||||||
"mime-type": "application/pdf",
|
"mime-type": "application/pdf",
|
||||||
@ -113,7 +113,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"dtu-transcript": {
|
"dtu-transcript": {
|
||||||
"filepath": "/de_analysis/results_dtu_transcript.tsv",
|
"filepath": "de_analysis/results_dtu_transcript.tsv",
|
||||||
"title": "Differential transcript usage TSV",
|
"title": "Differential transcript usage TSV",
|
||||||
"description": "This is a transcript-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression.",
|
"description": "This is a transcript-level result file from DEXSeq that lists annotated genes and their probabilities of differential expression.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -121,7 +121,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"dtu-stageR": {
|
"dtu-stageR": {
|
||||||
"filepath": "/de_analysis/results_dtu_stageR.tsv ",
|
"filepath": "de_analysis/results_dtu_stageR.tsv ",
|
||||||
"title": "Differential transcript usage stageR TSV",
|
"title": "Differential transcript usage stageR TSV",
|
||||||
"description": "This is the output from StageR and it shows both gene and transcript probabilities of differential expression",
|
"description": "This is the output from StageR and it shows both gene and transcript probabilities of differential expression",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -129,7 +129,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"dexseq": {
|
"dexseq": {
|
||||||
"filepath": "/de_analysis/results_dexseq.tsv",
|
"filepath": "de_analysis/results_dexseq.tsv",
|
||||||
"title": "Differential transcript usage DEXSeq TSV",
|
"title": "Differential transcript usage DEXSeq TSV",
|
||||||
"description": "The complete output from the DEXSeq-analysis, shows both gene and transcript probabilities of differential expression.",
|
"description": "The complete output from the DEXSeq-analysis, shows both gene and transcript probabilities of differential expression.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -137,7 +137,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"gene_counts": {
|
"gene_counts": {
|
||||||
"filepath": "/de_analysis/all_gene_counts.tsv",
|
"filepath": "de_analysis/all_gene_counts.tsv",
|
||||||
"title": "Gene counts",
|
"title": "Gene counts",
|
||||||
"description": "Raw gene counts created by the Salmon tool, before filtering.",
|
"description": "Raw gene counts created by the Salmon tool, before filtering.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -145,7 +145,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"gene_counts_per_million": {
|
"gene_counts_per_million": {
|
||||||
"filepath": "/de_analysis/cpm_gene_counts.tsv",
|
"filepath": "de_analysis/cpm_gene_counts.tsv",
|
||||||
"title": "Gene counts per million",
|
"title": "Gene counts per million",
|
||||||
"description": "This file shows counts per million (CPM) of the raw gene counts to facilitate comparisons across samples.",
|
"description": "This file shows counts per million (CPM) of the raw gene counts to facilitate comparisons across samples.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -153,7 +153,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"transcript_counts": {
|
"transcript_counts": {
|
||||||
"filepath": "/de_analysis/unfiltered_transcript_counts_with_genes.tsv",
|
"filepath": "de_analysis/unfiltered_transcript_counts_with_genes.tsv",
|
||||||
"title": "Transcript counts",
|
"title": "Transcript counts",
|
||||||
"description": "Raw transcript counts created by the Salmon tool, before filtering. Includes reference to the associated gene ID.",
|
"description": "Raw transcript counts created by the Salmon tool, before filtering. Includes reference to the associated gene ID.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -161,7 +161,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"tpm_transcript_counts": {
|
"tpm_transcript_counts": {
|
||||||
"filepath": "/de_analysis/unfiltered_tpm_transcript_counts.tsv",
|
"filepath": "de_analysis/unfiltered_tpm_transcript_counts.tsv",
|
||||||
"title": "Transcript per million counts",
|
"title": "Transcript per million counts",
|
||||||
"description": "This file shows transcripts per million (TPM) of the raw counts to facilitate comparisons across samples.",
|
"description": "This file shows transcripts per million (TPM) of the raw counts to facilitate comparisons across samples.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
@ -169,15 +169,23 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"transcipt_counts_filtered": {
|
"transcipt_counts_filtered": {
|
||||||
"filepath": "/de_analysis/filtered_transcript_counts_with_genes.tsv",
|
"filepath": "de_analysis/filtered_transcript_counts_with_genes.tsv",
|
||||||
"title": "Transcript counts filtered",
|
"title": "Transcript counts filtered",
|
||||||
"description": "Filtered transcript counts, used for differential transcript usage analysis. Includes a reference to the associated gene ID.",
|
"description": "Filtered transcript counts, used for differential transcript usage analysis. Includes a reference to the associated gene ID.",
|
||||||
"mime-type": "text/tab-separated-values",
|
"mime-type": "text/tab-separated-values",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
|
"transcripts_table": {
|
||||||
|
"filepath": "{{ alias }}_transcripts_table.tsv",
|
||||||
|
"title": "Transcript info table",
|
||||||
|
"description": "This file details each isoform that was reconstructed from the input reads. It contains a subset of columns from the .tmap output from [gffcompare](https://ccb.jhu.edu/software/stringtie/gffcompare.shtml)",
|
||||||
|
"mime-type": "text/tab-separated-values",
|
||||||
|
"optional": true,
|
||||||
|
"type": "per-sample"
|
||||||
|
},
|
||||||
"final_non_redundant_transcriptome": {
|
"final_non_redundant_transcriptome": {
|
||||||
"filepath": "/de_analysis/final_non_redundant_transcriptome.fasta",
|
"filepath": "de_analysis/final_non_redundant_transcriptome.fasta",
|
||||||
"title": "Final non redundant transcriptome",
|
"title": "Final non redundant transcriptome",
|
||||||
"description": "Transcripts that were used for differential expression analysis including novel transcripts with the identifiers used for DE analysis.",
|
"description": "Transcripts that were used for differential expression analysis including novel transcripts with the identifiers used for DE analysis.",
|
||||||
"mime-type": "text/x-fasta",
|
"mime-type": "text/x-fasta",
|
||||||
@ -185,7 +193,7 @@
|
|||||||
"type": "aggregated"
|
"type": "aggregated"
|
||||||
},
|
},
|
||||||
"jaffa_fasta": {
|
"jaffa_fasta": {
|
||||||
"filepath": "/jaffal_output_{{ alias }}/jaffa_results.fasta",
|
"filepath": "jaffal_output_{{ alias }}/jaffa_results.fasta",
|
||||||
"title": "Fusion transcript sequences",
|
"title": "Fusion transcript sequences",
|
||||||
"description": "Fusion transcript sequences output by Jaffa.",
|
"description": "Fusion transcript sequences output by Jaffa.",
|
||||||
"mime-type": "text/x-fasta",
|
"mime-type": "text/x-fasta",
|
||||||
@ -193,7 +201,7 @@
|
|||||||
"type": "per-sample"
|
"type": "per-sample"
|
||||||
},
|
},
|
||||||
"jaffa_results": {
|
"jaffa_results": {
|
||||||
"filepath": "/jaffal_output_{{ alias }}/jaffa_results.csv",
|
"filepath": "jaffal_output_{{ alias }}/jaffa_results.csv",
|
||||||
"title": "Fusion transcript sequence summary file",
|
"title": "Fusion transcript sequence summary file",
|
||||||
"description": "Fusion transcript sequences summary file output by Jaffa.",
|
"description": "Fusion transcript sequences summary file output by Jaffa.",
|
||||||
"mime-type": "text/csv",
|
"mime-type": "text/csv",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user