Filtering the merged metaphlan p

2021-01-11  本文已影响0人  生信学习者2
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'

上一篇 下一篇

猜你喜欢

热点阅读