Skip to content

Instantly share code, notes, and snippets.

View IdoBar's full-sized avatar

Ido Bar IdoBar

View GitHub Profile
@IdoBar
IdoBar / install-plenv.sh
Last active August 31, 2021 11:28 — forked from revmischa/install-plenv.sh
Set up plenv, install perl, cpanm, carton, set up environment
#!/bin/bash
# installs plenv, perl, carton, cpanminus, sets up environment in .bash_profile or .profile
# from https://github.com/tokuhirom/plenv#readme
MY_PROFILE_FILE="$HOME/.profile"
if [[ -n "$PERL_MB_OPT" ]]; then
echo "You must unset your local::lib environment variables first"
echo "Edit your ~/.bash_profile or ~/.bashrc and remove any references"
echo "to local::lib or export PERL*..."
@IdoBar
IdoBar / split_blast_with_GNU-Parallel.bash
Last active October 6, 2017 10:34
A bash script using GNU-Parallel to split fasta file, process it in parallel (Blast, HMMscan, etc.) and combine the output parts
#!/bin/bash -v
# Define these according to the run
N=5000
NCPUS=4
# Use wildcards or specify an exact input fasta filename below (should be in your current working directory)
INPUT_FASTA="input.fasta"
DATE=`date +%d_%m_%Y`
REFDB="nt"
#CMD=`printf "hmmscan --cpu %s --domtblout \%s/\%s.pfam.domtblout ~/.hmmer-3.1/Pfam/Pfam-A.hmm \%s > \%s/\%s_pfam.log",$NCPUS`
@IdoBar
IdoBar / FlipImage.ps1
Created July 12, 2016 13:54
FlipImage PowerShell script used to rotate images in windows from R
$path = $args[0]
[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms");
$i = new-object System.Drawing.Bitmap $path
$i.RotateFlip("Rotate90FlipNone")
$i.Save($args[1],"png")
@IdoBar
IdoBar / callPrimer3.R
Last active July 26, 2022 16:05 — forked from al2na/callPrimer3.R
calling primer3 from R
#' call primer3 for a given set of DNAstringSet object
#' Forked from https://gist.github.com/al2na/8540391
#' TODO: Add support for target amplicon region (Maybe as [] in the fasta input)
#' @param seq: DNA template as a character string (required)
#' @param fw_primer: optional forward (left) primer, if provided Primer3 will assess it and will try to find a suitable reverse primer. Default: NULL
#' @param rv_primer: optional reverse (right) primer (must be reverse-complemented to the template), if provided Primer3 will assess it and will try to find a suitable forward primer. Default: NULL
#' @param size_range: a string with space separated list of desired amplicon size ranges. Default: '151-500'
#' @param Tm: range of melting temprature parameters as a numerical vector containing (min,optimal,max). default: c(55,57,58)
#' @param name: name of the amplicon in 'chr_start_end' format
#' @param sequence_target: a string containing space separated list of target pairs: 'starting_position,target_length starting_p
@IdoBar
IdoBar / install.deps.R
Last active July 31, 2016 22:16
Install dependencies in R
# Load GO and DE data to R
## @knitr prep_data
# Install missing CRAN packages if needed
# git.packages <- c("docopt/docopt.R")
# github.packages <- c("argparser")
install.deps <- function(p, repo="cran"){
call_install <- switch(repo,cran=c("install.packages(package, repos=\"http://cloud.r-project.org/\""),