Search is not available for this dataset
text
stringlengths
75
104k
def get_length(alt_len, ref_len, category, pos, end, svtype=None, svlen=None): """Return the length of a variant Args: alt_len(int) ref_len(int) category(str) svtype(str) svlen(int) """ # -1 would indicate uncertain length length = -1 if category in ('snv...
def get_end(pos, alt, category, snvend=None, svend=None, svlen=None): """Return the end coordinate for a variant Args: pos(int) alt(str) category(str) snvend(str) svend(int) svlen(int) Returns: end(int) """ # If nothing is known we set end to...
def parse_coordinates(variant, category): """Find out the coordinates for a variant Args: variant(cyvcf2.Variant) Returns: coordinates(dict): A dictionary on the form: { 'position':<int>, 'end':<int>, 'end_chrom':<str>, 'length':<int>...
def parse_cytoband(lines): """Parse iterable with cytoband coordinates Args: lines(iterable): Strings on format "chr1\t2300000\t5400000\tp36.32\tgpos25" Returns: cytobands(dict): Dictionary with chromosome names as keys and interval trees as values ...
def cli(infile): """docstring for cli""" lines = get_file_handle(infile) cytobands = parse_cytoband(lines) print("Check some coordinates:") print("checking chrom 1 pos 2") intervals = cytobands['1'][2] for interval in intervals: print(interval) print(interval.begin)...
def update_panel(adapter, panel_name, panel_version, new_version=None, new_date=None): """Update a gene panel in the database We need to update the actual gene panel and then all cases that refers to the panel. Args: adapter(scout.adapter.MongoAdapter) panel_name(str): Unique name ...
def cli(context, mongodb, username, password, authdb, host, port, loglevel, config, demo): """scout: manage interactions with a scout instance.""" # log_format = "%(message)s" if sys.stdout.isatty() else None log_format = None coloredlogs.install(level=loglevel, fmt=log_format) LOG.info("Running sco...
def parse_exac_line(line, header): """Parse an exac formated line Args: line(list): A list with exac gene info header(list): A list with the header info Returns: exac_info(dict): A dictionary with the relevant info """ exac_gene = {} spli...
def parse_exac_genes(lines): """Parse lines with exac formated genes This is designed to take a dump with genes from exac. This is downloaded from: ftp.broadinstitute.org/pub/ExAC_release//release0.3/functional_gene_constraint/ fordist_cleaned_exac_r03_march16_z_pli...
def panels(): """Show all panels for a case.""" if request.method == 'POST': # update an existing panel csv_file = request.files['csv_file'] content = csv_file.stream.read() lines = None try: if b'\n' in content: lines = content.decode('utf-8',...
def panel(panel_id): """Display (and add pending updates to) a specific gene panel.""" panel_obj = store.gene_panel(panel_id) or store.panel(panel_id) if request.method == 'POST': raw_hgnc_id = request.form['hgnc_id'] if '|' in raw_hgnc_id: raw_hgnc_id = raw_hgnc_id.split(' | ', ...
def panel_update(panel_id): """Update panel to a new version.""" panel_obj = store.panel(panel_id) update_version = request.form.get('version', None) new_panel_id = store.apply_pending(panel_obj, update_version) return redirect(url_for('panels.panel', panel_id=new_panel_id))
def panel_export(panel_id): """Export panel to PDF file""" panel_obj = store.panel(panel_id) data = controllers.panel_export(store, panel_obj) data['report_created_at'] = datetime.datetime.now().strftime("%Y-%m-%d") html_report = render_template('panels/panel_pdf_simple.html', **data) return ren...
def gene_edit(panel_id, hgnc_id): """Edit additional information about a panel gene.""" panel_obj = store.panel(panel_id) hgnc_gene = store.hgnc_gene(hgnc_id) panel_gene = controllers.existing_gene(store, panel_obj, hgnc_id) form = PanelGeneForm() transcript_choices = [] for transcript in h...
def delivery_report(context, case_id, report_path, update): """Add delivery report to an existing case.""" adapter = context.obj['adapter'] try: load_delivery_report(adapter=adapter, case_id=case_id, report_path=report_path, update=update) L...
def parse_peddy_ped(lines): """Parse a peddy.ped file Args: lines(iterable(str)) Returns: peddy_ped(list(dict)) """ peddy_ped = [] header = [] for i,line in enumerate(lines): line = line.rstrip() if i == 0: # Header line heade...
def parse_peddy_ped_check(lines): """Parse a .ped_check.csv file Args: lines(iterable(str)) Returns: ped_check(list(dict)) """ ped_check = [] header = [] for i,line in enumerate(lines): line = line.rstrip() if i == 0: # Header line ...
def parse_peddy_sex_check(lines): """Parse a .ped_check.csv file Args: lines(iterable(str)) Returns: sex_check(list(dict)) """ sex_check = [] header = [] for i,line in enumerate(lines): line = line.rstrip() if i == 0: # Header line ...
def hpo_terms(store, query = None, limit = None): """Retrieves a list of HPO terms from scout database Args: store (obj): an adapter to the scout database query (str): the term to search in the database limit (str): the number of desired results Returns: hpo_phenotypes (dic...
def whitelist(context): """Show all objects in the whitelist collection""" LOG.info("Running scout view users") adapter = context.obj['adapter'] ## TODO add a User interface to the adapter for whitelist_obj in adapter.whitelist_collection.find(): click.echo(whitelist_obj['_id'])
def build_phenotype(phenotype_id, adapter): """Build a small phenotype object Build a dictionary with phenotype_id and description Args: phenotype_id (str): The phenotype id adapter (scout.adapter.MongoAdapter) Returns: phenotype_obj (dict): dict( phen...
def build_case(case_data, adapter): """Build a case object that is to be inserted to the database Args: case_data (dict): A dictionary with the relevant case information adapter (scout.adapter.MongoAdapter) Returns: case_obj (dict): A case object dict( case_id = str, #...
def gene(store, hgnc_id): """Parse information about a gene.""" res = {'builds': {'37': None, '38': None}, 'symbol': None, 'description': None, 'ensembl_id': None, 'record': None} for build in res['builds']: record = store.hgnc_gene(hgnc_id, build=build) if record: record['posi...
def genes_to_json(store, query): """Fetch matching genes and convert to JSON.""" gene_query = store.hgnc_genes(query, search=True) json_terms = [{'name': "{} | {} ({})".format(gene['hgnc_id'], gene['hgnc_symbol'], ', '.join(gene['aliases'])), ...
def index(): """Display the Scout dashboard.""" accessible_institutes = current_user.institutes if not 'admin' in current_user.roles: accessible_institutes = current_user.institutes if not accessible_institutes: flash('Not allowed to see information - please visit the dashboard l...
def weekday(year_or_num, month=None, day=None, full=False): """Simple tag - returns the weekday of the given (year, month, day) or of given (weekday_number). Usage (in template): {% weekday 2014 3 3 %} Result: Mon Return abbreviation by default. To return full name: pass full=True {% weekda...
def get_request(url): """Return a requests response from url Args: url(str) Returns: decoded_data(str): Decoded response """ try: LOG.info("Requesting %s", url) response = urllib.request.urlopen(url) if url.endswith('.gz'): LOG.info("Deco...
def fetch_resource(url): """Fetch a resource and return the resulting lines in a list Send file_name to get more clean log messages Args: url(str) Returns: lines(list(str)) """ try: data = get_request(url) lines = data.split('\n') except Exception as...
def fetch_mim_files(api_key, mim2genes=False, mimtitles=False, morbidmap=False, genemap2=False): """Fetch the necessary mim files using a api key Args: api_key(str): A api key necessary to fetch mim data Returns: mim_files(dict): A dictionary with the neccesary files """ L...
def fetch_ensembl_genes(build='37'): """Fetch the ensembl genes Args: build(str): ['37', '38'] """ if build == '37': url = 'http://grch37.ensembl.org' else: url = 'http://www.ensembl.org' LOG.info("Fetching ensembl genes from %s", url) dataset_name = 'hsapie...
def fetch_ensembl_exons(build='37'): """Fetch the ensembl genes Args: build(str): ['37', '38'] """ LOG.info("Fetching ensembl exons build %s ...", build) if build == '37': url = 'http://grch37.ensembl.org' else: url = 'http://www.ensembl.org' dataset_name = ...
def fetch_hgnc(): """Fetch the hgnc genes file from ftp://ftp.ebi.ac.uk/pub/databases/genenames/new/tsv/hgnc_complete_set.txt Returns: hgnc_gene_lines(list(str)) """ file_name = "hgnc_complete_set.txt" url = 'ftp://ftp.ebi.ac.uk/pub/databases/genenames/new/tsv/{0}'.format(file_...
def fetch_exac_constraint(): """Fetch the file with exac constraint scores Returns: exac_lines(iterable(str)) """ file_name = 'fordist_cleaned_exac_r03_march16_z_pli_rec_null_data.txt' url = ('ftp://ftp.broadinstitute.org/pub/ExAC_release/release0.3/functional_gene_constraint' ...
def fetch_hpo_files(hpogenes=False, hpoterms=False, phenotype_to_terms=False, hpodisease=False): """Fetch the necessary mim files using a api key Args: api_key(str): A api key necessary to fetch mim data Returns: mim_files(dict): A dictionary with the neccesary files """ L...
def transcripts(context, build, hgnc_id, json): """Show all transcripts in the database""" LOG.info("Running scout view transcripts") adapter = context.obj['adapter'] if not json: click.echo("Chromosome\tstart\tend\ttranscript_id\thgnc_id\trefseq\tis_primary") for tx_obj in adapter.transcri...
def add_occurrences(events, count): """ Adds an occurrence key to the event object w/ a list of occurrences and adds a popover (for use with twitter bootstrap). The occurrence is added so that each event can be aware of what day(s) it occurs in the month. """ for day in count: for it...
def month_display(year, month, all_month_events, start_day, net, qs, mini=False, request=None, context=None): """ A function that returns an html calendar for the given month in the given year, with the number of events for that month shown on the generated calendar. Start_day is the d...
def day_display(year, month, all_month_events, day): """ Returns the events that occur on the given day. Works by getting all occurrences for the month, then drilling down to only those occurring on the given day. """ # Get a dict with all of the events for the month count = CountHandler(yea...
def variants(store, institute_obj, case_obj, variants_query, page=1, per_page=50): """Pre-process list of variants.""" variant_count = variants_query.count() skip_count = per_page * max(page - 1, 0) more_variants = True if variant_count > (skip_count + per_page) else False variant_res = variants_que...
def sv_variants(store, institute_obj, case_obj, variants_query, page=1, per_page=50): """Pre-process list of SV variants.""" skip_count = (per_page * max(page - 1, 0)) more_variants = True if variants_query.count() > (skip_count + per_page) else False genome_build = case_obj.get('genome_build', '37') ...
def str_variants(store, institute_obj, case_obj, variants_query, page=1, per_page=50): """Pre-process list of STR variants.""" # Nothing unique to STRs on this level. Inheritance? return variants(store, institute_obj, case_obj, variants_query, page, per_page)
def str_variant(store, institute_id, case_name, variant_id): """Pre-process an STR variant entry for detail page. Adds information to display variant Args: store(scout.adapter.MongoAdapter) institute_id(str) case_name(str) variant_id(str) Returns: detailed_info...
def sv_variant(store, institute_id, case_name, variant_id=None, variant_obj=None, add_case=True, get_overlapping=True): """Pre-process an SV variant entry for detail page. Adds information to display variant Args: store(scout.adapter.MongoAdapter) institute_id(str) c...
def parse_variant(store, institute_obj, case_obj, variant_obj, update=False, genome_build='37', get_compounds = True): """Parse information about variants. - Adds information about compounds - Updates the information about compounds if necessary and 'update=True' Args: store(...
def variant_export_lines(store, case_obj, variants_query): """Get variants info to be exported to file, one list (line) per variant. Args: store(scout.adapter.MongoAdapter) case_obj(scout.models.Case) variants_query: a list of variant objects, each one is a dictionary ...
def variants_export_header(case_obj): """Returns a header for the CSV file with the filtered variants to be exported. Args: case_obj(scout.models.Case) Returns: header: includes the fields defined in scout.constants.variants_export EXPORT_HEADER + AD_ref...
def get_variant_info(genes): """Get variant information""" data = {'canonical_transcripts': []} for gene_obj in genes: if not gene_obj.get('canonical_transcripts'): tx = gene_obj['transcripts'][0] tx_id = tx['transcript_id'] exon = tx.get('exon', '-') ...
def get_predictions(genes): """Get sift predictions from genes.""" data = { 'sift_predictions': [], 'polyphen_predictions': [], 'region_annotations': [], 'functional_annotations': [] } for gene_obj in genes: for pred_key in data: gene_key = pred_key[:-...
def variant_case(store, case_obj, variant_obj): """Pre-process case for the variant view. Adds information about files from case obj to variant Args: store(scout.adapter.MongoAdapter) case_obj(scout.models.Case) variant_obj(scout.models.Variant) """ case_obj['bam_files'] = ...
def find_bai_file(bam_file): """Find out BAI file by extension given the BAM file.""" bai_file = bam_file.replace('.bam', '.bai') if not os.path.exists(bai_file): # try the other convention bai_file = "{}.bai".format(bam_file) return bai_file
def variant(store, institute_obj, case_obj, variant_id=None, variant_obj=None, add_case=True, add_other=True, get_overlapping=True): """Pre-process a single variant for the detailed variant view. Adds information from case and institute that is not present on the variant object Args: ...
def observations(store, loqusdb, case_obj, variant_obj): """Query observations for a variant.""" composite_id = ("{this[chromosome]}_{this[position]}_{this[reference]}_" "{this[alternative]}".format(this=variant_obj)) obs_data = loqusdb.get_variant({'_id': composite_id}) or {} obs_da...
def parse_gene(gene_obj, build=None): """Parse variant genes.""" build = build or 37 if gene_obj.get('common'): add_gene_links(gene_obj, build) refseq_transcripts = [] for tx_obj in gene_obj['transcripts']: parse_transcript(gene_obj, tx_obj, build) # select ...
def parse_transcript(gene_obj, tx_obj, build=None): """Parse variant gene transcript (VEP).""" build = build or 37 add_tx_links(tx_obj, build) if tx_obj.get('refseq_id'): gene_name = (gene_obj['common']['hgnc_symbol'] if gene_obj['common'] else gene_obj['hgnc_id']) ...
def transcript_str(transcript_obj, gene_name=None): """Generate amino acid change as a string.""" if transcript_obj.get('exon'): gene_part, part_count_raw = 'exon', transcript_obj['exon'] elif transcript_obj.get('intron'): gene_part, part_count_raw = 'intron', transcript_obj['intron'] el...
def end_position(variant_obj): """Calculate end position for a variant.""" alt_bases = len(variant_obj['alternative']) num_bases = max(len(variant_obj['reference']), alt_bases) return variant_obj['position'] + (num_bases - 1)
def frequency(variant_obj): """Returns a judgement on the overall frequency of the variant. Combines multiple metrics into a single call. """ most_common_frequency = max(variant_obj.get('thousand_genomes_frequency') or 0, variant_obj.get('exac_frequency') or 0) if mo...
def clinsig_human(variant_obj): """Convert to human readable version of CLINSIG evaluation.""" for clinsig_obj in variant_obj['clnsig']: # The clinsig objects allways have a accession if isinstance(clinsig_obj['accession'], int): # New version link = "https://www.ncbi.nlm...
def thousandg_link(variant_obj, build=None): """Compose link to 1000G page for detailed information.""" dbsnp_id = variant_obj.get('dbsnp_id') build = build or 37 if not dbsnp_id: return None if build == 37: url_template = ("http://grch37.ensembl.org/Homo_sapiens/Variation/Explore"...
def cosmic_link(variant_obj): """Compose link to COSMIC Database. Args: variant_obj(scout.models.Variant) Returns: url_template(str): Link to COSMIIC database if cosmic id is present """ cosmic_ids = variant_obj.get('cosmic_ids') if not cosmic_ids: return None els...
def beacon_link(variant_obj, build=None): """Compose link to Beacon Network.""" build = build or 37 url_template = ("https://beacon-network.org/#/search?pos={this[position]}&" "chrom={this[chromosome]}&allele={this[alternative]}&" "ref={this[reference]}&rs=GRCh37") ...
def ucsc_link(variant_obj, build=None): """Compose link to UCSC.""" build = build or 37 url_template = ("http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&" "position=chr{this[chromosome]}:{this[position]}" "-{this[position]}&dgv=pack&knownGene=pack&omimGene=pac...
def spidex_human(variant_obj): """Translate SPIDEX annotation to human readable string.""" if variant_obj.get('spidex') is None: return 'not_reported' elif abs(variant_obj['spidex']) < SPIDEX_HUMAN['low']['pos'][1]: return 'low' elif abs(variant_obj['spidex']) < SPIDEX_HUMAN['medium']['p...
def expected_inheritance(variant_obj): """Gather information from common gene information.""" manual_models = set() for gene in variant_obj.get('genes', []): manual_models.update(gene.get('manual_inheritance', [])) return list(manual_models)
def callers(variant_obj, category='snv'): """Return info about callers.""" calls = set() for caller in CALLERS[category]: if variant_obj.get(caller['id']): calls.add((caller['name'], variant_obj[caller['id']])) return list(calls)
def variant_verification(store, mail, institute_obj, case_obj, user_obj, variant_obj, sender, variant_url, order, comment, url_builder=url_for): """Sand a verification email and register the verification in the database Args: store(scout.adapter.MongoAdapter) mail(scout.server.exten...
def verification_email_body(case_name, url, display_name, category, subcategory, breakpoint_1, breakpoint_2, hgnc_symbol, panels, gtcalls, tx_changes, name, comment): """ Builds the html code for the variant verification emails (order verification and cancel verification) Args: case_nam...
def cancer_variants(store, request_args, institute_id, case_name): """Fetch data related to cancer variants for a case.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) form = CancerFiltersForm(request_args) variants_query = store.variants(case_obj['_id'], category='cancer...
def clinvar_export(store, institute_id, case_name, variant_id): """Gather the required data for creating the clinvar submission form Args: store(scout.adapter.MongoAdapter) institute_id(str): Institute ID case_name(str): case ID variant_id(str): variant._id ...
def get_clinvar_submission(store, institute_id, case_name, variant_id, submission_id): """Collects all variants from the clinvar submission collection with a specific submission_id Args: store(scout.adapter.MongoAdapter) institute_id(str): Institute ID case_name(str): ca...
def variant_acmg(store, institute_id, case_name, variant_id): """Collect data relevant for rendering ACMG classification form.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) variant_obj = store.variant(variant_id) return dict(institute=institute_obj, case=case_obj, varia...
def variant_acmg_post(store, institute_id, case_name, variant_id, user_email, criteria): """Calculate an ACMG classification based on a list of criteria.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) variant_obj = store.variant(variant_id) user_obj = store.user(user_ema...
def evaluation(store, evaluation_obj): """Fetch and fill-in evaluation object.""" evaluation_obj['institute'] = store.institute(evaluation_obj['institute_id']) evaluation_obj['case'] = store.case(evaluation_obj['case_id']) evaluation_obj['variant'] = store.variant(evaluation_obj['variant_specific']) ...
def upload_panel(store, institute_id, case_name, stream): """Parse out HGNC symbols from a stream.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) raw_symbols = [line.strip().split('\t')[0] for line in stream if line and not line.startswith('#')] # chec...
def verified_excel_file(store, institute_list, temp_excel_dir): """Collect all verified variants in a list on institutes and save them to file Args: store(adapter.MongoAdapter) institute_list(list): a list of institute ids temp_excel_dir(os.Path): folder where the temp excel files are w...
def build_hpo_term(hpo_info): """Build a hpo_term object Check that the information is correct and add the correct hgnc ids to the array of genes. Args: hpo_info(dict) Returns: hpo_obj(scout.models.HpoTerm): A dictionary with hpo information ...
def export_genes(adapter, build='37'): """Export all genes from the database""" LOG.info("Exporting all genes to .bed format") for gene_obj in adapter.all_genes(build=build): yield gene_obj
def parse_clnsig(acc, sig, revstat, transcripts): """Get the clnsig information Args: acc(str): The clnsig accession number, raw from vcf sig(str): The clnsig significance score, raw from vcf revstat(str): The clnsig revstat, raw from vcf transcripts(iterable(dict)) Returns...
def index(context, collection_name): """Show all indexes in the database""" LOG.info("Running scout view index") adapter = context.obj['adapter'] i = 0 click.echo("collection\tindex") for collection_name in adapter.collections(): for index in adapter.indexes(collection_name): ...
def groups(context, institute_id, phenotype_group, group_abbreviation, group_file, add): """ Update the phenotype for a institute. If --add the groups will be added to the default groups. Else the groups will be replaced. """ adapter = context.obj['adapter'] LOG.info("Running scout update instit...
def parse_compounds(compound_info, case_id, variant_type): """Get a list with compounds objects for this variant. Arguments: compound_info(str): A Variant dictionary case_id (str): unique family id variant_type(str): 'research' or 'clinical' Returns: ...
def genes(context, build, json): """Export all genes from a build""" LOG.info("Running scout export genes") adapter = context.obj['adapter'] result = adapter.all_genes(build=build) if json: click.echo(dumps(result)) return gene_string = ("{0}\t{1}\t{2}\t{3}\t{4}") c...
def build_individual(ind): """Build a Individual object Args: ind (dict): A dictionary with individual information Returns: ind_obj (dict): A Individual object dict( individual_id = str, # required display_name = str, sex = str, ...
def variants(context, case_id, institute, force, cancer, cancer_research, sv, sv_research, snv, snv_research, str_clinical, chrom, start, end, hgnc_id, hgnc_symbol, rank_treshold): """Upload variants to a case Note that the files has to be linked with the case, if they ...
def case(institute_id, case_name): """Return a variant.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) if case_obj is None: return abort(404) return Response(json_util.dumps(case_obj), mimetype='application/json')
def variant(institute_id, case_name, variant_id): """Display a specific SNV variant.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) variant_obj = store.variant(variant_id) return Response(json_util.dumps(variant_obj), mimetype='application/json')
def collections(context): """Show all collections in the database""" LOG.info("Running scout view collections") adapter = context.obj['adapter'] for collection_name in adapter.collections(): click.echo(collection_name)
def institute(ctx, internal_id, display_name, sanger_recipients): """ Create a new institute and add it to the database """ adapter = ctx.obj['adapter'] if not internal_id: logger.warning("A institute has to have an internal id") ctx.abort() if not display_name: displa...
def institute(context, institute_id, sanger_recipient, coverage_cutoff, frequency_cutoff, display_name, remove_sanger): """ Update an institute """ adapter = context.obj['adapter'] LOG.info("Running scout update institute") try: adapter.update_institute( i...
def get_file_handle(file_path): """Return a opened file""" if file_path.endswith('.gz'): file_handle = getreader('utf-8')(gzip.open(file_path, 'r'), errors='replace') else: file_handle = open(file_path, 'r', encoding='utf-8') return file_handle
def _inc_day(year, month, day, net): """Increments the day by converting to a datetime.date().""" d = date(year, month, day) new_d = d + timezone.timedelta(days=net) return new_d.year, new_d.month, new_d.day
def get_net(req): """Get the net of any 'next' and 'prev' querystrings.""" try: nxt, prev = map( int, (req.GET.get('cal_next', 0), req.GET.get('cal_prev', 0)) ) net = nxt - prev except Exception: net = 0 return net
def order_events(events, d=False): """ Group events that occur on the same day, then sort them alphabetically by title, then sort by day. Returns a list of tuples that looks like [(day: [events])], where day is the day of the event(s), and [events] is an alphabetically sorted list of the events for ...
def get_next_and_prev(net): """Returns what the next and prev querystrings should be.""" if net == 0: nxt = prev = 1 elif net > 0: nxt = net + 1 prev = -(net - 1) else: nxt = net + 1 prev = abs(net) + 1 return nxt, prev
def _check_year(year, month, error, error_msg): """Checks that the year is within 50 years from now.""" if year not in xrange((now.year - 50), (now.year + 51)): year = now.year month = now.month error = error_msg return year, month, error
def clean_year_month(year, month, month_orig): """ If 'month_orig', which is the month given in the url BEFORE any next/prev query strings have been applied, is out of range, sets month to the current month and returns an error message. Also Returns an error message if the year given is +/- 50 years...
def check_weekday(year, month, day, reverse=False): """ Make sure any event day we send back for weekday repeating events is not a weekend. """ d = date(year, month, day) while d.weekday() in (5, 6): if reverse: d -= timedelta(days=1) else: d += timedelta(...
def parse_case_data(config=None, ped=None, owner=None, vcf_snv=None, vcf_sv=None, vcf_cancer=None, vcf_str=None, peddy_ped=None, peddy_sex=None, peddy_check=None, delivery_report=None, multiqc=None): """Parse all data necessary for loading a case into scout This can be d...
def add_peddy_information(config_data): """Add information from peddy outfiles to the individuals""" ped_info = {} ped_check = {} sex_check = {} relations = [] if config_data.get('peddy_ped'): file_handle = open(config_data['peddy_ped'], 'r') for ind_info in parse_peddy_ped(file...
def parse_individual(sample): """Parse individual information Args: sample (dict) Returns: { 'individual_id': str, 'father': str, 'mother': str, 'display_name': str, 'sex': str, ...