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

Fix GFFREAD #435

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Fix GFFREAD #435

wants to merge 4 commits into from

Conversation

ftabaro
Copy link

@ftabaro ftabaro commented Nov 20, 2024

This pull request resolves #432. It fixes the call to GFFREAD by adding a second argument that is an empty list. In addition, this pull requests implement detection of gff file name and passes it as meta.id to GFFREAD generating a coherently named gtf output file.

PR checklist

  • If you've fixed a bug or added code that should be tested, add tests!
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).

@nf-core-bot
Copy link
Member

Warning

Newer version of the nf-core template is available.

Your pipeline is using an old version of the nf-core template: 2.14.1.
Please update your pipeline to the latest version.

For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation.

Copy link
Member

@JoseEspinosa JoseEspinosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @ftabaro!
I suggested several changes to your PR, if you could address them that would be great


workflow PREPARE_GENOME {
take:
genome // string: genome name
genomes // map: genome attributes
prepare_tool_index // string : tool to prepare index for
prepare_tool_index // string : tool to prepare index for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prepare_tool_index // string : tool to prepare index for
prepare_tool_index // string: tool to prepare index for

Comment on lines +54 to 55
ch_fasta = GUNZIP_FASTA([[:], fasta]).gunzip.map { it[1] }
ch_versions = ch_versions.mix(GUNZIP_FASTA.out.versions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually on purpose and not a mistake to align the equals vertically

Suggested change
ch_fasta = GUNZIP_FASTA([[:], fasta]).gunzip.map { it[1] }
ch_versions = ch_versions.mix(GUNZIP_FASTA.out.versions)
ch_fasta = GUNZIP_FASTA([[:], fasta]).gunzip.map { it[1] }
ch_versions = ch_versions.mix(GUNZIP_FASTA.out.versions)

Comment on lines +75 to 76
ch_gff = GUNZIP_GFF([[:], file(gff, checkIfExists: true)]).gunzip.map { it[1] }
ch_versions = ch_versions.mix(GUNZIP_GFF.out.versions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ch_gff = GUNZIP_GFF([[:], file(gff, checkIfExists: true)]).gunzip.map { it[1] }
ch_versions = ch_versions.mix(GUNZIP_GFF.out.versions)
ch_gff = GUNZIP_GFF([[:], file(gff, checkIfExists: true)]).gunzip.map { it[1] }
ch_versions = ch_versions.mix(GUNZIP_GFF.out.versions)

}
ch_gtf = GFFREAD ( [ [:], ch_gff ] ).gtf
else {
ch_gff = Channel.value(file(gff, checkIfExists: true))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ch_gff = Channel.value(file(gff, checkIfExists: true))
ch_gff = Channel.value(file(gff, checkIfExists: true)).map { [ [:], it ] }

Comment on lines +81 to +86

//
// Detect gff file name stripped of extension and .gz
//
extension = (gff - '.gz').tokenize('.')[-1]
id = file(gff).baseName.toString() - '.gz' - ".${extension}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't include this bit as we are not doing it for any of the other files

Suggested change
//
// Detect gff file name stripped of extension and .gz
//
extension = (gff - '.gz').tokenize('.')[-1]
id = file(gff).baseName.toString() - '.gz' - ".${extension}"

Comment on lines +204 to +208
ch_chromap_index = UNTARFILES([[:], chromap_index]).files
ch_versions = ch_versions.mix(UNTARFILES.out.versions)
}
else {
ch_chromap_index = [[:], file(chromap_index)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ch_chromap_index = UNTARFILES([[:], chromap_index]).files
ch_versions = ch_versions.mix(UNTARFILES.out.versions)
}
else {
ch_chromap_index = [[:], file(chromap_index)]
ch_chromap_index = UNTARFILES([[:], chromap_index]).files
ch_versions = ch_versions.mix(UNTARFILES.out.versions)
} else {
ch_chromap_index = [[:], file(chromap_index)]

Comment on lines +210 to +213
}
else {
ch_chromap_index = CHROMAP_INDEX(ch_fasta.map { [[:], it] }).index
ch_versions = ch_versions.mix(CHROMAP_INDEX.out.versions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
else {
ch_chromap_index = CHROMAP_INDEX(ch_fasta.map { [[:], it] }).index
ch_versions = ch_versions.mix(CHROMAP_INDEX.out.versions)
} else {
ch_chromap_index = CHROMAP_INDEX(ch_fasta.map { [[:], it] }).index
ch_versions = ch_versions.mix(CHROMAP_INDEX.out.versions)

Comment on lines +224 to +227
ch_star_index = UNTAR_STAR_INDEX([[:], star_index]).untar.map { it[1] }
ch_versions = ch_versions.mix(UNTAR_STAR_INDEX.out.versions)
}
else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ch_star_index = UNTAR_STAR_INDEX([[:], star_index]).untar.map { it[1] }
ch_versions = ch_versions.mix(UNTAR_STAR_INDEX.out.versions)
}
else {
ch_star_index = UNTAR_STAR_INDEX([[:], star_index]).untar.map { it[1] }
ch_versions = ch_versions.mix(UNTAR_STAR_INDEX.out.versions)
} else {

Comment on lines +230 to +233
}
else {
ch_star_index = STAR_GENOMEGENERATE(ch_fasta, ch_gtf).index
ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
else {
ch_star_index = STAR_GENOMEGENERATE(ch_fasta, ch_gtf).index
ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions)
} else {
ch_star_index = STAR_GENOMEGENERATE(ch_fasta, ch_gtf).index
ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions)

Comment on lines +238 to +248
fasta = ch_fasta // path: genome.fasta
fai = ch_fai // path: genome.fai
gtf = ch_gtf // path: genome.gtf
gene_bed = ch_gene_bed // path: gene.bed
chrom_sizes = ch_chrom_sizes // path: genome.sizes
filtered_bed = ch_genome_filtered_bed // path: *.include_regions.bed
bwa_index = ch_bwa_index // path: bwa/index/
bowtie2_index = ch_bowtie2_index // path: bowtie2/index/
chromap_index = ch_chromap_index // path: genome.index
star_index = ch_star_index // path: star/index/
versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the comments were aligned

Suggested change
fasta = ch_fasta // path: genome.fasta
fai = ch_fai // path: genome.fai
gtf = ch_gtf // path: genome.gtf
gene_bed = ch_gene_bed // path: gene.bed
chrom_sizes = ch_chrom_sizes // path: genome.sizes
filtered_bed = ch_genome_filtered_bed // path: *.include_regions.bed
bwa_index = ch_bwa_index // path: bwa/index/
bowtie2_index = ch_bowtie2_index // path: bowtie2/index/
chromap_index = ch_chromap_index // path: genome.index
star_index = ch_star_index // path: star/index/
versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ]
fasta = ch_fasta // path: genome.fasta
fai = ch_fai // path: genome.fai
gtf = ch_gtf // path: genome.gtf
gene_bed = ch_gene_bed // path: gene.bed
chrom_sizes = ch_chrom_sizes // path: genome.sizes
filtered_bed = ch_genome_filtered_bed // path: *.include_regions.bed
bwa_index = ch_bwa_index // path: bwa/index/
bowtie2_index = ch_bowtie2_index // path: bowtie2/index/
chromap_index = ch_chromap_index // path: genome.index
star_index = ch_star_index // path: star/index/
versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants