Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data = fields.IntField()
first = fields.EmbeddedField('Primary')
def test_generate_circular_schema():
schema = Primary.to_json_schema()
pattern = get_fixture('schema_circular.json')
assert compare_schemas(pattern, schema) is True
class File(models.Base):
name = fields.StringField()
size = fields.FloatField()
class Directory(models.Base):
name = fields.StringField()
children = fields.ListField(['Directory', File])
class Filesystem(models.Base):
name = fields.StringField()
children = fields.ListField([Directory, File])
def test_generate_circular_schema2():
schema = Filesystem.to_json_schema()
hom_asj = fields.IntField(help_text="Number of Homozygotes Ashkenazi Jewish", required=False, nullable=True)
hom_eas = fields.IntField(help_text="Number of Homozygotes East Asian", required=False, nullable=True)
hom_fin = fields.IntField(help_text="Number of Homozygotes European (Finnish)", required=False, nullable=True)
hom_nfe = fields.IntField(help_text="Number of Homozygotes European (Non-Finnish)", required=False, nullable=True)
hom_oth = fields.IntField(help_text="Number of Homozygotes Other", required=False, nullable=True)
hom_male = fields.IntField(help_text="Number of Homozygotes Male", required=False, nullable=True)
hom_female = fields.IntField(help_text="Number of Homozygotes Female", required=False, nullable=True)
af_afr = fields.FloatField(help_text="Allele Frequency African", required=False, nullable=True)
af_amr = fields.FloatField(help_text="Allele Frequency American", required=False, nullable=True)
af_asj = fields.FloatField(help_text="Allele Frequency Ashkenazi Jewish", required=False, nullable=True)
af_eas = fields.FloatField(help_text="Allele Frequency East Asian", required=False, nullable=True)
af_fin = fields.FloatField(help_text="Allele Frequency European (Finnish)", required=False, nullable=True)
af_nfe = fields.FloatField(help_text="Allele Frequency European (Non-Finnish)", required=False, nullable=True)
af_oth = fields.FloatField(help_text="Allele Frequency Other", required=False, nullable=True)
af_male = fields.FloatField(help_text="Allele Frequency Male", required=False, nullable=True)
af_female = fields.FloatField(help_text="Allele Frequency Female", required=False, nullable=True)
main_data = fields.StringField(help_text="Main data point", required=False, nullable=True)
hom_sas = fields.IntField(help_text="Number of Homozygotes South Asian", required=False, nullable=True)
hom_male = fields.IntField(help_text="Number of Homozygotes Male", required=False, nullable=True)
hom_female = fields.IntField(help_text="Number of Homozygotes Female", required=False, nullable=True)
hemi_afr = fields.IntField(help_text="Number of Hemizygotes African", required=False, nullable=True)
hemi_amr = fields.IntField(help_text="Number of Hemizygotes American", required=False, nullable=True)
hemi_asj = fields.IntField(help_text="Number of Hemizygotes Ashkenazi Jewish", required=False, nullable=True)
hemi_eas = fields.IntField(help_text="Number of Hemizygotes East Asian", required=False, nullable=True)
hemi_fin = fields.IntField(help_text="Number of Hemizygotes European (Finnish)", required=False, nullable=True)
hemi_nfe = fields.IntField(help_text="Number of Hemizygotes European (Non-Finnish)", required=False, nullable=True)
hemi_oth = fields.IntField(help_text="Number of Hemizygotes Other", required=False, nullable=True)
hemi_sas = fields.IntField(help_text="Number of Hemizygotes South Asian", required=False, nullable=True)
af_afr = fields.FloatField(help_text="Allele Frequency African", required=False, nullable=True)
af_amr = fields.FloatField(help_text="Allele Frequency American", required=False, nullable=True)
af_asj = fields.FloatField(help_text="Allele Frequency Ashkenazi Jewish", required=False, nullable=True)
af_eas = fields.FloatField(help_text="Allele Frequency East Asian", required=False, nullable=True)
af_fin = fields.FloatField(help_text="Allele Frequency European (Finnish)", required=False, nullable=True)
af_nfe = fields.FloatField(help_text="Allele Frequency European (Non-Finnish)", required=False, nullable=True)
af_oth = fields.FloatField(help_text="Allele Frequency Other", required=False, nullable=True)
af_sas = fields.FloatField(help_text="Allele Frequency South Asian", required=False, nullable=True)
af_male = fields.FloatField(help_text="Allele Frequency Male", required=False, nullable=True)
af_female = fields.FloatField(help_text="Allele Frequency Female", required=False, nullable=True)
ac_adj = fields.FloatField(help_text="Allele Count", required=False, nullable=True)
an_adj = fields.FloatField(help_text="Allele Number", required=False, nullable=True)
af = fields.FloatField(help_text="Allele Frequency", required=False, nullable=True)
ac_afr = fields.IntField(help_text="Allele Count African", required=False, nullable=True)
ac_amr = fields.IntField(help_text="Allele Count American", required=False, nullable=True)
ac_asj = fields.IntField(help_text="Allele Count Ashkenazi Jewish", required=False, nullable=True)
ac_eas = fields.IntField(help_text="Allele Count East Asian", required=False, nullable=True)
ac_fin = fields.IntField(help_text="Allele Count European (Finnish)", required=False, nullable=True)
ac_nfe = fields.IntField(help_text="Allele Count European (Non-Finnish)", required=False, nullable=True)
ac_oth = fields.IntField(help_text="Allele Count Other", required=False, nullable=True)
ac_male = fields.IntField(help_text="Allele Count Male", required=False, nullable=True)
ac_female = fields.IntField(help_text="Allele Count Female", required=False, nullable=True)
hom = fields.IntField(help_text="Number of Homozygotes", required=False, nullable=True)
hemi = fields.IntField(help_text="Number of Hemizygotes", required=False, nullable=True)
ac_hom = fields.FloatField(help_text="Number of Homozygotes", required=False, nullable=True)
ac_hemi = fields.FloatField(help_text="Number of Hemizygotes", required=False, nullable=True)
an_afr = fields.IntField(help_text="Allele Number African", required=False, nullable=True)
an_amr = fields.IntField(help_text="Allele Number American", required=False, nullable=True)
an_asj = fields.IntField(help_text="Allele Number Ashkenazi Jewish", required=False, nullable=True)
an_eas = fields.IntField(help_text="Allele Number East Asian", required=False, nullable=True)
an_fin = fields.IntField(help_text="Allele Number European (Finnish)", required=False, nullable=True)
an_nfe = fields.IntField(help_text="Allele Number European (Non-Finnish)", required=False, nullable=True)
an_oth = fields.IntField(help_text="Allele Number Other", required=False, nullable=True)
an_male = fields.IntField(help_text="Allele Number Male", required=False, nullable=True)
an_female = fields.IntField(help_text="Allele Number Female", required=False, nullable=True)
hom_afr = fields.IntField(help_text="Number of Homozygotes African", required=False, nullable=True)
hom_amr = fields.IntField(help_text="Number of Homozygotes American", required=False, nullable=True)
hom_asj = fields.IntField(help_text="Number of Homozygotes Ashkenazi Jewish", required=False, nullable=True)
hom_eas = fields.IntField(help_text="Number of Homozygotes East Asian", required=False, nullable=True)
hom_fin = fields.IntField(help_text="Number of Homozygotes European (Finnish)", required=False, nullable=True)
hom_nfe = fields.IntField(help_text="Number of Homozygotes European (Non-Finnish)", required=False, nullable=True)
hom_oth = fields.IntField(help_text="Number of Homozygotes Other", required=False, nullable=True)
an_fin = fields.IntField(help_text="Allele Number European (Finnish)", required=False, nullable=True)
an_nfe = fields.IntField(help_text="Allele Number European (Non-Finnish)", required=False, nullable=True)
an_oth = fields.IntField(help_text="Allele Number Other", required=False, nullable=True)
an_male = fields.IntField(help_text="Allele Number Male", required=False, nullable=True)
an_female = fields.IntField(help_text="Allele Number Female", required=False, nullable=True)
hom_afr = fields.IntField(help_text="Number of Homozygotes African", required=False, nullable=True)
hom_amr = fields.IntField(help_text="Number of Homozygotes American", required=False, nullable=True)
hom_asj = fields.IntField(help_text="Number of Homozygotes Ashkenazi Jewish", required=False, nullable=True)
hom_eas = fields.IntField(help_text="Number of Homozygotes East Asian", required=False, nullable=True)
hom_fin = fields.IntField(help_text="Number of Homozygotes European (Finnish)", required=False, nullable=True)
hom_nfe = fields.IntField(help_text="Number of Homozygotes European (Non-Finnish)", required=False, nullable=True)
hom_oth = fields.IntField(help_text="Number of Homozygotes Other", required=False, nullable=True)
hom_male = fields.IntField(help_text="Number of Homozygotes Male", required=False, nullable=True)
hom_female = fields.IntField(help_text="Number of Homozygotes Female", required=False, nullable=True)
af_afr = fields.FloatField(help_text="Allele Frequency African", required=False, nullable=True)
af_amr = fields.FloatField(help_text="Allele Frequency American", required=False, nullable=True)
af_asj = fields.FloatField(help_text="Allele Frequency Ashkenazi Jewish", required=False, nullable=True)
af_eas = fields.FloatField(help_text="Allele Frequency East Asian", required=False, nullable=True)
af_fin = fields.FloatField(help_text="Allele Frequency European (Finnish)", required=False, nullable=True)
af_nfe = fields.FloatField(help_text="Allele Frequency European (Non-Finnish)", required=False, nullable=True)
af_oth = fields.FloatField(help_text="Allele Frequency Other", required=False, nullable=True)
af_male = fields.FloatField(help_text="Allele Frequency Male", required=False, nullable=True)
af_female = fields.FloatField(help_text="Allele Frequency Female", required=False, nullable=True)
main_data = fields.StringField(help_text="Main data point", required=False, nullable=True)
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from jsonmodels import models, fields
__author__ = "ckopanos"
class ExAC(models.Base):
version = fields.StringField(help_text="Version")
ac = fields.IntField(help_text="Allele Count", required=False, nullable=True)
an = fields.IntField(help_text="Allele Number", required=False, nullable=True)
ac_adj = fields.FloatField(help_text="Allele Count", required=False, nullable=True)
an_adj = fields.FloatField(help_text="Allele Number", required=False, nullable=True)
af = fields.FloatField(help_text="Allele Frequency", required=False, nullable=True)
ac_afr = fields.IntField(help_text="Allele Count African", required=False, nullable=True)
ac_amr = fields.IntField(help_text="Allele Count American", required=False, nullable=True)
ac_asj = fields.IntField(help_text="Allele Count Ashkenazi Jewish", required=False, nullable=True)
ac_eas = fields.IntField(help_text="Allele Count East Asian", required=False, nullable=True)
ac_fin = fields.IntField(help_text="Allele Count European (Finnish)", required=False, nullable=True)
ac_nfe = fields.IntField(help_text="Allele Count European (Non-Finnish)", required=False, nullable=True)
ac_oth = fields.IntField(help_text="Allele Count Other", required=False, nullable=True)
ac_sas = fields.IntField(help_text="Allele Count South Asian", required=False, nullable=True)
ac_male = fields.IntField(help_text="Allele Count Male", required=False, nullable=True)
ac_female = fields.IntField(help_text="Allele Count Female", required=False, nullable=True)
hom = fields.IntField(help_text="Number of Homozygotes", required=False, nullable=True)
hemi = fields.IntField(help_text="Number of Hemizygotes", required=False, nullable=True)
ac_hom = fields.FloatField(help_text="Number of Homozygotes", required=False, nullable=True)
ac_hemi = fields.FloatField(help_text="Number of Hemizygotes", required=False, nullable=True)
an_afr = fields.IntField(help_text="Allele Number African", required=False, nullable=True)
@mf.register_model
@mf.construct_nb_db_model(
indexes={
'egress': 'egress_port',
},
)
class PortPair(mf.ModelBase,
mixins.BasicEvents,
mixins.Topic,
mixins.Name):
table_name = 'sfc_portpair'
ingress_port = df_fields.ReferenceField(l2.LogicalPort)
egress_port = df_fields.ReferenceField(l2.LogicalPort)
correlation_mechanism = df_fields.EnumField([CORR_NONE, CORR_MPLS])
weight = fields.FloatField()
@mf.register_model
@mf.construct_nb_db_model(
indexes={
'port_pairs': 'port_pairs',
},
)
class PortPairGroup(mf.ModelBase,
mixins.BasicEvents,
mixins.Topic,
mixins.Name):
table_name = 'sfc_portpairgroup'
port_pairs = df_fields.ReferenceListField(PortPair)
zygosity_freq = fields.ListField(items_types=(int, str, float), help_text="Zygosity frequency", required=False,
nullable=True)
tumour_origin_freq = fields.ListField(items_types=(int, str, float,), help_text="Tumour original frequency", required=False,
nullable=True)
somatic_status_freq = fields.ListField(items_types=(int, str, float), help_text="Somatic status frequency", required=False,
nullable=True)
primary_site_freq = fields.ListField(items_types=(int, str, float), help_text="Primary site frequency", required=False, nullable=True)
description = fields.ListField(items_types=(str,), help_text="Description", required=False, nullable=True)
accession_number = fields.ListField(items_types=(str,), help_text="Accession number", required=False, nullable=True)
fathmm_prediction = fields.StringField(help_text="FATHMM prediction", required=False, nullable=True)
fathmm_score = fields.FloatField(help_text="FATHMM score", required=False, nullable=True)
num_entries = fields.IntField(help_text="Number of entries", required=False, nullable=True)
num_samples = fields.IntField(help_text="Number of samples", required=False, nullable=True)
gene = fields.ListField(items_types=(str,), help_text="Gene", required=False, nullable=True)
fathmm_mkl_coding_score = fields.FloatField(help_text="FATHMM_MKL coding score", required=False, nullable=True)
fathmm_mkl_coding_groups = fields.StringField(help_text="FATHMM_MKL coding groups", required=False, nullable=True)
fathmm_mkl_non_coding_score = fields.FloatField(help_text="FATHMM_MKL non coding score", required=False,
nullable=True)
fathmm_mkl_non_coding_groups = fields.StringField(help_text="FATHMM_MKL non coding groups", required=False,
nullable=True)
whole_exome_freq = fields.ListField(items_types=(str, int, float,), help_text="Whole exome frequency", required=False,
nullable=True)
whole_genome_reseq_freq = fields.ListField(items_types=(str, int, float,), help_text="Whole genome reseq frequency",
required=False, nullable=True)
resistance_mutation = fields.ListField(items_types=(str,), help_text="Resistance mutation", required=False,
nullable=True)
drug_entries = fields.ListField(items_types=(CosmicLicensedDrugEntry,), help_text="Drug entries", required=False,
nullable=True)
from jsonmodels import models, fields
__author__ = "ckopanos"
class GWASDetails(models.Base):
gwas_symbol = fields.StringField(help_text="GWAS symbol", required=False, nullable=True)
date = fields.StringField(help_text="Date", required=False, nullable=True)
study = fields.StringField(help_text="Study", required=False, nullable=True)
disease_or_trait = fields.StringField(help_text="Disease or trait", required=False, nullable=True)
mapped_traits = fields.ListField(items_types=(str,), help_text="Mapped trait", required=False, nullable=True)
mapped_trait_urls = fields.ListField(items_types=(str,), help_text="Mapped trait URL", required=False,
nullable=True)
strongest_snp_risk_allele = fields.StringField(help_text="Strongest SNP risk allele", required=False, nullable=True)
odds_ratio = fields.FloatField(help_text="Odds ratio", required=False, nullable=True)
p_value = fields.StringField(help_text="p value", required=False, nullable=True)
confidence_range_95_low = fields.FloatField(help_text="Confidence range 95% low", required=False, nullable=True)
confidence_range_95_high = fields.FloatField(help_text="Confidence range 95% high", required=False, nullable=True)
confidence_comment = fields.StringField(help_text="Confidence comment", required=False, nullable=True)
initial_sample_size = fields.StringField(help_text="Initial sample size", required=False, nullable=True)
replication_sample_size = fields.StringField(help_text="Replication sample size", required=False, nullable=True)
pub_med_references = fields.ListField(items_types=(int,), help_text="PubMed References", required=False,
nullable=True)
class GWAS(models.Base):
version = fields.StringField(help_text="Version")
items = fields.ListField(help_text='Details', items_types=(GWASDetails,))
hom_female = fields.IntField(help_text="Number of Homozygotes Female", required=False, nullable=True)
hemi_afr = fields.IntField(help_text="Number of Hemizygotes African", required=False, nullable=True)
hemi_amr = fields.IntField(help_text="Number of Hemizygotes American", required=False, nullable=True)
hemi_asj = fields.IntField(help_text="Number of Hemizygotes Ashkenazi Jewish", required=False, nullable=True)
hemi_eas = fields.IntField(help_text="Number of Hemizygotes East Asian", required=False, nullable=True)
hemi_fin = fields.IntField(help_text="Number of Hemizygotes European (Finnish)", required=False, nullable=True)
hemi_nfe = fields.IntField(help_text="Number of Hemizygotes European (Non-Finnish)", required=False, nullable=True)
hemi_oth = fields.IntField(help_text="Number of Hemizygotes Other", required=False, nullable=True)
hemi_sas = fields.IntField(help_text="Number of Hemizygotes South Asian", required=False, nullable=True)
af_afr = fields.FloatField(help_text="Allele Frequency African", required=False, nullable=True)
af_amr = fields.FloatField(help_text="Allele Frequency American", required=False, nullable=True)
af_asj = fields.FloatField(help_text="Allele Frequency Ashkenazi Jewish", required=False, nullable=True)
af_eas = fields.FloatField(help_text="Allele Frequency East Asian", required=False, nullable=True)
af_fin = fields.FloatField(help_text="Allele Frequency European (Finnish)", required=False, nullable=True)
af_nfe = fields.FloatField(help_text="Allele Frequency European (Non-Finnish)", required=False, nullable=True)
af_oth = fields.FloatField(help_text="Allele Frequency Other", required=False, nullable=True)
af_sas = fields.FloatField(help_text="Allele Frequency South Asian", required=False, nullable=True)
af_male = fields.FloatField(help_text="Allele Frequency Male", required=False, nullable=True)
af_female = fields.FloatField(help_text="Allele Frequency Female", required=False, nullable=True)