zoukankan      html  css  js  c++  java
  • 统计碱基数目、GC含量、read数、最长的read、最短的read及平均read长度

    # 用于fasta格式文件的碱基数目和GC含量的统计

    grep -v '>' input.fa| perl -ne  '{$count_A=$count_A+($_=~tr/A//);$count_T=$count_T+($_=~tr/T//);$count_G=$count_G+($_=~tr/G//);$count_C=$count_C+($_=~tr/C//);$count_N=$count_N+($_=~tr/N//)};END{print qq{total count is },$count_A+$count_T+$count_G+$count_C+$count_N, qq{ GC%:},($count_G+$count_C)/($count_A+$count_T+$count_G+$count_C+$cont_N),qq{ } }'

    # 用于fastq格式文件的read数、碱基数、最长的read、最短的read及平均read长度

    perl -ne 'BEGIN{$min=1e10;$max=0;}next if ($.%4);chomp;$read_count++;$cur_length=length($_);$total_length+=$cur_length;$min=$min>$cur_length?$cur_length:$min;$max=$max<$cur_length?$cur_length:$max;END{print qq{Totally $read_count reads Totally $total_length bases MAX length is $max bp MIN length is $min bp Mean length is },$total_length/$read_count,qq{ bp }}' input.fq

    # 用于fasta格式文件的read数、碱基数、最长的read、最短的read及平均read长度

    perl -ne 'BEGIN{$min=1e10;$max=0;}next if ($.%2);chomp;$read_count++;$cur_length=length($_);$total_length+=$cur_length;$min=$min>$cur_length?$cur_length:$min;$max=$max<$cur_length?$cur_length:$max;END{print qq{Totally $read_count reads Totally $total_length bases MAX length is $max bp MIN length is $min bp Mean length is },$total_length/$read_count,qq{ bp }}' input.fa

  • 相关阅读:
    Java 构造方法总结
    Intellij IDEA使用总结
    阿里巴巴Java开发手册
    灰度发布策略
    php redis 命令合集
    php redis 常用方法
    php excel 设置单元格格式为文本格式
    php curl get post 方法的封装
    PHP 判断手机号归属地 和 运营商的免费接口
    lnmp centos7 memcache服务器端 和 memcache memcached扩展的安装
  • 原文地址:https://www.cnblogs.com/Datapotumas/p/6306186.html
Copyright © 2011-2022 走看看