Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shishir
    Member
    • Nov 2012
    • 22

    #1

    parsing the gff file

    Hi all,

    I have a gff file like:

    gn|nvit|C3905550 assmcg CDS 68 646 . - . asmbl_401
    gn|nvit|C3905550 assmcg exon 68 646 . - . asmbl_401
    gn|nvit|C3918365 assmcg CDS 42 252 . + . asmbl_443
    gn|nvit|C3918365 assmcg CDS 522 705 . + . asmbl_443
    gn|nvit|C3918365 assmcg exon 522 705 . + . asmbl_443
    gn|nvit|C3930535 assmcg exon 64 888 . - . asmbl_465
    gn|nvit|C3930535 assmcg three_prime_utr 64 393 . - . asmbl_465
    gn|nvit|C3930535 assmcg CDS 394 699 . - . asmbl_465
    gn|nvit|C3930535 assmcg five_prime_utr 700 888 . - . asmbl_465
    gn|nvit|C3935122 assmcg exon 4 567 . + . asmbl_476
    gn|nvit|C3938828 assmcg CDS 293 745 . + . asmbl_481
    gn|nvit|C3938828 assmcg exon 293 745 . + . asmbl_481
    gn|nvit|C3942486 assmcg CDS 244 942 . - . asmbl_489
    gn|nvit|C3942486 assmcg exon 244 942 . - . asmbl_489
    gn|nvit|C3950921 assmcg exon 40 80 . + . asmbl_506
    gn|nvit|C3950921 assmcg three_prime_utr 40 80 . + . asmbl_506
    gn|nvit|C3950921 assmcg exon 172 253 . + . asmbl_506
    gn|nvit|C3950921 assmcg five_prime_utr 172 190 . + . asmbl_506


    I want to create a list writing all the 'transcript id that have both the three_prime_utr and five_prime_utr corndinates' like
    asmbl_465
    asmbl_506

    I used cat final1.gff | perl -ne 's/.*\t(\S+_prime_utr)\t.*transcript_id \"(\S+)\".*/$2\t$1/; print;' | sort -u | perl -ne 'split; print "$_[0]\n" if ($g eq $_[0]); $g = $_[0];' > myutr_list.txt
    but it did not worked for me.

    Thanks!
    Last edited by Shishir; 09-06-2013, 03:48 AM.
  • dariober
    Senior Member
    • May 2010
    • 311

    #2
    Hi- Try this one:

    Code:
    grep -E 'five_prime_utr|three_prime_utr' final1.gff \
        | cut -f 3,9 \
        | sort -k2,2 -k 1,1 -u \
        | cut -f 2 \
        | uniq -c \
        | awk '{if($1 == 2) print $2}'
    1st line: Get lines with either utr
    2st: Get columns with feature type and gene id
    3rd: Get unique lines (now each gene has one line if it has 3UTR OR 5UTR, two lines if it has both)
    4th: Get only the column of gene name
    5th: Count how many times the gene name is found
    6th: If found two times it must have both UTRs so print it

    See if it works...

    Dario

    Comment

    • Shishir
      Member
      • Nov 2012
      • 22

      #3
      Many thanks! it worked for me.

      Originally posted by dariober View Post
      Hi- Try this one:

      Code:
      grep -E 'five_prime_utr|three_prime_utr' final1.gff \
          | cut -f 3,9 \
          | sort -k2,2 -k 1,1 -u \
          | cut -f 2 \
          | uniq -c \
          | awk '{if($1 == 2) print $2}'
      1st line: Get lines with either utr
      2st: Get columns with feature type and gene id
      3rd: Get unique lines (now each gene has one line if it has 3UTR OR 5UTR, two lines if it has both)
      4th: Get only the column of gene name
      5th: Count how many times the gene name is found
      6th: If found two times it must have both UTRs so print it

      See if it works...

      Dario

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM
      • SEQadmin2
        New Genomics Technologies Take Aim at Long-Standing Limits
        by SEQadmin2


        Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

        We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
        ...
        09-28-2026, 10:25 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, Yesterday, 11:13 AM
      0 responses
      16 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, Yesterday, 10:48 AM
      0 responses
      15 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      35 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      42 views
      0 reactions
      Last Post SEQadmin2  
      Working...