Skip to content

Instantly share code, notes, and snippets.

View IdoBar's full-sized avatar

Ido Bar IdoBar

View GitHub Profile
@IdoBar
IdoBar / fasta2agp.pl
Last active June 18, 2019 09:33
Fasta2APG
#!/bin/env perl
### [email protected]
### Generates contigs (in FastA) and scaffolding information (in AGP) from Velvet 'contigs.fa' supercontigs file
### Use entirely at you own risk!! There may be bugs!
### modified by [email protected] 2010/09/13
### add flags -i -size -o
@IdoBar
IdoBar / setup_nectar_teaching_server.md
Last active March 7, 2024 14:32
Setting up a NECTAR Cloud multi-user teaching server using conda

Setting up a cloud-based multi-user teaching server using conda

nectarcloud

Setup steps

  1. Apply for an allocation at NECTAR-RDS
  2. Setup 2 key-pairs (one will be for 'root-designated' login and the other for 'general-user' login), download the private keys to a secure location. If you're planning to use KiTTY or PuTTY to login to the server from Windows, you'll need to convert the .pem key file to a .ppk, as explained here. You can (and should) password-protect this key (can be done in PuTTYgen when converting the key from the default .pem format to a PuTTY-supported .ppk).
  3. Setup a customised security group to allow remote access (open port 22 for ssh logins and any addi
@IdoBar
IdoBar / install_shiny_server.bash
Last active July 10, 2024 02:17
A script to install R, Rstudio and Shiny-server on an Ubuntu server
#! /bin/bash
# Ask user for sudo password (to be used when needed)
read -s -p "Enter Password for sudo: " sudoPW
# update CRAN repository below if needed
REPO="'https://cran.rstudio.com/'"
# Based on the instructions on Dean Attali's website:
# https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/#user-libraries
@IdoBar
IdoBar / putty-theme.reg
Created February 7, 2018 05:22
An improved Default Settings profile for PuTTY
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]
"Colour0"="217,230,242"
"Colour1"="217,230,242"
"Colour2"="14,27,48"
"Colour3"="14,27,48"
"Colour4"="14,27,48"
"Colour5"="217,230,242"
"Colour6"="0,0,0"
@IdoBar
IdoBar / FastQC_aggregate.sh
Created July 16, 2017 23:12 — forked from danielecook/FastQC_aggregate.sh
Examine Fastqc reports in aggregate; brings images, statistics, and summaries together. #fastq
# Run this script in a directory containing zip files from fastqc. It aggregates images of each type in individual folders
# So looking across data is quick.
zips=`ls *.zip`
for i in $zips; do
unzip -o $i &>/dev/null;
done
fastq_folders=${zips/.zip/}
@IdoBar
IdoBar / UniRef90.md
Created May 29, 2017 23:01 — forked from sujaikumar/UniRef90.md
UniRef90 protein blast database with taxon IDs

Goal

  • To create UniRef90 protein databases for NCBI blast and Diamond Blast
  • To create a tab delimited taxid mapping file with two columns : sequenceID\tNCBITaxonID

Steps:

Download the uniref90 xml file first (warning - this is ~15 GB, will take a while)

@IdoBar
IdoBar / New_computer_setup.md
Last active February 25, 2020 03:50
Setting up a new computer for scientific and bioinformatics data analysis

Setting up a new computer for scientific and bioinformatics data analysis

Follow these instructions to setup a new computer with commonly used tools and software for scientific data analysis (with emphasis on bioinformatics)

Windows machine

Use https://ninite.com/ to install the following open source software:

  1. FileZilla - FTP file transfer
  2. Firefox - web browser, add cliget addon for easy curl/wget download links
  3. PuTTY - remote shell access
  4. Java 8
  5. .NET - framework needed for Paint.net
@IdoBar
IdoBar / updated_parallel_split_blast.sh
Last active May 16, 2017 01:26
An updated version of the original split_blast_with_GNU-Parallel.bash script, accepting command line argumens, to allow using it from within scripts and automate in pipelines
#!/bin/bash
_usage() {
cat <<EOF
$*
Usage: $0 <[options]>
Options:
-i --in input fasta file. If not specified will defaults to stdin [-]
-o --out output combined results file. If not specified will defaults to stdout [-]
-p --parts how many parts to break to input fasta into [default:5000]
@IdoBar
IdoBar / .Rprofile
Last active January 26, 2020 12:05
Example of my .Rprofile
# If loading in an environment that doesn't respect my RPATH environment
# variable, set it here
sourceDir <- file.path(path.expand("~"), "R", "source")
if (Sys.getenv("RPATH") == "") {
if (!file.exists(sourceDir)) dir.create(sourceDir)
Sys.setenv(RPATH=sourceDir)
}
# Load commonly used functions and packages
@IdoBar
IdoBar / util.R
Last active May 2, 2025 12:46
A set of utilities to make easier R working environment
# util.R:
# Utilities to make R a happier place
# Originally created by Brendan O'Connor, brenocon.com/code
# Edited by Ido Bar.
# Source the file directly from this gist using `devtools::source_gist("7f63547158ecdbacf31b54a58af0d1cc", filename = "util.R")`
########################################
## Put everything into an environment, to not pollute global namespace
util = new.env()