sanger-tol / genomenote

This Nextflow DSL2 pipeline takes aligned HiC reads, creates contact maps and a table of statistics.
https://pipelines.tol.sanger.ac.uk/genomenote
MIT License
19 stars 2 forks source link

Sub-workflow for gene statistics #121

Open BethYates opened 1 week ago

BethYates commented 1 week ago

We want to be able to include some standard basic statistics on the gene/protein annotation set for an assembly in a genome note. This sub workflow should accept an annotation set and calculate some statistics, (exact values still to be determined but will most likely be things like the number of protein coding genes, number of non-coding genes, exons per transcript etc as well as BUSCO scores).

This could be a standalone pipeline or could be added to either the genomenote pipeline or to the ensemblgenedownload pipeline, although it may not always be Ensembl that provides the annotations.

BethYates commented 4 days ago

After disussing this with the ToL Genome Notes editor they would like to see OMark https://omark.omabrowser.org/ included in the set of tools to evaluate an annotation set

BethYates commented 2 days ago

To close this issue:

  1. Add a new optional parameter --annotation_set which takes in a file path for a directory containing ensembl gene annotation. This directory should have files consistent with the ouput directory from running the sanger-tol/ensemblgenedownload pipeline
  2. In the main workflow or sub-workflow, parse and validate the parameter value and pass the files from the filepath to a new subworkflow - annotation_stats,
  3. Define the sub-workflow annotation_stats and configure it to run only if the --annotation_set parameter is passed.
  4. Create the subwofkflow annotation_stats, it should read in the relevant annotation files and process the data to generate the following statistics:
    - TRANSC_MRNA: the number of transcribed mRNAs 
    - PCG: the number of protein coding genes
    - NCG: the number of non-coding genes
    - CDS_PER_GENE: the average number of coding transcripts per gene
    - EXONS_PER_TRANSC: the average number of exons per transcript
    - CDS_LENGTH: the average length of coding sequence
    - EXON_SIZE: the average length of a coding exon
    - INTRON_SIZE: the average length of coding intron size
  5. Output these statistics to a csv file named as the assemblyID. csv in a directory created in the results directory called annotation_statistics, The CSV file should have the following columns, Variable,Value where the variable is the name of the variable from the list above an the value is the statistic you have generated.
  6. Run tests to make sure output file is produced.
  7. Update the documentation.