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
        Essential Discoveries and Tools in Epitranscriptomics
        by seqadmin




        The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
        04-22-2024, 07:01 AM
      • seqadmin
        Current Approaches to Protein Sequencing
        by seqadmin


        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
        04-04-2024, 04:25 PM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      59 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      57 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      51 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      56 views
      0 likes
      Last Post seqadmin  
      Working...
      X