### Environment Setup Script Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This script is designed to set up the necessary environment for the project. It likely installs dependencies, configures paths, and prepares the system for running the analysis. This is commonly done using shell scripting. ```Bash #!/bin/bash # Update package lists sudo apt-get update -y # Install Python and R dependencies sudo apt-get install python3 python3-pip r-base -y # Install Python packages pip3 install pandas numpy scikit-learn # Install R packages Rscript -e "install.packages(c('data.table', 'dplyr', 'ggplot2'))" echo "Environment setup complete." ``` -------------------------------- ### R Script for Package Installation and Loading Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This R script demonstrates how to install and load R packages. It uses 'install.packages()' for installation (if needed) and 'library()' for loading packages into the current session. Essential for managing dependencies. ```R # Install a package if it's not already installed if (!requireNamespace("dplyr", quietly = TRUE)) { install.packages("dplyr") } # Load the package library(dplyr) print("dplyr package loaded successfully.") ``` -------------------------------- ### Dockerfile Examples Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/tabix_use_case.html Sample Dockerfile configurations for creating containerized applications. These snippets demonstrate setting up environments, installing dependencies, and defining entry points for Docker images. ```dockerfile # Use an official Python runtime as a parent image FROM python:3.9-slim # Set the working directory in the container WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Make port 80 available to the world outside this container EXPOSE 80 # Define environment variable ENV NAME World # Run app.py when the container launches CMD ["python", "app.py"] # Example for a Node.js application # FROM node:16 # WORKDIR /usr/src/app # COPY package*.json ./ # RUN npm install # COPY . . # EXPOSE 3000 # CMD [ "node", "server.js" ] # Example for a basic Ubuntu image # FROM ubuntu:latest # RUN apt-get update && apt-get install -y --no-install-recommends \ # package1 \ # package2 \ # && rm -rf /var/lib/apt/lists/* # CMD ["echo", "Hello from Ubuntu container!"] ``` -------------------------------- ### Python Package Management (pip) Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Demonstrates basic usage of pip, the Python package installer, for installing, upgrading, and uninstalling packages. Effective package management is key to Python development. ```Python # Install a package # pip install numpy # Upgrade a package # pip install --upgrade pandas # Uninstall a package # pip uninstall requests # List installed packages # pip freeze ``` -------------------------------- ### Tooltip Initialization and Usage Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Demonstrates how to initialize and use the Bootstrap tooltip plugin. It covers the basic setup, handling of different trigger events (hover, focus), and options for customization like placement, delay, and HTML content. ```javascript function b(b){ return this.each(function(){ var d=a(this), e=d.data("bs.tooltip"), f="object"==typeof b&&b; (e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]()) }) } var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)}; c.VERSION="3.3.5", c.TRANSITION_DURATION=150, c.DEFAULTS={ animation:!0, placement:"top", selector:!1, template:'', trigger:"hover focus", title:"", delay:0, html:!1, container:!1, viewport:{ selector:"body", padding:0 } }, c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()}, c.prototype.getDefaults=function(){return c.DEFAULTS}, c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b}, c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b}, c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())}, c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1}, c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())}, c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-l final_report.txt summary.txt: data.csv awk '{ sum += $2 } END { print sum }' data.csv > summary.txt plot.png: data.csv Rscript plot_script.R data.csv plot.png ``` -------------------------------- ### Dockerfile for Environment Setup Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/tabix_use_case.html A Dockerfile defining the environment for running the project's components. It specifies the base image, installs dependencies, and sets up the necessary environment variables for containerization. ```dockerfile FROM python:3.9-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY scripts/ /app/scripts/ COPY data/ /app/data/ CMD ["python", "scripts/process_data.py"] ``` -------------------------------- ### Install and Load R Packages Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/API_v2/eQTL_API_tutorial.html Installs and loads necessary R packages for data manipulation, API requests, and colocalisation analysis. Includes instructions for installing packages if they are not already present. ```R # If you do not already have all packages installed you can use this syntax to install them: #install.packages(c("tidyverse", "httr", "jsonlite", "dplyr", "coloc", "ggrepel", "glue")) library("tidyverse") library("httr") library("glue") library("dplyr") library("coloc") library("jsonlite") library("ggrepel") ``` -------------------------------- ### Event Handling Utilities Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Provides core utilities for managing events in JavaScript, including custom event creation, event delegation, and event normalization. It details the setup and trigger mechanisms for various events like 'click', 'focus', 'blur', 'mouseenter', and 'mouseleave'. ```javascript S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)};S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}}) ``` -------------------------------- ### Configuration File Example (YAML) Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/tabix_use_case.html An example of a YAML configuration file used to define parameters for data processing or analysis pipelines. This file might specify input/output paths, thresholds, or experimental conditions. ```yaml project_name: "eqtl-catalogue-resources" input_files: genotype_data: "data/genotypes.vcf.gz" expression_data: "data/expression_matrix.tsv" sample_metadata: "data/samples.csv" analysis_parameters: p_value_threshold: 0.05 min_maf: 0.01 cis_window: 1000000 # in base pairs output_settings: results_directory: "./results/analysis_run_1" log_file: "./logs/analysis.log" ``` -------------------------------- ### JSON Configuration Examples Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/tabix_use_case.html Examples of JSON data structures used for configuration files, data exchange, or API responses. These snippets illustrate valid JSON syntax and common patterns. ```json { "projectName": "eqtl-catalogue-resources", "version": "1.0.0", "description": "Resources for the eqtl-catalogue project.", "author": "Your Name", "license": "MIT", "dependencies": [ "numpy", "pandas", "scipy" ], "settings": { "dataPath": "/data/eqtl", "resultsPath": "/results/eqtl", "logLevel": "INFO", "parallelProcessing": true, "maxCores": 8 }, "apiEndpoints": { "baseUrl": "https://api.example.com/v1", "methods": { "getData": "/data/{id}", "postConfig": "/config" } }, "featureFlags": { "newAnalysis": false, "betaFeature": true } } ``` -------------------------------- ### Python Data Structure Initialization - Mixed Examples Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This snippet provides a mix of initialization techniques for Python data structures, combining different methods for creating lists, dictionaries, and sets. ```Python # Mixed initialization examples # List with mixed types mixed_list = [1, 'hello', 3.14, True] print(f"Mixed type list: {mixed_list}") # Dictionary with different value types complex_dict = { 'name': 'Alice', 'age': 30, 'is_student': False, 'grades': [90, 85, 92] } print(f"Complex dictionary: {complex_dict}") # Set with various data types various_set = {1, 'apple', 3.14, 1, 'banana', 'apple'} print(f"Set with various types: {various_set}") ``` -------------------------------- ### Get and Set CSS Properties with jQuery Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Demonstrates how to get and set CSS properties using jQuery's `css()` method. It handles different types of values and units, including special cases for opacity and margin. ```JavaScript S.extend({ cssHooks: { opacity: { get: function(e, t) { if (t) { var n = We(e, "opacity"); return "" === n ? "1" : n; } } } }, cssNumber: { animationIterationCount: !0, columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, gridArea: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnStart: !0, gridRow: !0, gridRowEnd: !0, gridRowStart: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: {}, style: function(e, t, n, r) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var i, o, a, s = X(t), u = Xe.test(t), l = e.style; if (u || (t = ze(s)), a = S.cssHooks[t] || S.cssHooks[s], void 0 === n) return a && "get" in a && void 0 !== (i = a.get(e, !1, r)) ? i : l[t]; "string" === (o = typeof n) && (i = te.exec(n)) && i[1] && (n = se(e, t, i), o = "number"), null != n && n == n && ("number" !== o || u || (n += i && i[3] || (S.cssNumber[s] ? "" : "px")), y.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (l[t] = "inherit"), a && "set" in a && void 0 === (n = a.set(e, n, r)) || (u ? l.setProperty(t, n) : l[t] = n)) } }, css: function(e, t, n, r) { var i, o, a, s = X(t); return Xe.test(t) || (t = ze(s)), (a = S.cssHooks[t] || S.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)), void 0 === i && (i = We(e, t, r)), "normal" === i && t in Ge && (i = Ge[t]), "" === n || n ? (o = parseFloat(i), !0 === n || isFinite(o) ? o || 0 : i) : i } }); S.fn.extend({ css: function(e, t) { return $(this, function(e, t, n) { var r, i, o = {}, a = 0; if (Array.isArray(t)) { for (r = Re(e), i = t.length; a < i; a++) o[t[a]] = S.css(e, t[a], !1, r); return o } return void 0 !== n ? S.style(e, t, n) : S.css(e, t) }, e, t, 1 < arguments.length) } }); ``` -------------------------------- ### Bash Script for Data Download/Setup Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This bash script is likely used for setting up the environment or downloading necessary data files for the EQTL catalogue project. It might involve commands like `wget`, `curl`, or `git clone`. ```bash #!/bin/bash # Define data directory DATA_DIR="./data" # Create data directory if it doesn't exist mkdir -p $DATA_DIR # Example: Download a reference genome file GENOME_URL="http://example.com/reference_genome.fa.gz" GENOME_FILE="$DATA_DIR/reference_genome.fa.gz" if [ ! -f "$GENOME_FILE" ]; then echo "Downloading reference genome..." wget -O "$GENOME_FILE" "$GENOME_URL" if [ $? -eq 0 ]; then echo "Reference genome downloaded successfully." else echo "Error downloading reference genome." exit 1 fi else echo "Reference genome already exists." fi # Example: Clone a repository for auxiliary tools # REPO_URL="https://github.com/user/eqtl_tools.git" # git clone "$REPO_URL" "$DATA_DIR/eqtl_tools" echo "Setup complete." ``` -------------------------------- ### jQuery Event Special Handling Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Details the mechanism for creating special event handlers in jQuery, allowing for custom event behavior. This includes defining `setup`, `add`, `remove`, `trigger`, and `teardown` methods for specific event types. Examples like `focusin`/`focusout` and `hover` demonstrate this capability. ```javascript jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var events, handle, eventsType, handleObj, temp, handlers; if ( elem.nodeType === 3 || elem.nodeType === 8 || !types ) { return; } if ( !( events = jQuery._data( elem, "events" ) ) ) { events = jQuery._data( elem, "events", {} ); } if ( !( handle = events.handle ) ) { events.handle = handle = function( e ) { return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( elem, arguments ) : void 0; }; } types = ( types || "" ).match( jQuery.event.trigger ) || ["" ]; while ( ( typesType = types.pop() ) ) { temp = typesType.split( "." ); typesType = temp.shift(); handleObj = { type: typesType, origType: typesType, data: data, handler: handler, guid: handler.guid || ( handler.guid = jQuery.guid++ ), selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: temp.join( "." ) }; if ( !( handlers = events[ typesType ] ) ) { handlers = events[ typesType ] = []; handlers.delegateCount = 0; if ( !selector && jQuery.event.special[ typesType ] && false === jQuery.event.special[ typesType ].setup.call( elem, data, temp, handle ) ) { typesType = void 0; } } if ( !selector ) { handlers.unshift( handleObj ); } else { handlers.add = handleObj; handlers.delegateCount++; } if ( jQuery.event.global[ typesType ] == null ) { jQuery.event.global[ typesType ] = true; } } }, remove: function( elem, types, handler, selector, mappedTypes ) { var events, handle, eventsType, handleObj, temp, handlers, cur, j, k, l; if ( elem.nodeType === 3 || elem.nodeType === 8 || !types ) { return; } if ( !( events = jQuery._data( elem, "events" ) ) ) { return; } if ( !( handle = events.handle ) ) { return; } types = ( types || "" ).match( jQuery.event.trigger ) || ["" ]; while ( ( typesType = types.pop() ) ) { temp = typesType.split( "." ); typesType = temp.shift(); if ( !typesType || events[ typesType ] ) { handlers = events[ typesType ] || []; cur = typesType && jQuery.event.special[ typesType ]; if ( !selector || !cur || !cur.noForward ) { if ( !selector ) { for ( j in handlers ) { handleObj = handlers[ j ]; if ( handleObj.id === handler || jQuery.event.remove( elem, handleObj.origType + temp.join("."), handleObj.handler, selector, true ) ) { jQuery.event.remove( elem, handleObj.origType, handleObj.handler, selector, true ); handlers.splice( j--, 1 ); } } } else if ( handler ) { for ( k = handlers.length - 1; k >= 0; k-- ) { handleObj = handlers[ k ]; if ( handleObj.id === handler || handleObj.id === handler.guid ) { if ( selector === handleObj.selector ) { handlers.splice( k, 1 ); } if ( handleObj.nodeType ) { handlers.splice( k, 1 ); } } } } if ( handlers.length === 0 ) { if ( !selector ) { jQuery.event.remove( elem, typesType ); } jQuery.event.remove( elem, typesType, handle, selector, true ); delete events[ typesType ]; } if ( cur && cur.remove && cur.remove.call( elem, handler, selector ) !== false ) { jQuery.event.remove( elem, typesType, handle, selector, true ); } } } } if ( jQuery.isEmptyObject( events ) ) { jQuery.removeData( elem, "handle events" ); } }, dispatch: function( event ) { event = event || jQuery.event.fix( event ); var handlers = jQuery._data( this, "events" )[ event.type ] || [], args = arguments, i = 0, handleObj; event.delegateTarget = this; if ( jQuery.event.special[ event.type ] && jQuery.event.special[ event.type ].preDispatch && jQuery.event.special[ event.type ].preDispatch.call( this, event ) === false ) { return; } while ( ( handleObj = handlers[ i++ ] ) ) { if ( event.isDefaultPrevented() ) break; event.currentTarget = this; if ( handleObj.handler.apply( this, args ) !== false ) { if ( event.type !== "click" ) { if ( !( event.isPropagationStopped() || event.isImmediatePropagationStopped() ) ) { jQuery.event.trigger( event, null, event.target ); } } } } return event.result; }, trigger: function( type, data, elem, onlyHandlers ) { var event, handler, args, i, j, k; if ( type && typeof type === "object" ) { data = type; type = data.type; } else { type = ( type || "" ).match( jQuery.event.trigger ) || ["" ]; } if ( !elem ) { elem = document; } event = jQuery.extend( jQuery.Event.prototype, { type: type, target: elem, currentTarget: elem } ); if ( jQuery.acceptData( elem ) ) { jQuery.event.trigger( event, data, elem, false ); } if ( event.isDefaultPrevented() ) { return; } if ( !onlyHandlers ) { if ( jQuery.acceptData( elem ) ) { jQuery.event.trigger( event, data, elem, true ); } } return event.result; }, triggerHandler: function( type, data, elem ) { var event = jQuery.extend( jQuery.Event.prototype, { type: type, target: elem, currentTarget: elem } ); if ( jQuery.acceptData( elem ) ) { jQuery.event.trigger( event, data, elem, false, true ); } return event.result; } }; ``` -------------------------------- ### Download and Setup qcnorm Workflow Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/workflow_execution.md Clones the eQTL-Catalogue/qcnorm workflow repository from GitHub and navigates into the workflow directory. ```bash git clone https://github.com/eQTL-Catalogue/qcnorm.git cd qcnorm ``` -------------------------------- ### R Script for Working with Directories Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This R script demonstrates how to manage directories, including creating, setting, and listing directory contents. Functions like 'dir.create', 'setwd', and 'list.files' are used. Proper directory management is key for organizing project files. ```R # Create a new directory dir.create("new_results_folder") # Set the working directory # setwd("path/to/your/project") # List files in the current directory current_files <- list.files() print(current_files) # List files in a specific directory output_files <- list.files("output_dir") print(output_files) ``` -------------------------------- ### Data Structure Initialization and Assignment Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This snippet shows the initialization and assignment of values to data structures, possibly dictionaries or custom objects, indicating data setup for further processing. ```Python data_dict = {'key1': 'value1', 'key2': 123} print(data_dict['key1']) ``` -------------------------------- ### Download and Setup rnaseq Workflow Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/workflow_execution.md Clones the eQTL-Catalogue/rnaseq workflow repository from GitHub and navigates into the workflow directory. ```bash git clone https://github.com/eQTL-Catalogue/rnaseq.git cd rnaseq ``` -------------------------------- ### Computed Style Retrieval Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html A utility function to get computed styles of an element. It handles cross-browser compatibility and correctly retrieves style properties, including those with units like '%'. ```javascript function Re(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)} ``` -------------------------------- ### jQuery Event Special Handling (Focus) Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Details the special event handling for `focusin` and `focusout` events in jQuery, including setup and simulation logic to ensure cross-browser compatibility. ```javascript var mt = /^(?:focusinfocus|focusoutblur)$/; var xt = function(e) { e.stopPropagation() }; S.event.special[r] = { setup: function() { // ... setup for focus events } }; ``` -------------------------------- ### Configuration File Example (YAML) Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/tabix_use_case.html An example of a YAML configuration file used for project settings. This file defines parameters such as data thresholds, file paths, and processing options, making the scripts more flexible and maintainable. ```yaml threshold: 0.05 input_directory: "data/raw" output_directory: "data/processed" log_level: "INFO" analysis_parameters: method: "linear_regression" alpha: 0.01 ``` -------------------------------- ### Text Content Manipulation Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Allows getting or setting the text content of elements. `text()` retrieves the combined text of all elements in the set. When a value is provided, it replaces the text content of each element. ```javascript S.fn.extend({text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)})} ``` -------------------------------- ### Python Date and Time Handling Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Demonstrates how to work with dates and times in Python using the `datetime` module. This includes getting the current date and time, formatting dates, and performing date arithmetic. ```Python from datetime import datetime # Get current date and time now = datetime.now() print(f"Current date and time: {now}") # Format date and time formatted_time = now.strftime("%Y-%m-%d %H:%M:%S") print(f"Formatted time: {formatted_time}") # Create a date object date_obj = datetime(2023, 10, 27) print(f"Specific date: {date_obj}") ``` -------------------------------- ### Value Manipulation Methods Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Details the jQuery `val()` method for getting and setting the value of form elements such as input, textarea, and select. It also includes specific `valHooks` for different element types. ```javascript S.fn.extend({ val: function(n) { // ... implementation for getting/setting values } }); S.extend({ valHooks: { option: { get: function(e) { // ... get option value } }, select: { get: function(e) { // ... get select value }, set: function(e, t) { // ... set select value } } } }); S.each(["radio", "checkbox"], function() { S.valHooks[this] = { set: function(e, t) { // ... set checkbox/radio value } }; }); ``` -------------------------------- ### YAML Configuration Examples Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/tabix_use_case.html Sample YAML configurations for defining project settings, application parameters, or infrastructure definitions. YAML's human-readable format makes it suitable for configuration management. ```yaml project: name: eqtl-catalogue-resources version: 1.0.0 description: Resources for the eqtl-catalogue project. author: name: Your Name email: your.email@example.com settings: data_path: /data/eqtl results_path: /results/eqtl log_level: INFO parallel_processing: true max_cores: 8 output_formats: - csv - tsv api: base_url: https://api.example.com/v1 endpoints: get_data: /data/{id} post_config: /config features: new_analysis: false beta_feature: true services: database: type: postgresql host: db.example.com port: 5432 username: user password: "secure_password" cache: type: redis host: cache.example.com port: 6379 ``` -------------------------------- ### R Script for Configuration Loading Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This R script shows how to load configuration settings, possibly from a YAML or JSON file. It uses functions from libraries like 'yaml' or 'jsonlite'. This is crucial for managing parameters in data analysis pipelines. ```R library(yaml) # Load configuration from a YAML file config <- read_yaml("config.yaml") # Access configuration parameters output_path <- config$output_directory print(paste("Output path from config:", output_path)) ``` -------------------------------- ### jQuery Attribute Manipulation Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Provides methods for interacting with HTML attributes of elements. `attr` is used to get or set attributes, while `removeAttr` removes attributes. It handles boolean attributes and custom attribute hooks. ```javascript var ct, pt = /^(?:input|select|textarea|button)$/i, dt = /^(?:a|area)$/i; function ht(e) { return (e.match(P) || []).join(" "); } function gt(e) { return e.getAttribute && e.getAttribute("class") || ""; } function vt(e) { return Array.isArray(e) ? e : "string" == typeof e && e.match(P) || []; } S.fn.extend({ attr: function(e, t) { return $(this, S.attr, e, t, 1 < arguments.length); }, removeAttr: function(e) { return this.each(function() { S.removeAttr(this, e); }); } }); S.extend({ attr: function(e, t, n) { var r, i, o = e.nodeType; if (3 !== o && 8 !== o && 2 !== o) return "undefined" == typeof e.getAttribute ? S.prop(e, t, n) : ("undefined" == typeof e.getAttribute ? S.prop(e, t, n) : (1 === o && S.isXMLDoc(e) || (i = S.attrHooks[t.toLowerCase()] || (S.expr.match.bool.test(t) ? ct : void 0)), void 0 !== n ? (null === n ? void S.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), n)) : null === (r = S.attrHooks[t.toLowerCase()]) || "get" in r && null !== (r = r.get(e, t)) ? r : null == (r = S.find.attr(e, t)) ? void 0 : r)); }, attrHooks: { type: { set: function(e, t) { if (!y.radioValue && "radio" === t && A(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t; } } } }, removeAttr: function(e, t) { var n, r = 0, i = t && t.match(P); if (i && 1 === e.nodeType) while (n = i[r++]) e.removeAttribute(n); } }); ct = { set: function(e, t, n) { return !1 === t ? S.removeAttr(e, n) : e.setAttribute(n, n), n; } }; S.each(S.expr.match.bool.source.match(/\w+/g), function(e, t) { var a = ft[t] || S.find.attr; ft[t] = function(e, t, n) { var r, i, o = t.toLowerCase(); return n || (i = ft[o], ft[o] = r, r = null != a(e, t, n) ? o : null, ft[o] = i), r; }; }); ``` -------------------------------- ### jQuery Tween Animation Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This snippet defines the `Ke` (Tween) object in jQuery, which is responsible for handling animations. It includes initialization, property hooks, and the `cur` function to get the current value of the animated property. ```JavaScript ((S.Tween = Ke).prototype = { constructor: Ke, init: function(e, t, n, r, i, o) { this.elem = e, this.prop = n, this.easing = i || S.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (S.cssNumber[n] ? "" : "px") }, cur: function() { var e = Ke.propHooks[this.prop]; return e && e.get ? e.get(this) : Ke.propHooks._default.get(this) } }); ``` -------------------------------- ### jQuery Modal Initialization and Event Handling Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Demonstrates how to initialize the jQuery Modal plugin and handle its core methods like 'show', 'hide', and 'toggle'. It also shows how to attach event listeners for modal lifecycle events. ```javascript var Modal = $.fn.modal.Constructor // Override the default modal behavior $.fn.modal = function (option, relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) { $this.data('bs.modal', (data = new Modal(this, options))) } if (typeof option == 'string') { data[option](relatedTarget) } else if (options.show) { data.show(relatedTarget) } }) } $.fn.modal.Constructor = Modal $.fn.modal.noConflict = function () { $.fn.modal = $.fn.modal.Constructor return this } // Data-API initialization $(document) .on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { var $this = $(this) var href = $this.attr('href') var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^s]+$)/, ''))) var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) if ($this.is('a')) { e.preventDefault() } $target.one('show.bs.modal', function (showEvent) { if (showEvent.isDefaultPrevented()) return $target.one('shown.bs.modal', function () { $this.trigger('focus') }) }) $('[data-toggle="modal"]').modal(option, $this) }) ``` -------------------------------- ### Bash Scripting for File Operations Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/API_v2/eQTL_API_tutorial.html This example demonstrates basic Bash scripting for file operations, including creating a directory and copying a file. It utilizes standard Unix commands like `mkdir` and `cp`. This script is intended for execution in a Unix-like environment. ```Bash mkdir my_new_directory cp source_file.txt my_new_directory/destination_file.txt ``` -------------------------------- ### Style Property Access Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html Provides a way to get or set style properties of elements. It handles different ways styles might be defined (inline, computed) and ensures correct unit handling for pixel values. ```javascript function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}} ``` -------------------------------- ### Variant Annotation Pipeline (Bash) Source: https://github.com/eqtl-catalogue/eqtl-catalogue-resources/blob/master/tutorials/coloc.susie/coloc_susie.html This bash script outlines a pipeline for annotating genetic variants. It utilizes common bioinformatics tools like VEP (Variant Effect Predictor) and BEDTools. Ensure these tools are installed and in your PATH. ```Bash #!/bin/bash # Input VCF file VCF_FILE="input.vcf" # Output annotated VCF file ANNOTATED_VCF="annotated.vcf" # Output VEP cache directory VEP_CACHE="/path/to/vep/cache" # Ensure VEP cache is set export PERL5LIB=$PERL5LIB:/path/to/ensembl-tools-web/scripts export PATH=$PATH:/path/to/ensembl-tools-web/scripts # Annotate variants using VEP # vep --input_file $VCF_FILE --output_file $ANNOTATED_VCF --cache --dir_cache $VEP_CACHE --force_overwrite --vcf --compress_output gzip --fork 8 # Example: Filter annotated VCF using BEDTools (e.g., keep only missense variants) # bedtools intersect -a $ANNOTATED_VCF -b <(grep "MISSENSE" $ANNOTATED_VCF) -header > missense_variants.vcf # echo "Variant annotation complete. Annotated VCF: $ANNOTATED_VCF" # echo "Missense variants saved to: missense_variants.vcf" # Note: This script is a template. Uncomment and adjust commands based on your specific needs and VEP configuration. ```