我在同一纳米样品平台上运行了两次相同的样品,运行了两次。现在,我想合并每次运行生成的96个条形码文件。
所以我在文件夹中的文件都是从条形码01到条形码96这样的
RUN1 RUN2
barcode01_filt.fastq.gz barcode01_filt.fastq.gz
现在我想,如果每个它们合并到一个单一的文件到另一个folder.The输出进出口寻找是合并后的条形码RUN1
,并RUN2
到另一个文件夹RUN3
具有相同名称barcode01_filt.fastq.gz
任何建议或帮助将不胜感激。
更新
因此,林将问题分解为小块。首先,我将两者都放入一个文件夹中。
现在我正在两个文件夹中寻找文件
find Cov1_run/ -name "*filt.fastq.gz"
下一步将是如果两个文件夹中的名称都匹配,然后将它们合并。
上面的find命令的输出
Cov1_run/RUN2/barcode05_filt.fastq.gz
Cov1_run/RUN2/barcode68_filt.fastq.gz
Cov1_run/RUN2/barcode34_filt.fastq.gz
Cov1_run/RUN2/barcode82_filt.fastq.gz
Cov1_run/RUN2/barcode61_filt.fastq.gz
Cov1_run/RUN2/barcode69_filt.fastq.gz
Cov1_run/RUN2/barcode18_filt.fastq.gz
Cov1_run/RUN1/barcode05_filt.fastq.gz
Cov1_run/RUN/barcode68_filt.fastq.gz
Cov1_run/RUN1/barcode34_filt.fastq.gz
Cov1_run/RUN1/barcode82_filt.fastq.gz
Cov1_run/RUN1/barcode61_filt.fastq.gz
Cov1_run/RUN1/barcode69_filt.fastq.gz
Cov1_run/RUN1/barcode18_filt.fastq.gz
所以现在我必须进行匹配,例如,如果两个名称都相同,然后将它们合并为相同的名称,但是在不同的文件夹中
RUN1 barcode05_filt.fastq.gz and RUN2 barcode05_filt.fastq.gz
未经测试和概念性的,因为太大而无法评论:
cd RUN1
for fa in *.fastq.gz ; do
# Deduce name of friend
fb="../RUN2/$fa"
if [ -f "$fb" ] ; then
cat "$fa" "$fb" > "../RUN3/$fa"
fi
done
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句