美文网首页
reads改名+压缩_0829

reads改名+压缩_0829

作者: rong酱 | 来源:发表于2020-08-29 16:35 被阅读0次

    有时候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
    

    相关文章

      网友评论

          本文标题:reads改名+压缩_0829

          本文链接:https://www.haomeiwen.com/subject/bxljsktx.html