美文网首页
Filtering the merged metaphlan p

Filtering the merged metaphlan p

作者: 生信学习者2 | 来源:发表于2021-01-11 15:54 被阅读0次
    head -2 raw_profile/all_merge_metaphlan.tsv | tail -1 | awk '{$2=null; print $0}' > filter_profile/phylum.tsv
    cat raw_profile/all_merge_metaphlan.tsv | grep -Ev "UNKNOWN|k__Archaea" | grep "p__" | grep -v "c__" | grep -v "unclassified" | grep -v "noname" | sed 's/.*|p__//g' | awk '{$2=null; print $0}' >> filter_profile/phylum.tsv
    

    Notes:

    1. get the sample names which were the 2nd rows;

    2. use awk '{$2=null; print $0}' to delete the 2nd columns;

    3. remove the "UNKNOWN, Archeaea, unclassified, noname" taxonomy via grep (unclassifed and noname were appeared in metaphlan2 version);

    4. key words p__ match the phylum taxonomic level which we wanna obtain, and the c__ is used to remove other taxonomic levels;

    5. rename the tax name via sed 's/.*|p__//g'

    相关文章

      网友评论

          本文标题:Filtering the merged metaphlan p

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