Skip to content

Commit

Permalink
Merge pull request #190 from CDCgov/user_provided_annotations_kao
Browse files Browse the repository at this point in the history
User provided annotations for genbank submission
  • Loading branch information
jessicarowell authored Apr 4, 2024
2 parents 8e7cf04 + b462cfc commit 660bdb7
Show file tree
Hide file tree
Showing 14 changed files with 1,177 additions and 35 deletions.
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

0 comments on commit 660bdb7

Please sign in to comment.