Pandaseq in a bash for-loop - Error nofile
1
0
Entering edit mode
8.2 years ago
fibar ▴ 90

I'm merging R1 and R2 files derived from 16S rRNA miseq amplicon-sequencing, and I'd like to perform it on several samples at once. This is my script:

for r1 in *R1*;
do
r2=${r1/R1/R2};
pandaseq -f $r1 -r $r2 -o 10 -w ${r1/R1_001.sic.00.0_0.cor.fastq/pandaseq.fasta};
done

The screen output says this for all my R1 files:

ERR    NOFILE    Order-89-1-1_S1_L001_R1_001.sic.00.0_0.cor.fastq
Too confused to continue.
Try -h for help.

Is there something missing in that script? Thanks a lot!

for-loop pandaseq linux bash • 2.7k views
ADD COMMENT
0
Entering edit mode

#TIL in-line replace in bash variables (the {//} syntax). Thank you.

ADD REPLY
0
Entering edit mode

Hi Fibar..I have the same problem.. Can you please let me know your email..so i can write in detail

Regards Mukil

ADD REPLY
0
Entering edit mode

So the solution mentioned below did not work for you?

@fibar has not been seen on Biostars for over a year so your best bet may be to create a new post/thread to describe your problem.

ADD REPLY
0
Entering edit mode

@fibar: post example file list. File list you have and code you are using. please don't post screenshots unless it is error.

ADD REPLY
0
Entering edit mode

Hi, I'm sorry for the poor post. @mxm2623 Please read the solution below.

ADD REPLY
0
Entering edit mode

@fibar.. I am confused. Was this thread edited? Looking at my post, it seems it is unnecessary to tag you in my post (9 days ago). If so, I am sorry.

ADD REPLY
0
Entering edit mode

No you did not tag Fibar. You can't tag a user by just using "@"name. You need to paste their biostar profile link URL in a post.

@Fibar probably had "follow via email" set up for this thread and thus came back to respond.

ADD REPLY
0
Entering edit mode

@genomax! My concern was i unnecessarily directed my post @Fibar for some unknown reason. For that I was sorry.

ADD REPLY
0
Entering edit mode
8.2 years ago
fibar ▴ 90

I found a long solution, but it works. It was a matter of working on that last in-line replacement for the output (w).

#1

for r1 in *R1*;
do
    r2=${r1/R1/R2};
    pandaseq -f $r1 -r $r2 -o 10 -w ${r1/R1/pandaseq};
done

#2

mkdir pandaseq

#3

mv *pandaseq.fastq pandaseq

#4

for r1 in pandaseq/*fastq;
    do
    mv $r1 ${r1/fastq/fasta};
done

This generates now a merged file for each sample, kept in a separate folder.

ADD COMMENT

Login before adding your answer.

Traffic: 2065 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6