This one-liner pivots data from group>users or user>groups:
$ cat incoming.json \
| jq 'map(. as $in | .users[] | . as $u | {user:$u, group:$in.group}) | group_by(.user) | map({user:.[0].user, groups: map(.group)})'
[
{| import igv_remote as ir | |
| import keyboard | |
| import numpy as np | |
| import pandas as pd | |
| cohort = "BRCA" | |
| print("cohort: {}".format(cohort)) | |
| # generate localhost http format | |
| def format(uuid): | |
| return("http://localhost:5000/" + uuid + ".bam") |
| #' better display and logging backend | |
| #' | |
| #' @param expr expression to evalutate | |
| #' @param tag_width The width of display box of the message tag | |
| #' @param path where the message goes, default to `stdout()` | |
| #' @param save_conditions if `TRUE`, all conditions will be saved to a list | |
| #' @param quiet if `TRUE`, all messages (error excluded) will be suppressed | |
| #' @examples | |
| #' test_function <- function(){ |
| *bcftools filter | |
| *Filter variants per region (in this example, print out only variants mapped to chr1 and chr2) | |
| qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz | |
| *printing out info for only 2 samples: | |
| bcftools view -s NA20818,NA20819 filename.vcf.gz | |
| *printing stats only for variants passing the filter: | |
| bcftools view -f PASS filename.vcf.gz |
Resolving missing link to libcrypto openssl on OSX from: http://stackoverflow.com/questions/38670295/brew-refusing-to-link-openssl
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
| # Add field | |
| echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
| # { | |
| # "hello": "world", | |
| # "foo": "bar" | |
| # } | |
| # Override field value | |
| echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
| { |
| --- | |
| title: "Auto-numbering and cross-referencing of figures and tables in rmarkdown" | |
| output: html_document | |
| --- | |
| NOTE: I recommend using the bookdown package and `output: html_document2` to make captions and cross-references more easily than the method described below. | |
| TODO: check this out: https://github.com/adletaw/captioner | |
| Here's how to use: |