This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Run merge-paired-reads script for multiple files at the same time (SortMeRNA)

Hello everybody. right now I'm trying to assemble the fast q files with reverse and forward read with the SortMeRNA script and then filter (r RNA). but however, I have a lot of files. I would like to know it is possible to launch a script that takes my first script (merge-paired-reads.sh) and does the work on all on all my files.

how does work merge-paired-reads.sh:

bash scripts/merge-paired-reads.sh file_R1.fastq file_R2.fastq combined.fastq.

I have lot of files like this (54 to be precise):

example :

SRR3571052_1.fastq
SRR3571064_1.fastq
SRR3571072_1.fastq
SRR3571148_1.fastq
SRR3571158_1.fastq
SRR3571167_1.fastq
SRR3571179_1.fastq
SRR3571052_2.fastq
alignment assembly genome

Thank you so much Pierre ( Merci beaucoup ) !

Another Question , it possible to delete old files ( ${F}_1.fastq ${F}_2.fastq ${F} ) to save hard drive space at the same time ?

Encore Merci !

it's a very basic bash question , consider this as an exercise.

Thank you so much again but i don't know, how and where i can put this condition rm -f ${F}_1.fastq* {F}_2.fastq* ?

Never delete original data files unless you have a backup. You will regret doing that later, if something goes wrong and you need to start over.

Thank you for response but I have a backup and no more space so I need to know how delete forward and reverse at the same time.

Hi, could you please share the dummy code which I can relate to, for the whole workflow (uncompressing, merging,sortMeRNA, unmerging). as I am a newbie for programming. I have the same problem. Thanks in advance.

2 answers

find . -type f -name  "*_1.fastq" | sed 's/_1.fastq$//'   | while read F; do bash scripts/merge-paired-reads.sh ${F}_1.fastq ${F}_2.fastq ${F}.combined.fastq ; done

Hi, could you please share the dummy code which I can relate to, for the whole workflow (uncompressing, merging,sortMeRNA, unmerging). as I am a newbie for programming. I have the same problem. Thanks in advance.

Log in to answer this question.