.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get a list of all organisms | |
| curl -s "http://rest.kegg.jp/list/organism" > organisms-all.txt | |
| # Get just a few of interest | |
| cat organisms-all.txt | awk '$2~/^(hsa|mmu|rno|cfa|bta|gga|xla|xtr|dre|dme|cel|ath|ehi|tgo|eco|sau|mtu|mav|cje|ccol)$/' > organisms-of-interest.txt | |
| # Get the accession codes for each | |
| cut -f1 organisms-of-interest.txt > organisms-of-interest-codes.txt | |
| # Make a directory to put all the kgml files downloaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Illustrating the use of job arrays in SLURM | |
| # use the command: sbatch --array=1-100 job_array_demo.sh | |
| # Partition for the job: | |
| #SBATCH -p main | |
| # Multithreaded (SMP) job: must run on one node | |
| #SBATCH --nodes=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Illustrating the use of job arrays in SLURM | |
| # use the command: sbatch --array=1-100 job_array_demo.sh | |
| # Partition for the job: | |
| #SBATCH -p main | |
| # Multithreaded (SMP) job: must run on one node | |
| #SBATCH --nodes=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os | |
| import sys | |
| import xml | |
| import gzip | |
| import json | |
| import time | |
| from collections import defaultdict | |
| import pandas as pd |
(Originally posted on twitter, here incorporating responses)
Markdown to Jupyter Notebook, and back https://github.com/aaren/notedown
Restructured text (rst) to Jupyter Notebook https://github.com/QuantEcon/sphinxcontrib-jupyter, see https://medium.com/quantecon-blog/introducing-jupinx-60ba9fc12f4f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rentrez) | |
| library(assertthat) | |
| library(readr) | |
| search_ind <- function(term){ | |
| # get the IDs for a run ID | |
| # ERR457868 searched, returns 1011219 | |
| results <- entrez_search(db="sra", term=term)$ids | |
| assert_that(length(results) == 1) | |
| results | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # requires biopython | |
| # run like: | |
| # genbank_to_tbl.py "my organism name" "my strain ID" "ncbi project id" < my_sequence.gbk | |
| # writes seq.fsa, seq.tbl as output | |
| import sys | |
| from copy import copy | |
| from Bio import SeqIO | |
| def find_gene_entry(features, locus_tag): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import deque | |
| import itertools | |
| # Make dictionary of triplets | |
| i = 0 | |
| triplet_index = {} | |
| inverse_triplet = {} | |
| for x in list(itertools.product(['A','T','G','C'], repeat=3)): | |
| triplet_index[''.join(x)] = i | |
| inverse_triplet[i] = ''.join(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # A simple loop to serially map all samples. | |
| # referenced from within http://merenlab.org/tutorials/assembly_and_mapping/ | |
| # how many threads should each mapping task use? | |
| NUM_THREADS=4 | |
| for sample in `awk '{print $1}' samples.txt` | |
| do |
OlderNewer