Transferring FASTQ files using Basemount Illumina

Basemount is a tool provided by Illumina to transfer sequencing files to the local_directory using command line. Today’s challenge for me was picking FASTQ files from different sub-directories transferring to a new one (my_fastq_files)


First you need to install basemount which you can file here how: 

I will not mention about previous steps. So,  going to dive into to the topic right away..

Let’s say you created a basespace_mount directory and successfully able to see your Projects and Runs. In my case I have many different projects and runs in that folder. But I am only interested in Gizem_project1 and Gizem_project2. Those are my run. So what I would like to do; write a command which goes sub-directories and copies fastq.gz files into the local_directory that I created.


Here is the command using “cp” command:

cp basespace_mount/Projects/Gizem_project1/Samples/*/Files/*_001.fastq.gz /user/gizemlevent/my_fastq_files/

cp basespace_mount/Projects/Gizem_project2/Samples/*/Files/*_001.fastq.gz /user/gizemlevent/my_fastq_files/


Alternatively with “rsync” command

rsync -arv –include “*/” –include “*fastq.gz” –exclude “*” –prune-empty-dirs  /scratch/user/gizemlevent/basespace_mount/Projects/Gizem_project1 /scratch/user/gizemlevent/my_fastq_Files2/


rsync comand is usefull if you have same file names containing ” fastq.gz” files. Basically, rsync will transfer all fastq.gz files along with the directory paths related to the files. Whereas, cp will only copy the files. I hope this was helpful.


If you put the –dry-run option (see below) you can echo what will be copied.

rsync -arv –include “*/” –include “*fastq.gz” –exclude “*” –prune-empty-dirs –dry-run /scratch/user/gizemlevent/basespace_mount/Projects/Gizem_project1 /scratch/user/gizemlevent/my_fastq_Files2/


Leave a Reply