Generate fastq_list file from shell

In practice, I feel it is more convenient to put the absolute path of fastq files in a single text file, and put this text file to some analysis pipeline. The following BASH code shows an example of generate such a fastq_list file that includes all the fastq files has more than 1,000,000 bytes.

for i in *.fastq;
 do size=$(stat -c%s "$i");
 if [ $size -gt 1000000 ]; then 
   echo /home/me/reads/$i;
 fi;
done> fastq_list.txt
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s