Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9150169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:34:37+00:00 2026-06-17T11:34:37+00:00

I tagged python and perl in this only because that’s what I’ve used thus

  • 0

I tagged python and perl in this only because that’s what I’ve used thus far. If anyone knows a better way to go about this I’d certainly be willing to try it out. Anyway, my problem:

I need to create an input file for a gene prediction program that follows the following format:

seq1 5 15
seq1 20 34

seq2 50 48
seq2 45 36

seq3 17 20

Where seq# is the geneID and the numbers to the right are the positions of exons within an open reading frame. Now I have this information, in a .gff3 file that has a lot of other information. I can open this with excel and easily delete the columns with non-relevant data. Here’s how it’s arranged now:

PITG_00002  .   gene    2   397 .   +   .   ID=g.1;Name=ORF%
PITG_00002  .   mRNA    2   397 .   +   .   ID=m.1;
**PITG_00002**  .   exon    **2 397**   .   +   .   ID=m.1.exon1;
PITG_00002  .   CDS 2   397 .   +   .   ID=cds.m.1;

PITG_00004  .   gene    1   1275    .   +   .   ID=g.3;Name=ORF%20g
PITG_00004  .   mRNA    1   1275    .   +   .   ID=m.3;
**PITG_00004**  .   exon    **1 1275**  .   +   .   ID=m.3.exon1;P
PITG_00004  .   CDS 1   1275    .   +   .   ID=cds.m.3;P

PITG_00004  .   gene    1397    1969    .   +   .   ID=g.4;Name=
PITG_00004  .   mRNA    1397    1969    .   +   .   ID=m.4;
**PITG_00004**  .   exon    **1397  1969**  .   +   .   ID=m.4.exon1;
PITG_00004  .   CDS 1397    1969    .   +   .   ID=cds.m.4;

So I need only the data that is in bold. For example,

PITG_0002 2 397

PITG_00004 1 1275
PITG_00004 1397 1969

Any help you could give would be greatly appreciated, thanks!

Edit: Well I messed up the formatting. Anything that is between the **’s is what I need lol.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:34:38+00:00Added an answer on June 17, 2026 at 11:34 am

    It looks like your data is tab-separated.

    This Perl program will print columns 1, 4 and 5 from all records that have exon in the third column. You need to change the file name in the open statement to your actual file name.

    use strict;
    use warnings;
    
    open my $fh, '<', 'genes.gff3' or die $!;
    
    while (<$fh>) {
      chomp;
      my @fields = split /\t/;
      next unless @fields >= 5 and $fields[2] eq 'exon';
      print join("\t", @fields[0,3,4]), "\n";
    }
    

    output

    PITG_00002  2 397
    PITG_00004  1 1275
    PITG_00004  1397  1969
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

before I start I want to point out that I tagged this question as
I tagged this question as javascript because even though I currently wrote this in
Late Edit I tagged this as a C# question as well as C++ because
I tagged this question both Java and Scala because while I mainly develop on
Tagged with [android] so that someone will actually read this, but applies equally to
(I have tagged this question as Python as well since I understand Python code
I have tagged this problem with both Oracle and Java because both Oracle and
I've tagged this post as WordPress, but I'm not entirely sure it's WordPress-specific, so
This post is incorrectly tagged 'send' since I cannot create new tags. I have
I have a list of puzzles that are tagged with specific Themes. Think questions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.