Batch convert .dsrc to .fastq
2
0
Entering edit mode
7.6 years ago
emblake ▴ 90

I am using the DSRC toolkit to decompress many RNA-seq .dsrc files to .fastq, and I would like to batch convert multiple files at once. When I run,

for i in *.dsrc ; do dsrc d -t63 -s $i > $i.fastq ; done

the files have a .dsrc.fastq extension. How do I remove the .dsrc from the file name? Thanks in advance.

rna-seq • 2.3k views
ADD COMMENT
1
Entering edit mode
7.6 years ago
emblake ▴ 90

The correct bash parameter is ${i%.*}, as in: for i in *.dsrc ; do dsrc d -t63 -s $i > ${i%.*}.fastq ; done.

ADD COMMENT
1
Entering edit mode
7.6 years ago
Eric Lim ★ 2.1k

for i in *.dsrc ; do dsrc d -t63 -s $i > ${i%.*}.fastq ; done

Duplicated answer.

ADD COMMENT
0
Entering edit mode

Yup! :) I figured it out shortly after posting. Thanks!

ADD REPLY

Login before adding your answer.

Traffic: 2955 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