n行飛ばしてhead

n行飛ばしてhead

NGS関連のファイルは頭にバージョン情報などが記載されていることがあり、加工したいときには邪魔だったりする。

!gaf-version: 2.1
!
!This file contains all GO annotations and gene product information for proteins in the UniProt KnowledgeBase (UniProtKB),
!ComplexPortal protein complexes, and RNAcentral identifiers.
!
!Generated: 2018-04-23 14:22
!GO-version: http://purl.obolibrary.org/obo/go/releases/2018-04-20/extensions/go-plus.owl
!
UniProtKB       A0A000  moeA5           GO:0003824      GO_REF:0000002  IEA     InterPro:IPR015421|InterPro:IPR015422   F       MoeA5   A0A000_STRVD|moeA5      protein taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0003870      GO_REF:0000002  IEA     InterPro:IPR010961      F       MoeA5   A0A000_STRVD|moeA5      protein taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0009058      GO_REF:0000002  IEA     InterPro:IPR004839      P       MoeA5   A0A000_STRVD|moeA5      protein taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0030170      GO_REF:0000002  IEA     InterPro:IPR004839|InterPro:IPR010961   F       MoeA5   A0A000_STRVD|moeA5      protein taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0033014      GO_REF:0000002  IEA     InterPro:IPR010961      P       MoeA5   A0A000_STRVD|moeA5      protein taxon:67581     20180421        InterPro
UniProtKB       A0A001  moeD5           GO:0000166      GO_REF:0000038  IEA     UniProtKB-KW:KW-0547    F       MoeD5   A0A001_STRVD|moeD5      protein taxon:67581     20180421        UniProt

この最初の8行を飛ばしてファイルの本体を覗きたいときはtailコマンドを利用する。

tail -n +9 goa_uniprot_all.gaf | head
UniProtKB       A0A000  moeA5           GO:0003824      GO_REF:0000002  IEA     InterPro:IPR015421|InterPro:IPR015422   F       MoeA5   A0A000_STRVD|moeA5       protein taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0003870      GO_REF:0000002  IEA     InterPro:IPR010961      F       MoeA5   A0A000_STRVD|moeA5      protein  taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0009058      GO_REF:0000002  IEA     InterPro:IPR004839      P       MoeA5   A0A000_STRVD|moeA5      protein  taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0030170      GO_REF:0000002  IEA     InterPro:IPR004839|InterPro:IPR010961   F       MoeA5   A0A000_STRVD|moeA5       protein taxon:67581     20180421        InterPro
UniProtKB       A0A000  moeA5           GO:0033014      GO_REF:0000002  IEA     InterPro:IPR010961      P       MoeA5   A0A000_STRVD|moeA5      protein  taxon:67581     20180421        InterPro
UniProtKB       A0A001  moeD5           GO:0000166      GO_REF:0000038  IEA     UniProtKB-KW:KW-0547    F       MoeD5   A0A001_STRVD|moeD5      protein  taxon:67581     20180421        UniProt
UniProtKB       A0A001  moeD5           GO:0000166      GO_REF:0000104  IEA     UniRule:UR000400038     F       MoeD5   A0A001_STRVD|moeD5      protein  taxon:67581     20180421        UniProt
UniProtKB       A0A001  moeD5           GO:0005524      GO_REF:0000002  IEA     InterPro:IPR003439|InterPro:IPR011527|InterPro:IPR017871|InterPro:IPR036640      F       MoeD5   A0A001_STRVD|moeD5      protein taxon:67581     20180421        InterPro
UniProtKB       A0A001  moeD5           GO:0005524      GO_REF:0000038  IEA     UniProtKB-KW:KW-0067    F       MoeD5   A0A001_STRVD|moeD5      protein  taxon:67581     20180421        UniProt
UniProtKB       A0A001  moeD5           GO:0005524      GO_REF:0000104  IEA     UniRule:UR000400038     F       MoeD5   A0A001_STRVD|moeD5      protein  taxon:67581     20180421        UniProt

意外と使う場面が多い。''+''を忘れないよう注意。

  • n行飛ばしてhead.1526973688.txt.gz
  • 最終更新: 2018/05/22 07:21
  • by 133.11.222.89