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

Catch identical filenames #192

Open
MarieLataretu opened this issue Jan 13, 2022 · 5 comments
Open

Catch identical filenames #192

MarieLataretu opened this issue Jan 13, 2022 · 5 comments
Assignees

Comments

@MarieLataretu
Copy link
Collaborator

MarieLataretu commented Jan 13, 2022

I suggest to change simpleName to baseName here:

.map { file -> tuple(file.simpleName, file) }

(and potentially somewhere else) to avoid problems with file names with more than one ..

Else or in addition a sanity check for identical file names would be good.


Context: https://www.nextflow.io/docs/latest/script.html#check-file-attributes

@replikation
Copy link
Owner

maybe there is a way to just remove the ".fastq.gz" or ".fastq" ? because with basename the .fastq remains in the sample names

@hoelzer
Copy link
Collaborator

hoelzer commented Jan 13, 2022

But then we should also cover .fq, .fq.gz ... on the other hand it's not the worst when the sample names still have the .fq extension but the pipeline still runs through ;) just if we miss some weired file end

@MarieLataretu
Copy link
Collaborator Author

because with basename the .fastq remains in the sample names

True, haven't thought about that.


Here a code snippet for the sanity check

Channel
    .from('Hello','Hola','Ciao')
    .tap {all} // to conserve the original channel
    .collect()
    .map{ it -> [it.size(), it.unique().size()]}
    .subscribe onNext: { 
        assert it[0] == it[1]
    }

@replikation
Copy link
Owner

ping @DataSpott

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

No branches or pull requests

4 participants