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
        Recent Advances in Sequencing Analysis Tools
        by seqadmin


        The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
        05-06-2024, 07:48 AM
      • 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

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 06:57 AM
      0 responses
      11 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-06-2024, 07:17 AM
      0 responses
      16 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-02-2024, 08:06 AM
      0 responses
      19 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-30-2024, 12:17 PM
      0 responses
      24 views
      0 likes
      Last Post seqadmin  
      Working...
      X