but how can i make a vector?
Merging different fastq files into one folder
I have 16S amplicon 80 fastq paired-end data files in 80 different folders but I want all to be in one folder for analysis. How can I do this through R?
• 2,566 views
•
link
2 answers
Do you want to physically move them into a single folder? You should use command line, not R.
Are all folders in the same parent folder? You can make a vector of file paths very easily in R and load them in to R without moving them around.
• 0 views
•
link
• 0 views
•
link
list = list.files(path, recursive = T)
• 0 views
•
link
In linux, use following command:
If your fastq format looks like: sample1_1.fastq.gz sampl1_2.fastq.gz; Folders containing these files are stored in ~/data/fq/sample1/ ~/data/fq/sample2/.
Then:
mv ~/data/fq/*/*.gz ~/data/
It will move all files with ".gz" surffix in each folder to ~/data/
• 0 views
•
link
Log in to answer this question.
so in place of DIR1, DIR2, and DIR3, I will write folder names? And in place of DESTDIR, I will write my new folder name.