I have reused the code enough to make a package out of it.
The python package is deposited at Github. with an example in Jupyter notebook.
| # using starship: https://starship.rs/ | |
| eval "$(starship init zsh)" | |
| # never beep | |
| setopt NO_BEEP | |
| # auto completion: https://dev.to/rossijonas/how-to-set-up-history-based-autocompletion-in-zsh-k7o | |
| zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' | |
| autoload -U compinit && compinit |
| #!/usr/bin/env python | |
| import subprocess | |
| from pathlib import Path | |
| import numpy as np | |
| import pandas as pd | |
| import luigi | |
| from luigi.contrib.sge import SGEJobTask # fixed SGE in this branch https://github.com/wckdouglas/luigi | |
| from luigi.mock import MockTarget |
| # load libraries | |
| from keras import backend as K | |
| from keras.models import Sequential, model_from_json | |
| from keras.layers import Dense, Conv1D,\ | |
| Flatten, MaxPool1D, \ | |
| Dropout, LSTM, \ | |
| Bidirectional | |
| from sequencing_tools.fastq_tools import reverse_complement, \ | |
| onehot_sequence_encoder |
| chr1 566309 566361 - GTGATT | |
| chr1 568081 568136 + TTGAAA,TTGAAA,TTGAAA | |
| chr1 16840712 16840773 - TACTTA | |
| chr1 17067025 17222642 + TGGCAG | |
| chr1 45196732 45196802 - TCGCCT | |
| chr1 161424755 161432231 - GCGTTG | |
| chr1 161493635 161493697 - TGGTGG | |
| chr1 173834762 173834818 - TTGTAA | |
| chr1 173835773 173835846 - TCCACA | |
| chr1 204475714 204475737 + TCAAGT |
| def make_regions(chromosome_length, how_many_bases_to_look_at): | |
| start = 0 | |
| end = start + leap | |
| while end < chromosome_length: | |
| yield (start, end) | |
| start = end | |
| end = end + how_man_bases_to_look_at | |
| yield (start, chromosome_length) |
| >PrefixPE/1 | |
| AATGATACGGCGACCACCGAGATCTACACGTTCAGAGTTCTACAGTCCGACGATC | |
| >PrefixPE/2 | |
| CAAGCAGAAGACGGCATACGAGATNNNNNNGTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT | |
| >PCR_Primer1 | |
| AATGATACGGCGACCACCGAGATCTACACGTTCAGAGTTCTACAGTCCGACGATC | |
| >PCR_Primer1_rc | |
| GATCGTCGGACTGTAGAACTCTGAACGTGTAGATCTCGGTGGTCGCCGTATCATT | |
| >PCR_Primer2 | |
| CAAGCAGAAGACGGCATACGAGATNNNNNNGTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT |
| library(grid) | |
| # http://stackoverflow.com/questions/23588127/match-legend-text-color-in-geom-text-to-symbol | |
| coloring_legend_text <- function(p){ | |
| g <- ggplotGrob(p) | |
| names.grobs <- grid.ls(grid.force(g))$name | |
| labels <- names.grobs[which(grepl("label", names.grobs))] | |
| # Get the colours | |
| # The colours are the same as the colours of the plotted points. |
| /* Solarized Dark | |
| For use with Jekyll and Pygments | |
| http://ethanschoonover.com/solarized | |
| SOLARIZED HEX ROLE | |
| --------- -------- ------------------------------------------ | |
| base03 #002b36 background | |
| base01 #586e75 comments / secondary content |