有时候reads文件太大,是不是 需要进行分割
split -n 1000 file
分割后的文件 是不是需要 加上 : 分割的份数+样本名
#!/bin/bash
for name in `ls -d S2* | grep -v gz`
do
# echo cd $name
cd $name;
count=0
for z in `ls x*`
do
count=$((${count}+1))
echo -n cd "./aftersale/0828/"$name " && "
echo -n "/bin/mv" ${z} ${name}_00${count}.fastq " && "
echo "/bin/gzip" ${name}_00${count}.fastq
done
cd ..;
done
对分割后的reads进行行数检查
for sample in $(ls | awk -F "_" '{print $1}' | sort -u)
do
numble_split_one=`zcat $sample*_1_* | wc -l `
numble_split_two=`zcat $sample*_2_* | wc -l`
if [ $numble_split_one -ne $numble_split_two ];then
echo $sample "read1不等于read2"
fi
lane1="./raw_data/"$sample"/"$sample"_*_1.fq.gz"
lane2="./raw_data/"$sample"/"$sample"_*_2.fq.gz"
numble_raw_one=`zcat $lane1 | wc -l `
numble_raw_two=`zcat $lane2 | wc -l `
if [ $numble_split_one -ne $numble_split_two ];then
echo $lane1 "不等于"$lane2
fi
if [ $numble_split_one -ne $numble_raw_one ];then
echo $sample "有错误"
fi
if [ $numble_split_two -ne $numble_raw_two ];then
echo $sample "有错误"
fi
done
网友评论