Unconfigured Ad

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

    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

      • mylaser
        Reply to Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by mylaser
        Kheloyar – Everything You Need to Know About Kheloyaar Login and Kheoyar Id
        If you are looking for an online gaming platform that offers a user-friendly experience, Kheloyar has become a name that many users search for. Whether you're interested in creating a new account, accessing your dashboard through Kheloyaar Login, or learning how to obtain a Kheoyar Id, understanding the platform's features and account process is essential.
        This guide explains everything you need to know about...
        Today, 01:13 AM
      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM
      • SEQadmin2
        Cancer Drug Resistance: The Lingering Barrier to Rising Survival
        by SEQadmin2



        Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

        There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
        07-08-2026, 05:17 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 07-09-2026, 10:04 AM
      0 responses
      11 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-08-2026, 10:08 AM
      0 responses
      9 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-07-2026, 11:05 AM
      0 responses
      17 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-02-2026, 11:08 AM
      0 responses
      31 views
      0 reactions
      Last Post SEQadmin2  
      Working...