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

User provided annotations for genbank submission #190

Merged
merged 3 commits into from
Apr 4, 2024
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
386 changes: 386 additions & 0 deletions assets/sample_annotations/mpox/NY0007_reformatted.gff

Large diffs are not rendered by default.

386 changes: 386 additions & 0 deletions assets/sample_annotations/mpox/OH0002_reformatted.gff

Large diffs are not rendered by default.

386 changes: 386 additions & 0 deletions assets/sample_annotations/mpox/TX0001_reformatted.gff

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
54 changes: 19 additions & 35 deletions workflows/tostadas.nf
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,24 @@ workflow TOSTADAS {
fastq1 = row.fastq_path_1 ? file(row.fastq_path_1) : null
fastq2 = row.fastq_path_2 ? file(row.fastq_path_2) : null
meta = [id:row.sequence_name]
[meta, fasta_path, fastq1, fastq2]
gff = row.gff_path ? file(row.gff_path) : null
if (gff == null) {
[meta, fasta_path, fastq1, fastq2]
}
else {
[meta, fasta_path, fastq1, fastq2, gff]
}
}

// Create initial submission channel
submission_ch = metadata_ch.join(reads_ch)

// print error if they provide gff and annotation flag
// if ( !params.annotation && params.genbank ) {
// // todo: make an error msg that follows the rest of the code protocol
// throw new Exception("Cannot submit to GenBank without assembly and annotation files")
// }

// check if the user wants to skip annotation or not
if ( params.annotation ) {
if ( params.virus && !params.bacteria ) {
Expand Down Expand Up @@ -137,46 +149,18 @@ workflow TOSTADAS {

// run submission for the annotated samples
if ( params.submission ) {

// pre submission process + get wait time (parallel)
GET_WAIT_TIME (
METADATA_VALIDATION.out.tsv_Files.collect()
)

// check if annotation is set to true
if ( params.annotation ) {
if (params.sra && params.genbank ) { // sra and genbank
INITIAL_SUBMISSION (
submission_ch, // meta.id, fasta, fastq1, fastq2, gff
params.submission_config,
GET_WAIT_TIME.out
)
}
else {
if (! params.sra && params.genbank ) { // only genebankk
INITIAL_SUBMISSION (
submission_ch, // meta.id, fasta, "", "", gff
params.submission_config,
GET_WAIT_TIME.out
)
}
}
}
}
if ( !params.annotation && params.sra ) { // no annotation only fastq submission

INITIAL_SUBMISSION (
submission_ch, // meta.id, "", fastq1, fastq2, gff
params.submission_config,
GET_WAIT_TIME.out
INITIAL_SUBMISSION (
submission_ch, // meta.id, fasta, fastq1, fastq2, gff
params.submission_config,
GET_WAIT_TIME.out
)
}
if ( !params.annotation && params.genbank ) {
// todo: make an error msg that follows the rest of the code protocol
throw new Exception("Cannot submit to GenBank without assembly and annotation files")
}

// todo test update submission
}
// to do remove if not needed
if ( params.update_submission ) {
UPDATE_SUBMISSION (
'',
Expand Down