text-processing
awk
text-formatting
以下からタブ区切りのファイルをダウンロードしました。ここ: ##gff-version 3
#!gff-spec-version 1.21
#!processor NCBI annotwriter
#!genome-build Nsyl
#!genome-build-accession NCBI_Assembly:GCF_000393655.1
#!annotation-source NCBI Nicotiana sylvestris Annotation Release 100
##sequence-region NW_009338801.1 1 504
##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=4096
NW_009338801.1 RefSeq region 1 504 . + . ID=NW_009338801.1:1..504;Dbxref=taxon:4096;Name=Unknown;bio-material=USDA:TW 136;chrom
osome=Unknown;gbkey=Src;genome=genomic;mol_type=genomic DNA;tissue-type=leaf
##sequence-region NW_009338802.1 1 9484
##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=4096
NW_009338802.1 RefSeq region 1 9484 . + . ID=NW_009338802.1:1..9484;Dbxref=taxon:4096;Name=Unknown;bio-material=USDA:TW 136;chro
mosome=Unknown;gbkey=Src;genome=genomic;mol_type=genomic DNA;tissue-type=leaf
##sequence-region NW_009338803.1 1 7523
##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=4096
NW_009338803.1 RefSeq region 1 7523 . + . ID=NW_009338803.1:1..7523;Dbxref=taxon:4096;Name=Unknown;bio-material=USDA:TW 136;chro
mosome=Unknown;gbkey=Src;genome=genomic;mol_type=genomic DNA;tissue-type=leaf
##sequence-region NW_009338804.1 1 46372
##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=4096
NW_009338804.1 RefSeq region 1 46372 . + . ID=NW_009338804.1:1..46372;Dbxref=taxon:4096;Name=Unknown;bio-material=USDA:TW 136;chr
omosome=Unknown;gbkey=Src;genome=genomic;mol_type=genomic DNA;tissue-type=leaf
NW_009338804.1 Gnomon pseudogene 32822 34172 . - . ID=gene-LOC104209938;Dbxref=GeneID:104209938;Name=LOC104209938;gbkey=Gene;gene
=LOC104209938;gene_biotype=pseudogene;pseudo=true
NW_009338804.1 Gnomon exon 32822 34172 . - . ID=id-LOC104209938-1;Parent=gene-LOC104209938;Dbxref=GeneID:104209938;exon_number=1;gb
key=exon;gene=LOC104209938;model_evidence=Supporting evidence includes similarity to: 2 Proteins;number=1
##sequence-region NW_009338805.1 1 53328
##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=4096
NW_009338805.1 RefSeq region 1 53328 . + . ID=NW_009338805.1:1..53328;Dbxref=taxon:4096;Name=Unknown;bio-material=USDA:TW 136;chr
omosome=Unknown;gbkey=Src;genome=genomic;mol_type=genomic DNA;tissue-type=leaf
NW_009338805.1 Gnomon gene 10570 12535 . - . ID=gene-LOC104217587;Dbxref=GeneID:104217587;Name=LOC104217587;gbkey=Gene;gene=LOC1042
17587;gene_biotype=protein_coding
NW_009338805.1 Gnomon mRNA 10570 12535 . - . ID=rna-XM_009770987.1;Parent=gene-LOC104217587;Dbxref=GeneID:104217587,Genbank:XM_0097
70987.1;Name=XM_009770987.1;gbkey=mRNA;gene=LOC104217587;model_evidence=Supporting evidence includes similarity to: 100%25 coverage of the annotated genomic f
eature by RNAseq alignments%2C including 2 samples with support for all annotated introns;product=ribosome-interacting GTPase 1-like;transcript_id=XM_00977098
7.1
NW_009338805.1 Gnomon exon 12140 12535 . - . ID=exon-XM_009770987.1-1;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XM_
009770987.1;gbkey=mRNA;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;transcript_id=XM_009770987.1
NW_009338805.1 Gnomon exon 11826 11939 . - . ID=exon-XM_009770987.1-2;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XM_009770987.1;gbkey=mRNA;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;transcript_id=XM_009770987.1
NW_009338805.1 Gnomon exon 11521 11695 . - . ID=exon-XM_009770987.1-3;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XM_009770987.1;gbkey=mRNA;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;transcript_id=XM_009770987.1
NW_009338805.1 Gnomon exon 10570 10889 . - . ID=exon-XM_009770987.1-4;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XM_009770987.1;gbkey=mRNA;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;transcript_id=XM_009770987.1
NW_009338805.1 Gnomon CDS 12140 12154 . - 0 ID=cds-XP_009769289.1;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XP_009769289.1;Name=XP_009769289.1;gbkey=CDS;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;protein_id=XP_009769289.1
NW_009338805.1 Gnomon CDS 11826 11939 . - 0 ID=cds-XP_009769289.1;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XP_009769289.1;Name=XP_009769289.1;gbkey=CDS;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;protein_id=XP_009769289.1
NW_009338805.1 Gnomon CDS 11521 11695 . - 0 ID=cds-XP_009769289.1;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XP_009769289.1;Name=XP_009769289.1;gbkey=CDS;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;protein_id=XP_009769289.1
NW_009338805.1 Gnomon CDS 10813 10889 . - 2 ID=cds-XP_009769289.1;Parent=rna-XM_009770987.1;Dbxref=GeneID:104217587,Genbank:XP_009769289.1;Name=XP_009769289.1;gbkey=CDS;gene=LOC104217587;product=ribosome-interacting GTPase 1-like;protein_id=XP_009769289.1
...
次のコマンドは、NW_009592716.1.lst、NC_007500.1.lstなど、さまざまな列名に対して複数のファイルを生成できません。 cat GCF_000393655.1_Nsyl_genomic.gff |awk '$3=="CDS"' |
sed 's/;/\t/g' |
awk '{print $1,$7,$12}' |
sed 's/Name=//g' |
awk 'substr($3,11,11)==1 {print $3$2,$1}' |
sort |
uniq |
awk '{print >> $2 ".lst"; close($2)}'
複数のファイルの代わりに1つのファイルのみを生成します。 $ head NC_007500.1.lst
YP_358649.1- NC_007500.1
YP_358650.1+ NC_007500.1
YP_358650.1- NC_007500.1
YP_358651.1- NC_007500.1
YP_358652.1- NC_007500.1
YP_358653.1- NC_007500.1
YP_358654.1+ NC_007500.1
YP_358655.1+ NC_007500.1
YP_358656.1+ NC_007500.1
YP_358657.1- NC_007500.1
...
上記のコマンドを他の文字列の長さに許可するにはどうすればよいですか? よろしくお願いします。
Admin
2024-10-25