home / WtMTA

BED-formatted introns

Retrieve introns for a single species in BED format. The species parameter accepts a taxonomy ID (e.g. "9606") or a partial species name (e.g. "Homo sapiens" or "sapiens"), but must match exactly one species or no rows are returned. For minor introns, use min_score=90 and max_score=100.

Custom SQL query (hide)

select
  t.chromosome,
  i.start,
  i."end",
  i.id,
  i.score,
  t.strand
from
  introns i
  JOIN transcripts t ON i.transcript_id = t.id
  JOIN genomes g ON i.taxonomy_id = g.taxonomy_id
where
  g.taxonomy_id = (
    select taxonomy_id from genomes
    where
      CASE
        WHEN CAST(:species AS INTEGER) > 0 AND CAST(:species AS TEXT) = :species
        THEN taxonomy_id = CAST(:species AS INTEGER)
        ELSE species LIKE '%' || :species || '%'
      END
    limit 1
  )
  and (
    select count(distinct taxonomy_id) from genomes
    where
      CASE
        WHEN CAST(:species AS INTEGER) > 0 AND CAST(:species AS TEXT) = :species
        THEN taxonomy_id = CAST(:species AS INTEGER)
        ELSE species LIKE '%' || :species || '%'
      END
  ) = 1
  and i.score > :min_score
  and i.score <= :max_score
order by
  t.chromosome, i.start

Query parameters

Edit SQL

0 results

Powered by Datasette · Queries took 6.265ms