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

Patch concatgffs ick4 #196

Merged
merged 2 commits into from
Apr 10, 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
2 changes: 2 additions & 0 deletions bin/repeatmasker_liftoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def annotation_main():

#gather ref sample id
ref_id=ref_gff['seq_id'][0]
print(f'refgff is {args.refgff}')
print(ref_gff.head())
#gather index of attributes for first and second ITRs; needed for repeatmasker ITR attributes
first_ITR_index=ref_gff[ref_gff['attributes'].str.contains("ITR")].index[0]
last_ITR_index=ref_gff[ref_gff['attributes'].str.contains("ITR")].index[-1]
Expand Down
6 changes: 1 addition & 5 deletions modules/local/concat_gffs/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ process CONCAT_GFFS {

input:
path ref_gff_path
//path repeatmasker_gff
//path liftoff_gff
tuple val(meta), path(repeatmasker_gff), path(liftoff_gff)
tuple val(meta), path(fasta_path), path(fastq_1), path(fastq_2)
tuple val(meta), path(fasta_path), path(fastq_1), path(fastq_2), path(repeatmasker_gff), path(liftoff_gff)

script:
"""
echo "repeatmasker_liftoff.py --repeatm_gff $repeatmasker_gff --liftoff_gff $liftoff_gff --refgff $ref_gff_path --fasta $fasta_path --sample_name $meta.id"
repeatmasker_liftoff.py --repeatm_gff $repeatmasker_gff --liftoff_gff $liftoff_gff --refgff $ref_gff_path --fasta $fasta_path --sample_name $meta.id
"""

Expand Down
13 changes: 6 additions & 7 deletions subworkflows/local/repeatmasker_liftoff.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include { CONCAT_GFFS } from "../../module
workflow REPEATMASKER_LIFTOFF {

take:
fasta
fasta // meta, fasta_path, fastq1, fastq2

main:
// run repeatmasker annotation on files
Expand All @@ -31,24 +31,23 @@ workflow REPEATMASKER_LIFTOFF {
repeatmasker_gff_ch = REPEATMASKER.out.gff.collect().flatten()
.map {
meta = [:]
meta['id'] = [id:it.getSimpleName()]
meta['id'] = it.getSimpleName()
[ meta, it ]
}

liftoff_gff_ch = LIFTOFF_CLI.out.gff.collect().flatten()
.map {
meta = [:]
meta['id'] = [id:it.getSimpleName()]
meta['id'] = it.getSimpleName()
[ meta, it ]
}

concat_gffs_ch = repeatmasker_gff_ch.join(liftoff_gff_ch) // meta.id, fasta, repeatmasker_gff, liftoff_gff
concat_gffs_ch = fasta.join(repeatmasker_gff_ch).join(liftoff_gff_ch) // meta.id, fasta, fastq1, fastq2, repeatmasker_gff, liftoff_gff

// concat gffs
// concat gffs
CONCAT_GFFS (
params.ref_gff_path,
concat_gffs_ch,
fasta
concat_gffs_ch
)

emit:
Expand Down
5 changes: 3 additions & 2 deletions subworkflows/local/submission.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ workflow INITIAL_SUBMISSION {
// drop fasta_path from ch
submission_ch = submission_ch
.map {
it -> [it[0], it[1], it[3], it[4]]
meta, _, fq1, fq2 -> [meta, fq1, fq2]
}
SUBMISSION_SRA ( submission_ch, submission_config )

Expand All @@ -51,7 +51,8 @@ workflow INITIAL_SUBMISSION {
// drop fastq paths
submission_ch = submission_ch
.map {
meta, _, fq1, fq2 -> [meta, fq1, fq2]
it -> [it[0], it[1], it[2], it[5]] // meta, fasta, gff
//meta, fasta, _, _, gff -> [meta, fasta, gff] // duplicate underscore error
}
SUBMISSION_GENBANK ( submission_ch, submission_config )

Expand Down
3 changes: 3 additions & 0 deletions workflows/tostadas.nf
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ workflow TOSTADAS {
GET_WAIT_TIME (
METADATA_VALIDATION.out.tsv_Files.collect()
)

submission_ch.view()

INITIAL_SUBMISSION (
submission_ch, // meta.id, fasta, fastq1, fastq2, gff
params.submission_config,
Expand Down
Loading