Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dp24 jbrowse #347

Merged
merged 7 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: |
curl https://tolit.cog.sanger.ac.uk/test-data/resources/treeval/TreeValTinyData.tar.gz | tar xzf -

- name: Singularity - Run FULL pipeline with test data
- name: Run FULL pipeline with test data
# Remember that you can parallelise this by using strategy.matrix
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test_github,docker --outdir ./Sing-Full
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ This builds on the initial release by adding subworkflows which generate kmer ba
- Fix a bug in build_alignment_blocks.py to avoid indexing errors happening in large genomes.
- Change output BEDGRAPH from EXTRACT_TELO module.

#### Hot Fix 1

- Generate CRAM CSV fix to allow for multi-readgroup cram files
- Removing KMER_READCOV
- tmp directory was being used
- Output file adjustment (names and location)

### Parameters

| Old Parameter | New Parameter |
Expand Down
26 changes: 23 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ WorkflowMain.initialise( workflow, params, log )
*/

include { TREEVAL } from './workflows/treeval'
include { TREEVAL_JBROWSE } from './workflows/treeval_jbrowse'
include { TREEVAL_RAPID } from './workflows/treeval_rapid'
include { TREEVAL_RAPID_TOL } from './workflows/treeval_rapid_tol'

Expand All @@ -33,20 +34,31 @@ workflow SANGERTOL_TREEVAL {
TREEVAL ()
}


//
// WORKFLOW: RUN MAIN PIPELINE ONLY THE JBROWSE COMPATIBLE COMPONENTS - E.G. NO MAPS
//
workflow SANGERTOL_TREEVAL_JBROWSE {
TREEVAL_JBROWSE ()
}


//
// WORKFLOW: RUN TRUNCATED PIPELINE TO PRODUCE CONTACT MAPS AND PRETEXT ACCESSORIES
//
workflow SANGERTOL_TREEVAL_RAPID {
TREEVAL_RAPID ()
}


//
// WORKFLOW: RUN TRUNCATED PIPELINE, CONTAINS WORKFLOWS INTERNAL TO SANGERTOL
//
workflow SANGERTOL_TREEVAL_RAPID_TOL {
TREEVAL_RAPID_TOL ()
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN ALL WORKFLOWS
Expand All @@ -57,17 +69,25 @@ workflow SANGERTOL_TREEVAL_RAPID_TOL {
// WORKFLOWS: Execute named workflow for the pipeline
//
workflow {
SANGERTOL_TREEVAL ()
SANGERTOL_TREEVAL ()
}


workflow JBROWSE {
SANGERTOL_TREEVAL_JBROWSE ()
}


workflow RAPID {
SANGERTOL_TREEVAL_RAPID ()
SANGERTOL_TREEVAL_RAPID ()
}


workflow RAPID_TOL {
SANGERTOL_TREEVAL_RAPID_TOL ()
SANGERTOL_TREEVAL_RAPID_TOL ()
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
Expand Down
1 change: 0 additions & 1 deletion subworkflows/local/busco_annotation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ workflow BUSCO_ANNOTATION {
[]
)
ch_versions = ch_versions.mix(BUSCO_BUSCO.out.versions.first())

ch_grab = GrabFiles(BUSCO_BUSCO.out.busco_dir)

//
Expand Down
25 changes: 24 additions & 1 deletion subworkflows/local/hic_mapping.nf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ workflow HIC_MAPPING {
}
.set{ch_aligner}


//
// SUBWORKFLOW: mapping hic reads using minimap2
//
Expand All @@ -96,6 +97,7 @@ workflow HIC_MAPPING {
ch_versions = ch_versions.mix( HIC_MINIMAP2.out.versions )
mergedbam = HIC_MINIMAP2.out.mergedbam


//
// SUBWORKFLOW: mapping hic reads using bwamem2
//
Expand All @@ -107,6 +109,7 @@ workflow HIC_MAPPING {
ch_versions = ch_versions.mix( HIC_BWAMEM2.out.versions )
mergedbam = mergedbam.mix(HIC_BWAMEM2.out.mergedbam)


//
// LOGIC: PREPARING PRETEXT MAP INPUT
//
Expand Down Expand Up @@ -144,6 +147,7 @@ workflow HIC_MAPPING {
)
}


//
// MODULE: GENERATE PRETEXT MAP FROM MAPPED BAM FOR LOW RES
//
Expand All @@ -153,6 +157,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix( PRETEXTMAP_STANDRD.out.versions )


//
// MODULE: INGEST ACCESSORY FILES INTO PRETEXT BY DEFAULT
//
Expand All @@ -166,6 +171,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix( PRETEXT_INGEST_SNDRD.out.versions )


//
// MODULE: GENERATE PRETEXT MAP FROM MAPPED BAM FOR HIGH RES
//
Expand All @@ -175,6 +181,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix( PRETEXTMAP_HIGHRES.out.versions )


//
// NOTICE: This could fail on LARGE hires maps due to some memory parameter in the C code
// of pretext graph. There is a "fixed" version in sanger /software which may need
Expand All @@ -190,6 +197,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix( PRETEXT_INGEST_HIRES.out.versions )


//
// MODULE: GENERATE PNG FROM STANDARD PRETEXT
//
Expand All @@ -198,6 +206,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix ( SNAPSHOT_SRES.out.versions )


//
// LOGIC: BRANCH TO SUBSAMPLE BAM IF LARGER THAN 50G
//
Expand All @@ -216,6 +225,7 @@ workflow HIC_MAPPING {
}
.set { ch_merged_bam }


// LOGIC: PREPARE BAMTOBED JUICER INPUT.
if ( workflow_setting != "RAPID_TOL" && params.juicer == false ) {
//
Expand All @@ -236,6 +246,7 @@ workflow HIC_MAPPING {
}
.set { ch_merged_bam }


//
// MODULE: SUBSAMPLE BAM
//
Expand All @@ -244,12 +255,14 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix ( SUBSAMPLE_BAM.out.versions )


//
// LOGIC: COMBINE BRANCHED TO SINGLE OUTPUT
//
ch_subsampled_bam = SUBSAMPLE_BAM.out.subsampled_bam
ch_subsampled_bam.mix(ch_merged_bam.unmodified)


//
// LOGIC: PREPARE BAMTOBED JUICER INPUT
//
Expand All @@ -261,6 +274,7 @@ workflow HIC_MAPPING {
}
.set { ch_bamtobed_juicer_input }


//
// SUBWORKFLOW: BAM TO BED FOR JUICER - USES THE SUBSAMPLED MERGED BAM
//
Expand All @@ -270,6 +284,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix( HIC_BAMTOBED_JUICER.out.versions )


//
// LOGIC: PREPARE JUICER TOOLS INPUT
//
Expand All @@ -282,6 +297,7 @@ workflow HIC_MAPPING {
}
.set { ch_juicer_input }


//
// MODULE: GENERATE HIC MAP, ONLY IS PIPELINE IS RUNNING ON ENTRY FULL
//
Expand All @@ -293,6 +309,7 @@ workflow HIC_MAPPING {
ch_versions = ch_versions.mix( JUICER_TOOLS_PRE.out.versions )
}


//
// LOGIC: PREPARE BAMTOBED COOLER INPUT
//
Expand All @@ -304,6 +321,7 @@ workflow HIC_MAPPING {
}
.set { ch_bamtobed_cooler_input }


//
// SUBWORKFLOW: BAM TO BED FOR COOLER
//
Expand All @@ -313,6 +331,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix( HIC_BAMTOBED_COOLER.out.versions )


//
// LOGIC: BIN CONTACT PAIRS
//
Expand All @@ -321,6 +340,7 @@ workflow HIC_MAPPING {
.combine( ch_cool_bin )
.set { ch_binned_pairs }


//
// LOGIC: PREPARE COOLER INPUT
//
Expand All @@ -332,6 +352,7 @@ workflow HIC_MAPPING {
}
.set { ch_cooler }


//
// MODULE: GENERATE A MULTI-RESOLUTION COOLER FILE BY COARSENING
//
Expand All @@ -341,6 +362,7 @@ workflow HIC_MAPPING {
)
ch_versions = ch_versions.mix(COOLER_CLOAD.out.versions)


//
// LOGIC: REFACTOR CHANNEL FOR ZOOMIFY
//
Expand All @@ -350,16 +372,17 @@ workflow HIC_MAPPING {
}
.set{ch_cool}


//
// MODULE: ZOOM COOL TO MCOOL
//
COOLER_ZOOMIFY(ch_cool)
ch_versions = ch_versions.mix(COOLER_ZOOMIFY.out.versions)


//
// LOGIC: FOR REPORTING
//

ch_cram_files = GrabFiles( hic_reads_path )

ch_cram_files
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/synteny.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ include { MINIMAP2_ALIGN } from '../../modules/nf-core/minimap2/align/mai

workflow SYNTENY {
take:
reference_tuple // Channel: tuple [ val(meta), path(file) ]
synteny_paths // Channel: val(meta)
reference_tuple // Channel: tuple [ val(meta), path(file) ]
synteny_paths // Channel: val(meta)

main:
ch_versions = Channel.empty()
Expand Down
2 changes: 0 additions & 2 deletions subworkflows/local/yaml_input.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ workflow YAML_INPUT {
}
.set{ group }

group.synteny.view{"INPUT: $it"}

//
// LOGIC: PARSES THE SECOND LEVEL OF YAML VALUES PER ABOVE OUTPUT CHANNEL
//
Expand Down
2 changes: 1 addition & 1 deletion workflows/treeval.nf
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ workflow TREEVAL {
// and generated a file of syntenic blocks.
//
if ( !exclude_workflow_steps.contains("synteny")) {
YAML_INPUT.out.synteny_paths.view {"SYNTENY_MAIN: $it"}
SYNTENY (
YAML_INPUT.out.reference_ch,
YAML_INPUT.out.synteny_paths
)
ch_versions = ch_versions.mix( SYNTENY.out.versions )
}


//
// SUBWORKFLOW: Takes reference, pacbio reads
//
Expand Down
9 changes: 9 additions & 0 deletions workflows/treeval_rapid.nf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ workflow TREEVAL_RAPID {

params.entry = 'RAPID'
input_ch = Channel.fromPath(params.input, checkIfExists: true)


//
// SUBWORKFLOW: reads the yaml and pushing out into a channel per yaml field
//
Expand All @@ -73,6 +75,7 @@ workflow TREEVAL_RAPID {
params.entry
)


//
// SUBWORKFLOW: Takes input fasta file and sample ID to generate a my.genome file
//
Expand All @@ -82,6 +85,7 @@ workflow TREEVAL_RAPID {
)
ch_versions = ch_versions.mix( GENERATE_GENOME.out.versions )


//
// SUBWORKFLOW: GENERATES A BIGWIG FOR A REPEAT DENSITY TRACK
//
Expand All @@ -93,6 +97,7 @@ workflow TREEVAL_RAPID {
ch_versions = ch_versions.mix( REPEAT_DENSITY.out.versions )
}


//
// SUBWORKFLOW: GENERATES A GAP.BED FILE TO ID THE LOCATIONS OF GAPS
//
Expand All @@ -103,6 +108,7 @@ workflow TREEVAL_RAPID {
ch_versions = ch_versions.mix( GAP_FINDER.out.versions )
}


//
// SUBWORKFLOW: GENERATE TELOMERE WINDOW FILES WITH PACBIO READS AND REFERENCE
//
Expand All @@ -113,6 +119,7 @@ workflow TREEVAL_RAPID {
ch_versions = ch_versions.mix( TELO_FINDER.out.versions )
}


//
// SUBWORKFLOW: Takes reference, pacbio reads
//
Expand Down Expand Up @@ -152,13 +159,15 @@ workflow TREEVAL_RAPID {
hic_report = []
}


//
// SUBWORKFLOW: Collates version data from prior subworflows
//
CUSTOM_DUMPSOFTWAREVERSIONS (
ch_versions.unique().collectFile(name: 'collated_versions.yml')
)


//
// LOGIC: GENERATE SOME CHANNELS FOR REPORTING
//
Expand Down
Loading
Loading