Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ensembl database fetch sequence problem

    hello
    i just download the mySQL data from Ensembl
    and successful construct the database (homo spaien core 73)
    but my problem is if i had a ENST ID (ex: ENST00000575820)
    how do i fetch the sequence via the database?
    i already read the manual but haven't found any info how to do it.
    plz help me , thanks!

  • #2
    It's not straight forward, since you'll need to retrieve all the exons and join them by hand.
    Here's a bit of Python + SQL that yields all transcript_id->cDNA pairs - I'm sure you can adapt it (works for any revision >= 65)
    You'll also need your own reverse complement function...

    Code:
          cur.execute("""SELECT 
                            exon.seq_region_id, 
                            exon.seq_region_start, 
                            exon.seq_region_end, 
                            exon.seq_region_strand,
                            transcript.stable_id
                            FROM
                            exon, exon_transcript, transcript, seq_region
                            WHERE
                            exon.exon_id = exon_transcript.exon_id AND
                            transcript.transcript_id = exon_transcript.transcript_id 
                            AND seq_region.seq_region_id = exon.seq_region_id
                            AND seq_region.seq_region_id = %s
                            ORDER by exon_transcript.transcript_id, exon.seq_region_start
                            """, ( seq_region_id,))
                chr_seq = self.get_chromosome_sequence(conn, seq_region_id, seq_region_length)
    
                for transcript_id, rows in itertools.groupby(cur.fetchall(), lambda x: x[4]):
                    rows = list(rows)
                    strand = rows[0][3] 
                    seqs = []
                    #print transcript_id, rows
                    for row in rows:
                        seqs.append(chr_seq[row[1] - 1:row[2]]) #ensembl intervals are 1 based, inclusive.
                    if strand == 1:
                        seq = "".join(seqs)
                    else:
                        seq = common.reverse_complement("".join(seqs)).upper()
                    found = True
                    yield (transcript_id, seq)
    Best regards,
    F

    Comment


    • #3
      We suggest the Ensembl Core Perl API or REST API for getting sequences from genes and transcripts. The MySQL query as you see is inefficient and involved, and the APIs are designed for fast and simpler querying:



      Comment

      Latest Articles

      Collapse

      • seqadmin
        Strategies for Sequencing Challenging Samples
        by seqadmin


        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
        03-22-2024, 06:39 AM
      • seqadmin
        Techniques and Challenges in Conservation Genomics
        by seqadmin



        The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

        Avian Conservation
        Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
        03-08-2024, 10:41 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 06:37 PM
      0 responses
      12 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, Yesterday, 06:07 PM
      0 responses
      10 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-22-2024, 10:03 AM
      0 responses
      52 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-21-2024, 07:32 AM
      0 responses
      68 views
      0 likes
      Last Post seqadmin  
      Working...
      X