0

I have this input:

##gff-version 3
chr1    TAIR10  mRNA    3631    5899    .   +   .   ID AT1G01010.1 ;geneID AT1G01010 ;gene_name AT1G01010
chr1    TAIR10  exon    3631    3913    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    3996    4276    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    4486    4605    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    4706    5095    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    5174    5326    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    5439    5899    .   +   .   Parent AT1G01010.1

I want that the ID, geneID, and gene_name have double quotes like the next output:

  ##gff-version 3
    chr1    TAIR10  mRNA    3631    5899    .   +   .   ID "AT1G01010.1" ;geneID "AT1G01010" ;gene_name "AT1G01010"
    chr1    TAIR10  exon    3631    3913    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    3996    4276    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    4486    4605    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    4706    5095    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    5174    5326    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    5439    5899    .   +   .   Parent "AT1G01010.1"

I have been testing with

awk '{sub($10, "\"&\""); print}' file.gtf

Thanks for read my question

0

quick and dirty

sed -E 's#(ID|Parent|gene_name) ([0-9A-Za-z.]+)#\1 \"\2\"#g'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.