Skip to content

Instantly share code, notes, and snippets.

View IsmailM's full-sized avatar
👋
Focusing

Ismail Moghul IsmailM

👋
Focusing
View GitHub Profile
#########
#Script running methylkit on the gold standard/aging data set
#########
library(methylKit)
library(bsseq)
library(BiocParallel)
library(here)
library(data.table)
const z_data = [
[252.66, 252.77, 252.91, 253.06, 253.24, 253.43, 253.61, 253.79, 253.96, 254.12, 254.26, 254.38, 254.49, 254.58, 254.66, 254.74, 254.82, 254.92, 255.05, 255.22, 255.43, 255.7, 256.04, 256.44, 256.89, 257.39, 257.93, 258.48, 259.03, 259.56, 260.04, 260.46, 260.82, 261.09, 261.29, 261.41, 261.46, 261.45, 261.4, 261.31, 261.2, 261.08, 260.95, 260.81, 260.68, 260.54, 260.39, 260.24, 260.07, 259.88, 259.68, 259.46, 259.23, 259, 258.77, 258.56, 258.37, 258.22, 258.11, 258.05, 258.04, 258.08, 258.16, 258.29, 258.46, 258.66, 258.87, 259.09, 259.31, 259.53, 259.73, 259.91, 260.08, 260.24, 260.39, 260.53, 260.66, 260.8, 260.94, 261.08, 261.21, 261.35, 261.48, 261.61, 261.73, 261.85, 261.98, 262.12, 262.26, 262.42, 262.6, 262.81, 263.03, 263.28, 263.55, 263.84, 264.14, 264.44, 264.74, 265.03, 265.32, 265.6, 265.86, 266.11, 266.35, 266.57, 266.78, 266.98, 267.17, 267.35, 267.51, 267.66, 267.81, 267.94, 268.07, 268.2, 268.33, 268.46, 268.59, 268.74, 268.89, 269.06, 269.23, 269.41, 269.59, 269.76, 269.91
@IsmailM
IsmailM / analysis.sh
Last active September 22, 2022 16:31
chromimpute analysis
#!/bin/bash
set -eux
CONVERTED_DIR=alt/v4/01_converted_data
GLOBAL_DIST_DIR=alt/v4/02_global_dist
TRAINDATA_DIR=alt/v4/03_traindata
TRAINED_PREDICTORS_DIR=alt/v4/04_trained_predictors
APPLY_DATA_DIR=alt/v4/05_apply_data
mkdir -p ${CONVERTED_DIR}
@IsmailM
IsmailM / H3K27ac--marks.csv
Last active September 22, 2022 16:25
ChromImpute run on individual marks
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
# Example marks.csv generated by the above script
D1 H3K27ac IHECRE00000101.3.31b03180-586e-4b42-aa9e-2a124599ee9d.pval0.01.500K.narrowPeak.gz
D2 H3K27ac IHECRE00000027.3.97de962a-0cae-4248-ab76-3d3fe1777a34.pval0.01.500K.narrowPeak.gz
D3 H3K27ac IHECRE00000048.3.1896e4ef-d88b-439f-9ac2-0cee1d66c3f3.pval0.01.500K.narrowPeak.gz
D4 H3K27ac IHECRE00000155.3.8279b76b-57ad-4ec8-b5cb-d16fdac7512c.pval0.01.500K.narrowPeak.gz
D5 H3K27ac IHECRE00000774.3.0226d0bd-e448-4e8e-922e-bd3e7a7abd00.pval0.01.500K.narrowPeak.gz
D6 H3K27ac IHECRE00000866.3.0925b7f7-7c86-40ca-bdc0-1ca853709a23.pval0.01.500K.narrowPeak.gz
D7 H3K27ac IHECRE00000718.3.4124a800-a44d-4bfe-b76a-06de52b79d79.pval0.01.500K.narrowPeak.gz
D8 H3K27ac IHECRE00000828.1.45bbe382-78c1-4fac-99df-1349446e9df6.pval0.01.500K.narrowPeak.gz
@IsmailM
IsmailM / analysis.sh
Created September 22, 2022 16:19
ChromImpute - Run on all marks
#!/bin/bash
set -eux
CONVERTED_DIR=alt/v3/01_converted_data
GLOBAL_DIST_DIR=alt/v3/02_global_dist
TRAINDATA_DIR=alt/v3/03_traindata
TRAINED_PREDICTORS_DIR=alt/v3/04_trained_predictors
APPLY_DATA_DIR=alt/v3/05_apply_data
@IsmailM
IsmailM / Dockerfile
Last active December 2, 2021 09:37
GV docker file
FROM ubuntu:latest
RUN apt update && apt install -y --no-install-recommends curl ca-certificates
# Latest version can be determined by running:
# curl -ksL https://api.github.com/repos/wurmlab/genevalidator/releases/latest | grep browser_download_url | grep -i linux | cut -d '"' -f 4
ENV DOWNLOAD_URL https://github.com/wurmlab/genevalidator/releases/download/2.1.11/genevalidator-2.1.11-linux-x86_64.tar.gz
WORKDIR /GV
@IsmailM
IsmailM / produce_react_files.py
Last active July 26, 2021 14:49
Produce JSON files from GenomeChronicler output
import os
import csv
import json
import re
import sqlite3
import sys
from shutil import copyfile
import html
def execute_db_query(query, data):
@IsmailM
IsmailM / PGP_fastq_files.sh
Last active June 11, 2020 22:21
using the PGP api to get fastq urls, md5s and sizes
# The below is using JQ from https://stedolan.github.io/jq/ +
# the PGP API v1.2 - https://www.personalgenomes.org.uk/api/v1.2/
curl -X GET "https://www.personalgenomes.org.uk/api/v1.2/all_wgs" -H "accept: application/json" | jq -r '
.[] | [
.hex_id,
(.data[]?.fastq_ftp),
(.data[]?.fastq_md5),
(.data[]?.fastq_bytes | split(";") | .[] | tonumber | . /1024/1024/1024)
] | flatten | @csv' > wgs_fastqs.csv
FROM biocontainers/biocontainers:latest
USER root
RUN conda install samtools=1.3.1 bioconductor-wes.1kg.wugsc r-optparse \
r-data.table r-devtools r-curl r-xml r-biocmanager
RUN ln -s /bin/tar /bin/gtar
# Other R dependencies
@IsmailM
IsmailM / rails-jsonb-queries
Created April 23, 2020 00:49 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")