Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Table Names

Robert A. Petit III edited this page Sep 28, 2015 · 8 revisions

This page provides a brief overview for each table within the Staphopia database. In order to save time, tables are described from the perspective of the database. For example instead of SNP (the Django model name), variant_snp the actual name in the database will be given. This will allow for easier construction of SQL statements.

Staphopia Tables

Assembly

assembly_stats
        Column            |     Type     |                          Modifiers                          | Storage |

------------------------------|--------------|-------------------------------------------------------------|---------| id | integer | not null default nextval('assembly_stats_id_seq'::regclass) | plain | is_scaffolds | boolean | not null | plain | total_contig | smallint | not null | plain | total_contig_length | integer | not null | plain | min_contig_length | integer | not null | plain | median_contig_length | integer | not null | plain | mean_contig_length | numeric(9,2) | not null | main | max_contig_length | integer | not null | plain | n50_contig_length | integer | not null | plain | l50_contig_count | smallint | not null | plain | ng50_contig_length | integer | not null | plain | lg50_contig_count | smallint | not null | plain | contigs_greater_1k | smallint | not null | plain | contigs_greater_10k | smallint | not null | plain | contigs_greater_100k | smallint | not null | plain | contigs_greater_1m | smallint | not null | plain | percent_contigs_greater_1k | numeric(4,2) | not null | main | percent_contigs_greater_10k | numeric(4,2) | not null | main | percent_contigs_greater_100k | numeric(4,2) | not null | main | percent_contigs_greater_1m | numeric(4,2) | not null | main | contig_percent_a | numeric(4,2) | not null | main | contig_percent_t | numeric(4,2) | not null | main | contig_percent_g | numeric(4,2) | not null | main | contig_percent_c | numeric(4,2) | not null | main | contig_percent_n | numeric(4,2) | not null | main | contig_non_acgtn | numeric(4,2) | not null | main | num_contig_non_acgtn | smallint | not null | plain | sample_id | integer | not null | plain |

Indexes:
    "assembly_stats_pkey" PRIMARY KEY, btree (id)
    "assembly_stats_sample_id_2701b767476a61b7_uniq" UNIQUE CONSTRAINT, btree (sample_id, is_scaffolds)
    "assembly_stats_2242a234" btree (is_scaffolds)
    "assembly_stats_c09c8085" btree (sample_id)

ENA

ena_experiment
       Column           | Type | Modifiers | Storage  |

----------------------------|------|-----------|----------| experiment_accession | text | not null | extended | experiment_title | text | not null | extended | experiment_alias | text | not null | extended | sample_accession | text | not null | extended | secondary_sample_accession | text | not null | extended | submission_accession | text | not null | extended | tax_id | text | not null | extended | scientific_name | text | not null | extended | instrument_platform | text | not null | extended | instrument_model | text | not null | extended | library_layout | text | not null | extended | library_strategy | text | not null | extended | library_selection | text | not null | extended | center_name | text | not null | extended | study_accession | text | not null | extended |

Indexes:
    "ena_experiment_pkey" PRIMARY KEY, btree (experiment_accession)
    "ena_experiment_6a0c5df2" btree (instrument_platform)
    "ena_experiment_8cd0a95d" btree (study_accession)
    "ena_experiment_experiment_accession_78e80ad55e7e5209_like" btree (experiment_accession text_pattern_ops)
    "ena_experiment_instrument_platform_7826b6971eb893db_like" btree (instrument_platform text_pattern_ops)
ena_publication
    Column        |  Type   |                          Modifiers                           | Storage  |

----------------------|---------|--------------------------------------------------------------|----------| id | integer | not null default nextval('ena_publication_id_seq'::regclass) | plain | pmid | text | not null | extended | experiment_accession | text | not null | extended |

Indexes:
    "ena_publication_pkey" PRIMARY KEY, btree (id)
    "ena_publication_experiment_accession_36f9435cdb3ab754_uniq" UNIQUE CONSTRAINT, btree (experiment_accession, pmid)
    "ena_publication_c4f15a54" btree (experiment_accession)
    "ena_publication_experiment_accession_77abbd3c8c8dae5b_like" btree (experiment_accession text_pattern_ops)
ena_run
    Column        |     Type      | Modifiers | Storage  |

----------------------|---------------|-----------|----------| run_accession | text | not null | extended | is_paired | boolean | not null | plain | run_alias | text | not null | extended | read_count | bigint | not null | plain | base_count | bigint | not null | plain | mean_read_length | numeric(10,2) | not null | main | coverage | numeric(10,2) | not null | main | first_public | text | not null | extended | fastq_bytes | text | not null | extended | fastq_md5 | text | not null | extended | fastq_aspera | text | not null | extended | fastq_ftp | text | not null | extended | experiment_accession | text | not null | extended |

Indexes:
    "ena_run_pkey" PRIMARY KEY, btree (run_accession)
    "ena_run_c4f15a54" btree (experiment_accession)
    "ena_run_experiment_accession_292794787d933064_like" btree (experiment_accession text_pattern_ops)
    "ena_run_run_accession_3325d003c60f8137_like" btree (run_accession text_pattern_ops)
ena_study
      Column           | Type | Modifiers | Storage  |

---------------------------|------|-----------|----------| study_accession | text | not null | extended | secondary_study_accession | text | not null | extended | study_title | text | not null | extended | study_alias | text | not null | extended |

Indexes:
    "ena_study_pkey" PRIMARY KEY, btree (study_accession)
    "ena_study_study_accession_607a0e827f9b141d_like" btree (study_accession text_pattern_ops)
ena_tosample
    Column        |  Type   |                         Modifiers                         | Storage  |

----------------------|---------|-----------------------------------------------------------|----------| id | integer | not null default nextval('ena_tosample_id_seq'::regclass) | plain | experiment_accession | text | not null | extended | sample_id | integer | not null | plain |

Indexes:
    "ena_tosample_pkey" PRIMARY KEY, btree (id)
    "ena_tosample_experiment_accession_1bd15d0ef3d7f0e1_uniq" UNIQUE CONSTRAINT, btree (experiment_accession, sample_id)
    "ena_tosample_c09c8085" btree (sample_id)
    "ena_tosample_c4f15a54" btree (experiment_accession)
    "ena_tosample_experiment_accession_3656e834d439ae9f_like" btree (experiment_accession text_pattern_ops)

Annotation

gene_clustermembers
Column Type Modifiers Storage
id integer not null default nextval('gene_clustermembers_id_seq'::regclass) plain
member text not null extended
entry_name text not null extended
length integer not null plain
is_rep boolean not null plain
is_seed boolean not null plain
cluster_id integer not null plain
gene_id integer not null plain
organism_id integer not null plain
protein_id integer not null plain
Indexes:
    "gene_clustermembers_pkey" PRIMARY KEY, btree (id)
    "gene_clustermembers_member_key" UNIQUE CONSTRAINT, btree (member)
    "gene_clustermembers_2bf283a7" btree (organism_id)
    "gene_clustermembers_4ff9f3a6" btree (protein_id)
    "gene_clustermembers_6c57aa00" btree (gene_id)
    "gene_clustermembers_a97b1c12" btree (cluster_id)
    "gene_clustermembers_member_2dc472e1ea5b1a21_like" btree (member text_pattern_ops)
gene_clusters
Column Type Modifiers Storage
id integer not null default nextval('gene_clusters_id_seq'::regclass) plain
name text not null extended
aa text not null extended
Indexes:
    "gene_clusters_pkey" PRIMARY KEY, btree (id)
    "gene_clusters_name_key" UNIQUE CONSTRAINT, btree (name)
    "gene_clusters_name_3fc4e1fe22fcccca_like" btree (name text_pattern_ops)
gene_contigs
Column Type Modifiers Storage
id integer not null default nextval('gene_contigs_id_seq'::regclass) plain
name text not null extended
sequence text not null extended
sample_id integer not null plain
Indexes:
    "gene_contigs_pkey" PRIMARY KEY, btree (id)
    "gene_contigs_sample_id_78af5785299a980d_uniq" UNIQUE CONSTRAINT, btree (sample_id, name)
    "gene_contigs_b068931c" btree (name)
    "gene_contigs_c09c8085" btree (sample_id)
    "gene_contigs_name_2a6dbe9155b0f4fb_like" btree (name text_pattern_ops)
gene_features
Column Type Modifiers Storage
id integer not null default nextval('gene_features_id_seq'::regclass) plain
start integer not null plain
end integer not null plain
is_positive boolean not null plain
is_tRNA boolean not null plain
phase smallint not null plain
dna text not null extended
aa text not null extended
cluster_id integer not null plain
contig_id integer not null plain
sample_id integer not null plain
Indexes:
    "gene_features_pkey" PRIMARY KEY, btree (id)
    "gene_features_sample_id_2d59ee91e76f3b20_uniq" UNIQUE CONSTRAINT, btree (sample_id, contig_id, cluster_id, start, "end")
    "gene_features_a97b1c12" btree (cluster_id)
    "gene_features_c09c8085" btree (sample_id)
    "gene_features_c90fc43a" btree (contig_id)
gene_names
Column Type Modifiers Storage
id integer not null default nextval('gene_names_id_seq'::regclass) plain
name text not null extended
Indexes:
    "gene_names_pkey" PRIMARY KEY, btree (id)
gene_organism
Column Type Modifiers Storage
id integer not null default nextval('gene_organism_id_seq'::regclass) plain
taxon_id integer not null plain
name text not null extended

Indexes: "gene_organism_pkey" PRIMARY KEY, btree (id)

gene_references
Column     |  Type   |                          Modifiers                           | Storage  |

---------------|---------|--------------------------------------------------------------|----------| id | integer | not null default nextval('gene_references_id_seq'::regclass) | plain | dna | text | not null | extended | aa | text | not null | extended | annotation_id | integer | not null | plain | cluster_id | integer | not null | plain | reference_id | integer | not null | plain | end | integer | not null | plain | is_positive | boolean | not null | plain | is_tRNA | boolean | not null | plain | start | integer | not null | plain |

Indexes:
    "gene_references_pkey" PRIMARY KEY, btree (id)
    "gene_references_10d1a950" btree (reference_id)
    "gene_references_a97b1c12" btree (cluster_id)
    "gene_references_e70a1874" btree (annotation_id)

K-mers

kmer_binary
Column Type Modifiers Storage
id integer not null default nextval('kmer_binary_id_seq'::regclass) plain
string bytea not null extended
Indexes:
    "kmer_binary_pkey" PRIMARY KEY, btree (id)
    "kmer_binary_string_key" UNIQUE CONSTRAINT, btree (string)
kmer_count
Column Type Modifiers Storage
id integer not null default nextval('kmer_count_id_seq'::regclass) plain
count integer not null plain
sample_id integer not null plain
string_id integer not null plain
Indexes:
    "kmer_count_pkey" PRIMARY KEY, btree (id)
    "kmer_count_sample_id_3851872189dfeb40_uniq" UNIQUE CONSTRAINT, btree (sample_id, string_id)
    "kmer_count_c09c8085" btree (sample_id)
    "kmer_count_fa206039" btree (string_id)
kmer_total"
Column Type Modifiers Storage
id integer not null default nextval('kmer_total_id_seq'::regclass) plain
total integer not null plain
singletons integer not null plain
new_kmers integer not null plain
runtime integer not null plain
sample_id integer not null plain
Indexes:
    "kmer_total_pkey" PRIMARY KEY, btree (id)
    "kmer_total_c09c8085" btree (sample_id)

MLST

mlst_blast
Column Type Modifiers Storage
id integer not null default nextval('mlst_blast_id_seq'::regclass) plain
locus_name character varying(4) not null extended
locus_id smallint not null plain
bitscore smallint not null plain
slen smallint not null plain
length smallint not null plain
gaps smallint not null plain
mismatch smallint not null plain
pident numeric(5,2) not null main
evalue numeric(7,2) not null main
sample_id integer not null plain
Indexes:
    "mlst_blast_pkey" PRIMARY KEY, btree (id)
    "mlst_blast_sample_id_15f1e0f68e36debb_uniq" UNIQUE CONSTRAINT, btree (sample_id, locus_name, locus_id)
    "mlst_blast_c09c8085" btree (sample_id)
mlst_sequencetypes
Column    |           Type           |                            Modifiers                            | Storage |

--------------|--------------------------|-----------------------------------------------------------------|---------| id | integer | not null default nextval('mlst_sequencetypes_id_seq'::regclass) | plain | st | integer | not null | plain | arcc | integer | not null | plain | aroe | integer | not null | plain | glpf | integer | not null | plain | gmk | integer | not null | plain | pta | integer | not null | plain | tpi | integer | not null | plain | yqil | integer | not null | plain | last_updated | timestamp with time zone | not null | plain |

Indexes:
    "mlst_sequencetypes_pkey" PRIMARY KEY, btree (id)
    "mlst_sequencetypes_ST_key" UNIQUE CONSTRAINT, btree ("ST")
mlst_srst2
Column Type Modifiers Storage
id integer not null default nextval('mlst_srst2_id_seq'::regclass) plain
st_original text not null extended
st_stripped integer not null plain
is_exact boolean not null plain
arcc text not null extended
aroe text not null extended
glpf text not null extended
gmk text not null extended
pta text not null extended
tpi text not null extended
yqil text not null extended
mismatches text not null extended
uncertainty text not null extended
depth numeric(8,3) not null main
maxMAF numeric(11,7) not null main
sample_id integer not null plain
Indexes:
    "mlst_srst2_pkey" PRIMARY KEY, btree (id)
    "mlst_srst2_sample_id_key" UNIQUE CONSTRAINT, btree (sample_id)
    "mlst_srst2_1bd961ca" btree (st_stripped)
    "mlst_srst2_1ab40400" btree (is_exact)

Sample Information

sample_metadata
      Column           |          Type          |                          Modifiers                           | Storage  |

---------------------------|------------------------|--------------------------------------------------------------|----------| id | integer | not null default nextval('sample_metadata_id_seq'::regclass) | plain | sample_tag | text | not null | extended | contact_name | text | not null | extended | contact_email | character varying(254) | not null | extended | contact_link | character varying(200) | not null | extended | sequencing_center | text | not null | extended | sequencing_center_link | character varying(200) | not null | extended | sequencing_date | date | not null | plain | sequencing_libaray_method | text | not null | extended | sequencing_platform | text | not null | extended | publication_link | character varying(200) | not null | extended | pubmed_id | text | not null | extended | doi | text | not null | extended | funding_agency | text | not null | extended | funding_agency_link | character varying(200) | not null | extended | strain | text | not null | extended | isolation_date | date | not null | plain | isolation_country | text | not null | extended | isolation_city | text | not null | extended | isolation_region | text | not null | extended | host_name | text | not null | extended | host_health | text | not null | extended | host_age | smallint | not null | plain | host_gender | text | not null | extended | comments | text | not null | extended | vancomycin_mic | numeric(6,3) | not null | main | penicillin_mic | numeric(6,3) | not null | main | oxacillin_mic | numeric(6,3) | not null | main | clindamycin_mic | numeric(6,3) | not null | main | daptomycin_mic | numeric(6,3) | not null | main | levofloxacin_mic | numeric(6,3) | not null | main | linezolid_mic | numeric(6,3) | not null | main | rifampin_mic | numeric(6,3) | not null | main | tetracycline_mic | numeric(6,3) | not null | main | trimethoprim_mic | numeric(6,3) | not null | main | source | text | not null | extended | is_public | boolean | not null | plain | is_paired | boolean | not null | plain | is_published | boolean | not null | plain | user_id | integer | not null | plain |

Indexes:
    "sample_metadata_pkey" PRIMARY KEY, btree (id)
    "sample_metadata_11725655" btree (is_public)
    "sample_metadata_75892900" btree (is_published)
    "sample_metadata_b3fa01dd" btree (sample_tag)
    "sample_metadata_e8701ad4" btree (user_id)
    "sample_metadata_sample_tag_329e6fe76c09a51f_like" btree (sample_tag text_pattern_ops)
sample_pipeline
Column Type Modifiers Storage
id integer not null default nextval('sample_pipeline_id_seq'::regclass) plain
assembly text not null extended
gene text not null extended
kmer text not null extended
mlst text not null extended
sequence text not null extended
variant text not null extended
sample_id integer not null plain
Indexes:
    "sample_pipeline_pkey" PRIMARY KEY, btree (id)
    "sample_pipeline_sample_id_key" UNIQUE CONSTRAINT, btree (sample_id)
sample_upload
Column Type Modifiers Storage
sample_id integer not null plain
path character varying(100) not null extended
md5sum character varying(32) not null extended
Indexes:
    "sample_upload_pkey" PRIMARY KEY, btree (sample_id)
    "sample_upload_md5sum_key" UNIQUE CONSTRAINT, btree (md5sum)
    "sample_upload_md5sum_4c1e5476f2ea753_like" btree (md5sum varchar_pattern_ops)

Sequence Quality

sequence_quality
  Column      |     Type      |                           Modifiers                           | Storage |

------------------|---------------|---------------------------------------------------------------|---------| id | integer | not null default nextval('sequence_quality_id_seq'::regclass) | plain | is_original | boolean | not null | plain | rank | smallint | not null | plain | total_bp | bigint | not null | plain | total_reads | bigint | not null | plain | coverage | numeric(7,2) | not null | main | min_read_length | integer | not null | plain | mean_read_length | numeric(10,3) | not null | main | max_read_length | integer | not null | plain | qual_mean | numeric(6,3) | not null | main | qual_std | numeric(6,3) | not null | main | qual_25th | numeric(6,3) | not null | main | qual_median | numeric(6,3) | not null | main | qual_75th | numeric(6,3) | not null | main | sample_id | integer | not null | plain |

Indexes:
    "sequence_quality_pkey" PRIMARY KEY, btree (id)
    "sequence_quality_sample_id_2748bdad20282c51_uniq" UNIQUE CONSTRAINT, btree (sample_id, is_original)
    "sequence_quality_3d0351e8" btree (is_original)
    "sequence_quality_65dc5d2a" btree (rank)
    "sequence_quality_c09c8085" btree (sample_id)

Variant (SNP/InDel) Calling

variant_annotation
Column    |         Type          |                            Modifiers                            | Storage  |

--------------|-----------------------|-----------------------------------------------------------------|----------| id | integer | not null default nextval('variant_annotation_id_seq'::regclass) | plain | locus_tag | character varying(24) | not null | extended | protein_id | character varying(24) | not null | extended | gene | character varying(12) | not null | extended | db_xref | text | not null | extended | product | text | not null | extended | note | text | not null | extended | reference_id | integer | not null | plain |

Indexes:
    "variant_annotation_pkey" PRIMARY KEY, btree (id)
    "variant_annotation_10d1a950" btree (reference_id)
variant_comment
Column Type Modifiers Storage
id integer not null default nextval('variant_comment_id_seq'::regclass) plain
comment text not null extended
Indexes:
    "variant_comment_pkey" PRIMARY KEY, btree (id)
    "variant_comment_comment_key" UNIQUE CONSTRAINT, btree (comment)
    "variant_comment_comment_767f0ad1828fdabf_like" btree (comment text_pattern_ops)
variant_confidence
   Column       |     Type     |                            Modifiers                            | Storage  |

--------------------|--------------|-----------------------------------------------------------------|----------| id | integer | not null default nextval('variant_confidence_id_seq'::regclass) | plain | AC | text | not null | extended | AD | text | not null | extended | AF | numeric(8,3) | not null | main | DP | integer | not null | plain | GQ | integer | not null | plain | GT | text | not null | extended | MQ | numeric(8,3) | not null | main | PL | text | not null | extended | QD | numeric(8,3) | not null | main | quality | numeric(8,3) | not null | main | reference_position | integer | not null | plain | sample_id | integer | not null | plain |

Indexes:
    "variant_confidence_pkey" PRIMARY KEY, btree (id)
    "variant_confidence_c09c8085" btree (sample_id)
variant_counts
Column Type Modifiers Storage
id integer not null default nextval('variant_counts_id_seq'::regclass) plain
snp integer not null plain
indel integer not null plain
confidence integer not null plain
sample_id integer not null plain
Indexes:
    "variant_counts_pkey" PRIMARY KEY, btree (id)
    "variant_counts_c09c8085" btree (sample_id)
variant_filter
Column Type Modifiers Storage
id integer not null default nextval('variant_filter_id_seq'::regclass) plain
name text not null extended
Indexes:
    "variant_filter_pkey" PRIMARY KEY, btree (id)
    "variant_filter_name_key" UNIQUE CONSTRAINT, btree (name)
    "variant_filter_name_400bafac6f2822a6_like" btree (name text_pattern_ops)
variant_snpcounts
Column Type Modifiers Storage
id integer not null default nextval('variant_snpcounts_id_seq'::regclass) plain
count integer not null plain
snp_id integer not null plain
Indexes:
    "variant_snpcounts_pkey" PRIMARY KEY, btree (id)
    "variant_snpcounts_c57207ae" btree (snp_id)
    "variant_snpcounts_e2942a04" btree (count)
variant_indel
   Column       |  Type   |                         Modifiers                          | Storage  |

--------------------|---------|------------------------------------------------------------|----------| id | integer | not null default nextval('variant_indel_id_seq'::regclass) | plain | reference_position | integer | not null | plain | reference_base | text | not null | extended | alternate_base | text | not null | extended | is_deletion | boolean | not null | plain | annotation_id | integer | not null | plain | reference_id | integer | not null | plain |

Indexes:
    "variant_indel_pkey" PRIMARY KEY, btree (id)
    "variant_indel_reference_id_547a401e880b518c_uniq" UNIQUE CONSTRAINT, btree (reference_id, reference_position, reference_base, alternate_base)
    "variant_indel_10d1a950" btree (reference_id)
    "variant_indel_1c86ae80" btree (reference_position)
    "variant_indel_6c00cd75" btree (is_deletion)
    "variant_indel_e70a1874" btree (annotation_id)
variant_reference
Column Type Modifiers Storage
id integer not null default nextval('variant_reference_id_seq'::regclass) plain
name text not null extended
Indexes:
        "variant_reference_pkey" PRIMARY KEY, btree (id)
        "variant_reference_name_key" UNIQUE CONSTRAINT, btree (name)
        "variant_reference_name_481c1fbe9b67c108_like" btree (name text_pattern_ops)
variant_snp
    Column        |         Type         |                        Modifiers                         | Storage  |

----------------------|----------------------|----------------------------------------------------------|----------| id | integer | not null default nextval('variant_snp_id_seq'::regclass) | plain | reference_position | integer | not null | plain | reference_base | character varying(1) | not null | extended | alternate_base | character varying(1) | not null | extended | reference_codon | character varying(3) | not null | extended | alternate_codon | character varying(3) | not null | extended | reference_amino_acid | character varying(1) | not null | extended | alternate_amino_acid | character varying(1) | not null | extended | codon_position | integer | not null | plain | snp_codon_position | smallint | not null | plain | amino_acid_change | text | not null | extended | is_synonymous | smallint | not null | plain | is_transition | smallint | not null | plain | is_genic | smallint | not null | plain | annotation_id | integer | not null | plain | reference_id | integer | not null | plain |

Indexes:
        "variant_snp_pkey" PRIMARY KEY, btree (id)
        "variant_snp_reference_id_7a69b43c78491f2b_uniq" UNIQUE CONSTRAINT, btree (reference_id, reference_position, reference_base, alternate_base)
        "variant_snp_10d1a950" btree (reference_id)
        "variant_snp_1c86ae80" btree (reference_position)
        "variant_snp_e70a1874" btree (annotation_id)
variant_toindel
Column Type Modifiers Storage
id integer not null default nextval('variant_toindel_id_seq'::regclass) plain
filters_id integer not null plain
indel_id integer not null plain
sample_id integer not null plain
Indexes:
        "variant_toindel_pkey" PRIMARY KEY, btree (id)
        "variant_toindel_sample_id_ebbe8d32d6f85fb_uniq" UNIQUE CONSTRAINT, btree (sample_id, indel_id)
        "variant_toindel_6628046e" btree (filters_id)
        "variant_toindel_c09c8085" btree (sample_id)
        "variant_toindel_f8c5f21f" btree (indel_id)
variant_tosnp
Column Type Modifiers Storage
id integer not null default nextval('variant_tosnp_id_seq'::regclass) plain
comment_id integer not null plain
filters_id integer not null plain
sample_id integer not null plain
snp_id integer not null plain
Indexes:
        "variant_tosnp_pkey" PRIMARY KEY, btree (id)
        "variant_tosnp_sample_id_2d8402c0fb24b75_uniq" UNIQUE CONSTRAINT, btree (sample_id, snp_id)
        "variant_tosnp_6628046e" btree (filters_id)
        "variant_tosnp_69b97d17" btree (comment_id)
        "variant_tosnp_c09c8085" btree (sample_id)
        "variant_tosnp_c57207ae" btree (snp_id)