datacarpentry/shell-genomics

Lesson contribution - instructor checkout - rename command

NextGenBioinformatics opened this issue · 2 comments

Link: https://datacarpentry.org/shell-genomics/03-working-with-files/index.html

Section: Moving / Renaming

I would like to suggest introducing a new command "rename" in this section as it allows the renaming of a number of FASTQ files at once when there is a need to standardise the names of FASTQ files to meet the requirement of those tools as well as make the names more readable for the downstream analysis.

Rename syntax:

rename expression replacement file

For paired-end reads:

Example command line:

rename _R1_001 .R1 *_R1_001.fastq
rename _R2_001 .R2 *_R2_001.fastq

Before change:

Sample1_R1_001.fastq
Sample1_R2_001.fastq
Sample2_R1_001.fastq
Sample2_R2_001.fastq
Sample3_R1_001.fastq
Sample3_R2_001.fastq

After change:

Sample1.R1.fastq
Sample1.R2.fastq
Sample2.R1.fastq
Sample2.R2.fastq
Sample3.R1.fastq
Sample3.R2.fastq

For single-end reads:

Example command line:

rename _R1_001. . *_R1_001.fastq

Before change:

Sample1_R1_001.fastq
Sample2_R1_001.fastq
Sample3_R1_001.fastq
Sample4_R1_001.fastq

After change:

Sample1.fastq
Sample2.fastq
Sample3.fastq
Sample4.fastq

Hi @NextGenBioinformatics, thank you for sending in your suggestion!

The shell genomics lesson consists with most common commands used by most users and each lesson is tied to the workshop teaching time. While rename is very useful, expanding the content would increase the lesson teaching time. Based on my understanding, the workshop already fits the allotted time with its current content. Though, individual instructors could still introduce and teach rename at workshops.

I am open to adding rename, but I would prefer not to compromise on the total workshop time. What do think, @datacarpentry/shell-genomics-maintainers?

Hi @akshayparopkari I would agree. This is already quite a long lesson and might be folks' first introduction to the shell, so I would err on the side of NOT adding additional new commands at this moment. Additionally, and perhaps what is an even bigger issue, is that rename is not available natively on all operating systems without install. For example, I had to install it on my Mac using Homebrew, and extra installs always seem to open up a can of worms with keeping everyone on track during a workshop.

So, for now I am going to close this issue without making any modifications, but thank you @NextGenBioinformatics very much for your suggestion. You are more than welcome to introduce rename at your discretion as a side note when you teach this workshop.