llinux查看样本为单端测序还是双端测序:
# cat findfile.test.sh
samples=$(for i in $(ls *_R1*.fastq.gz);do echo "${i%%_*}";done)
for ID in $samples
do
if [ -f ${ID}*R2*fastq.gz ];then
echo PE ${ID}*R1*fastq.gz ${ID}*R2*fastq.gz
else
echo SE ${ID}*R1*fastq.gz
fi
done
分隔文件名称,去除扩展名,得到样本名称列表:
sh findfile.test.sh | grep PE | awk '{print $2}' | awk '{split($0,a,"_");print a[1]}' > PE.files.txt
sh findfile.test.sh | grep SE | awk '{print $2}' | awk '{split($0,a,"_");print a[1]}' > SE.files.txt
网友评论