-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Eco-Flow/simon-dev
Merge major overhaul to main branch
- Loading branch information
Showing
21 changed files
with
142 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ nextflow | |
Go/ | ||
*fna | ||
*.gff | ||
reports/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,4 +265,3 @@ | |
} | ||
|
||
|
||
`plotting-inversions.R > R_output.txt` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,4 +265,3 @@ | |
} | ||
|
||
|
||
`plotting-inversions-treeSort.R > R_output.txt` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,22 +4,14 @@ | |
|
||
/* | ||
* Authors: | ||
* - Chris Wyatt <[email protected]> | ||
* - Chris Wyatt <[email protected]> | ||
* - Simon Murray <[email protected]> | ||
*/ | ||
|
||
/* | ||
* Default pipeline parameters (on test data). They can be overriden on the command line eg. | ||
* given `params.name` specify on the run command line `--name My_run_v1`. | ||
*/ | ||
|
||
params.outdir = "Results" | ||
params.input = "data/Example.csv" | ||
params.seqids = "./data/default1" | ||
params.layout = "./data/default2" | ||
params.hex = "data/unique_hex2" | ||
params.go = null | ||
params.test=0 | ||
params.tree= false | ||
|
||
log.info """\ | ||
=================================== | ||
|
@@ -40,15 +32,12 @@ include { GFFREAD } from './modules/gffread.nf' | |
include { JCVI } from './modules/jcvi.nf' | ||
include { SYNTENY } from './modules/synteny.nf' | ||
include { DOWNLOAD_NCBI } from './modules/download_ncbi.nf' | ||
include { DOWNLOAD_NCBI as DOWNLOAD_NCBI2 } from './modules/download_ncbi.nf' | ||
include { CHROMOPAINT } from './modules/chromo.nf' | ||
include { SCORE } from './modules/score.nf' | ||
include { LONGEST } from './modules/longest_orf.nf' | ||
include { GO } from './modules/go.nf' | ||
include { SCORE_TREE } from './modules/score_tree.nf' | ||
include { GO_SUMMARISE } from './modules/go_summarise.nf' | ||
|
||
|
||
Channel | ||
.fromPath(params.input) | ||
.splitCsv() | ||
|
@@ -66,74 +55,48 @@ Channel | |
|
||
Channel | ||
.fromPath(params.layout) | ||
.set { in_layout } | ||
.set { in_layout } | ||
|
||
Channel | ||
.fromPath(params.hex) | ||
.set { in_hex } | ||
.set { in_hex } | ||
|
||
Channel | ||
.fromPath(params.input) | ||
.splitCsv() | ||
.branch { | ||
ncbi: it.size() == 2 | ||
.branch { | ||
ncbi: it.size() == 2 | ||
local: it.size() == 3 | ||
} | ||
.set { input_type } | ||
|
||
|
||
// input_type.ncbi.view { "$it is small" } | ||
// input_type.local.view { "$it is large" } | ||
|
||
|
||
|
||
workflow { | ||
|
||
DOWNLOAD_NCBI ( input_type.ncbi ) | ||
|
||
GFFREAD ( DOWNLOAD_NCBI.out.genome.mix(input_type.local) ) | ||
|
||
JCVI ( GFFREAD.out.proteins ) | ||
|
||
SYNTENY ( JCVI.out.new_format.combine(JCVI.out.new_format).filter{ it[0] != it[3] } ) | ||
|
||
CHROMOPAINT ( in_hex , SYNTENY.out.anchors , JCVI.out.beds.collect() ) | ||
|
||
if (params.tree){ | ||
|
||
tree_in = Channel.fromPath(params.tree) | ||
|
||
SCORE_TREE ( SYNTENY.out.anchors.collect() , SYNTENY.out.percsim.collect() , GFFREAD.out.gff.collect() , tree_in ) | ||
if (params.tree) { | ||
tree_in = Channel.fromPath(params.tree) | ||
SCORE_TREE ( SYNTENY.out.anchors.collect() , SYNTENY.out.percsim.collect() , GFFREAD.out.gff.collect() , tree_in ) | ||
} | ||
|
||
else{ | ||
|
||
else { | ||
SCORE ( SYNTENY.out.anchors.collect() , SYNTENY.out.percsim.collect() , GFFREAD.out.gff.collect() ) | ||
|
||
} | ||
|
||
if (params.go){ | ||
|
||
go_datasets = Channel.fromPath(params.go) | ||
|
||
if (params.tree){ | ||
|
||
GO ( go_datasets.collect() , SCORE_TREE.out.speciesSummary.flatten() , JCVI.out.beds.collect() ) | ||
|
||
} | ||
else{ | ||
|
||
GO ( go_datasets.collect() , SCORE.out.speciesSummary.flatten() , JCVI.out.beds.collect() ) | ||
|
||
} | ||
|
||
GO_SUMMARISE ( GO.out.go_table.collect() ) | ||
|
||
} | ||
|
||
if (params.go) { | ||
ch_go = params.tree != null ? SCORE_TREE.out.speciesSummary : SCORE.speciesSummary | ||
ch_go.view() | ||
GO ( go_datasets.collect() , ch_go.flatten(), JCVI.out.beds.collect() ) | ||
GO_SUMMARISE ( GO.out.go_table.collect() ) | ||
} | ||
} | ||
|
||
workflow.onComplete { | ||
println ( workflow.success ? "\nDone! Check results in $params.outdir/ \n" : "Hmmm .. something went wrong\n" ) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
process CHROMOPAINT { | ||
|
||
label 'chromo' | ||
tag "$anchors" | ||
publishDir "$params.outdir/Chromosome_plots" , mode: "copy" | ||
container = 'chriswyatt/jcvi' | ||
errorStrategy = 'ignore' | ||
|
||
container = 'ecoflowucl/jcvi:python-3.10_last-1522' | ||
|
||
input: | ||
path (hex) | ||
each (anchors) | ||
path ('*') | ||
|
||
path (hex) | ||
each (anchors) | ||
path ('*') | ||
|
||
output: | ||
|
||
path("*.pdf"), emit: pdf | ||
path("*.pdf"), emit: pdf | ||
|
||
script: | ||
""" | ||
echo '${anchors}' | rev | cut -d'/' -f 1 | rev > Name | ||
A="\$(cut -d'.' -f1 Name)" | ||
B="\$(cut -d'.' -f2 Name)" | ||
anchor.pl \$A.bed \$B.bed ${anchors} | ||
python -m jcvi.graphics.chromosome Chromopaint.txt colour.idmap | ||
mv Chromopaint.pdf "\$A.\$B.chromo.pdf" | ||
echo '${anchors}' | rev | cut -d'/' -f 1 | rev > Name | ||
A="\$(cut -d'.' -f1 Name)" | ||
B="\$(cut -d'.' -f2 Name)" | ||
anchor.pl \$A.bed \$B.bed ${anchors} | ||
python -m jcvi.graphics.chromosome Chromopaint.txt colour.idmap | ||
mv Chromopaint.pdf "\$A.\$B.chromo.pdf" | ||
""" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
process GFFREAD { | ||
|
||
label 'gffread' | ||
tag "$sample_id" | ||
container = 'chriswyatt/gffread_python3' | ||
container = 'ecoflowucl/gffread_python:python-3.10_Linux_x86_64' | ||
publishDir "$params.outdir/Gffread_results" , mode: "copy" | ||
|
||
input: | ||
|
||
tuple val(sample_id), path(fasta), path(gff) | ||
input: | ||
tuple val(sample_id), path(fasta), path(gff) | ||
|
||
output: | ||
|
||
tuple val(sample_id), path( "${sample_id}.nucl.fa" ), path( "${sample_id}.gff_for_jvci.gff3" ), emit: proteins | ||
path( "${sample_id}.gff_for_jvci.gff3" ), emit: gff | ||
tuple val(sample_id), path( "${sample_id}.nucl.fa" ), path( "${sample_id}.gff_for_jvci.gff3" ), emit: proteins | ||
path( "${sample_id}.gff_for_jvci.gff3" ), emit: gff | ||
|
||
script: | ||
""" | ||
gffread_unzip.pl ${sample_id} ${fasta} ${gff} | ||
gffread_unzip.pl ${sample_id} ${fasta} ${gff} | ||
""" | ||
} | ||
|
||
|
||
|
Oops, something went wrong.